Skip to content

Instantly share code, notes, and snippets.

@filiperfernandes
Created September 26, 2018 11:08
Show Gist options
  • Save filiperfernandes/540665ccbb0cafde25a938579be08d2e to your computer and use it in GitHub Desktop.
Save filiperfernandes/540665ccbb0cafde25a938579be08d2e to your computer and use it in GitHub Desktop.
Linux network namespaces sheet
# List all namespace, except for the default/global one.
ip netns
# Same as above, list all namespaces.
ip netns list
# Execute command inside a specific namespace
ip netns exec <namespace_name> <command>
# Sets specified interface in the specified namespace
ip link set <interface> netns <namespace>
# Bring interface up
ip link set <interface> up
# Add veth pair
ip link add type veth
# Add veth pair by specifying the name for each peer
ip link add <veth-peer1> type veth peer name <veth-peer2>
# Adds a new bridge
ovs-vsctl add-br <bridge_name>
# Adds a new port in the specific bridge
ovs-vsctl add-port <bridge_name> <port_name>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment