Andy Bavier | c518f25 | 2016-04-08 16:37:54 -0400 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
| 3 | apt-get update |
| 4 | apt-get install bridge-utils |
| 5 | brctl addbr databr |
| 6 | ifconfig databr 10.168.0.1/24 up |
| 7 | ip link add address 02:42:0a:a8:00:01 type veth |
| 8 | ifconfig veth0 up |
| 9 | ifconfig veth1 up |
| 10 | brctl addif databr veth0 |
| 11 | ip addr add 10.168.1.1/24 dev databr |
| 12 | iptables -t nat -A POSTROUTING -s 10.168.0.0/16 \! -d 10.168.0.0/16 -j MASQUERADE |
| 13 | sysctl -w net.ipv4.ip_forward=1 |
| 14 | sysctl -w net.ipv4.conf.all.send_redirects=0 |
| 15 | sysctl -w net.ipv4.conf.default.send_redirects=0 |
| 16 | sysctl -w net.ipv4.conf.eth0.send_redirects=0 |
| 17 | sysctl -w net.ipv4.conf.databr.send_redirects=0 |