Skip to content

Instantly share code, notes, and snippets.

@kmurudi
Last active April 28, 2018 03:00
Show Gist options
  • Save kmurudi/ae3e2204583542514970d3c64b86a70d to your computer and use it in GitHub Desktop.
Save kmurudi/ae3e2204583542514970d3c64b86a70d to your computer and use it in GitHub Desktop.
sudo apt-get install docker.io
sudo docker build -t fw_ubuntu .
sudo docker run -itd --privileged --name=SC1 fw_ubuntu
sudo docker run -itd --privileged --name=SC2 fw_ubuntu
sudo docker run -itd --privileged --name=LC1 fw_ubuntu
sudo docker run -itd --privileged --name=LC2 fw_ubuntu
sudo docker run -itd --privileged --name=CS1 fw_ubuntu
sudo docker run -itd --privileged --name=CS2 fw_ubuntu
sudo docker run -itd --privileged --name=CS3 fw_ubuntu
sudo docker run -itd --privileged --name=CS4 fw_ubuntu
sudo ip link add sc11 type veth peer name lc11
sudo ip link add sc12 type veth peer name lc22
sudo ip link add sc22 type veth peer name lc12
sudo ip link add sc21 type veth peer name lc21
sudo ip link add lc13 type veth peer name br11
sudo ip link add lc23 type veth peer name br21
sudo ip link add br12 type veth peer name cs1
sudo ip link add br13 type veth peer name cs2
sudo ip link add br22 type veth peer name cs3
sudo ip link add br23 type veth peer name cs4
sudo brctl addbr br1
sudo brctl addbr br2
sudo brctl addif br1 br11
sudo brctl addif br1 br12
sudo brctl addif br1 br13
sudo brctl addif br2 br21
sudo brctl addif br2 br22
sudo brctl addif br2 br23
# remember to UP all links
sudo ip link set br1 up
sudo ip link set br2 up
sudo ip link set br11 up
sudo ip link set br12 up
sudo ip link set br13 up
sudo ip link set br21 up
sudo ip link set br22 up
sudo ip link set br23 up
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment