Created
November 30, 2016 09:34
-
-
Save larsch/c38854460e8713b0bc6dbf467daeedf0 to your computer and use it in GitHub Desktop.
This file contains 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
#!/bin/sh -exu | |
ip netns delete ns1 | |
ip netns delete ns2 | |
ip netns add ns1 | |
ip link add veth-ns1 type veth peer name veth-ns2 | |
ip link set veth-ns1 netns ns1 | |
ip -n ns1 link set veth-ns1 up | |
ip link set veth-ns2 up | |
ip -n ns1 address add 10.0.0.1/30 dev veth-ns1 | |
ip address add 10.0.0.2/30 dev veth-ns2 | |
ip netns exec ns1 ping -c 1 10.0.0.2 | |
ping -c 1 10.0.0.1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment