ChetanGaonker | 901727c | 2016-11-29 14:05:03 -0800 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | sudo brctl addbr fabric |
| 4 | sudo ip link set fabric up |
| 5 | sudo ip link add veth0 type veth peer name veth1 |
| 6 | sudo ip link set veth0 up |
| 7 | sudo ip link set veth1 up |
| 8 | sudo brctl addif fabric veth0 |
| 9 | sudo brctl addif fabric eth1 |
| 10 | sudo ip addr flush eth1 |
| 11 | sudo ip link set address 00:00:00:00:00:01 dev fabric |
| 12 | sudo ip link set address 00:00:00:00:00:01 dev eth1 |
| 13 | sudo ip address add 20.0.0.1/24 dev fabric |
| 14 | sudo ip address add 10.168.0.1/24 dev fabric |
| 15 | sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE |