Created
September 26, 2018 11:08
-
-
Save filiperfernandes/540665ccbb0cafde25a938579be08d2e to your computer and use it in GitHub Desktop.
Linux network namespaces sheet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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