Skip to content

Instantly share code, notes, and snippets.

@zaftzaft
Created March 15, 2018 09:48
Show Gist options
  • Save zaftzaft/50d81ba58ac1c7d1cccfb9c157d3eb53 to your computer and use it in GitHub Desktop.
Save zaftzaft/50d81ba58ac1c7d1cccfb9c157d3eb53 to your computer and use it in GitHub Desktop.
brctl addbr yabai
ip link set dev yabai up
ip a a 192.168.100.10/24 dev yabai
ip link add y-to-ns1 type veth peer name ns1-to-y
ip link add y-to-ns2 type veth peer name ns2-to-y
ip netns add ns1
ip netns add ns2
ip link set ns1-to-y netns ns1
ip link set ns2-to-y netns ns2
brctl addif yabai y-to-ns1
brctl addif yabai y-to-ns2
ip link set dev y-to-ns1 up
ip link set dev y-to-ns2 up
ip netns exec ns1 ip link set dev ns1-to-y up
ip netns exec ns1 ip addr add 192.168.100.4/24 dev ns1-to-y
ip netns exec ns2 ip link set dev ns2-to-y up
ip netns exec ns2 ip addr add 192.168.100.4/24 dev ns2-to-y # dup!
# delay emu
#tc qdisc add dev y-to-ns2 root netem delay 100ms
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment