Skip to content

Instantly share code, notes, and snippets.

@wpyoga
Created March 30, 2021 09:42
Show Gist options
  • Save wpyoga/b8796d0366d5e755a56873dcf1028701 to your computer and use it in GitHub Desktop.
Save wpyoga/b8796d0366d5e755a56873dcf1028701 to your computer and use it in GitHub Desktop.
make a virtual ethernet connection between default ip namespace and myns namespace
ip link add name A type veth peer name B
ip addr add 10.0.0.1/24 dev A
ip link set A up
ip netns add myns
ip link set B netns myns
ip netns exec myns ip addr add 10.0.0.2/24 dev B
ip netns exec myns ip link set B up
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment