Skip to content

Instantly share code, notes, and snippets.

@lhuard1A
Created January 8, 2015 10:39
Show Gist options
  • Save lhuard1A/917054bb25bed4e38b2e to your computer and use it in GitHub Desktop.
Save lhuard1A/917054bb25bed4e38b2e to your computer and use it in GitHub Desktop.
VxLAN setup
#!/bin/sh
iptables -w -t nat -D POSTROUTING -o ens192 -j MASQUERADE ! -d 192.168.0.0/16
ip route del 192.168.0.0/16 dev br0
ip addr del dev br0 192.168.$NUM_MACHINE.1/24
ip link set dev vxlan0 down
brctl delif br0 vxlan0
ip link set dev br0 down
brctl delbr br0
ip link delete vxlan0 type vxlan
#!/bin/sh
ip link add vxlan0 type vxlan id 42 group 239.1.1.42 dev ens192 dstport 0
brctl addbr br0
brctl addif br0 vxlan0
ip link set dev vxlan0 up
ip addr add dev br0 192.168.$NUM_MACHINE.1/24
ip route add 192.168.0.0/16 dev br0
iptables -w -t nat -A POSTROUTING -o ens192 -j MASQUERADE ! -d 192.168.0.0/16
echo "Lancer docker -d -H fd:// --bridge=\"br0\" --iptables=false"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment