Last active
April 19, 2021 14:03
-
-
Save staybuzz/bb9d97f8a903f1988ccfd585ed4d88af 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/bash | |
sudo ip l add veth1 type veth peer name veth2 | |
sudo ip netns add host01 | |
sudo ip netns add host02 | |
sudo ip l set veth1 netns host01 | |
sudo ip l set veth2 netns host02 | |
sudo ip netns exec host01 ip l set up dev veth1 | |
sudo ip netns exec host01 ip a add 10.0.0.1/24 dev veth1 | |
sudo ip netns exec host02 ip l set up dev veth2 | |
sudo ip netns exec host02 ip a add 10.0.0.2/24 dev veth2 | |
sudo ip netns exec host01 ip a | |
sudo ip netns exec host02 ip a |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment