#!/bin/bash

ip route

ifconfig eth0 0
ifconfig eth1 0
ifconfig eth2 0

netstat -rn

vconfig add eth0 1172
vconfig add eth0 1173

ifconfig eth0.1172 172.16.50.36/29
ifconfig eth0.1173 172.16.50.14/30
ifconfig eth1 10.0.0.10/30



route add -net 192.168.205.0/29 gw 10.0.0.9
route add -net 192.168.160.0/28 gw 10.0.0.9
route add -net 192.168.200.32/27 gw 10.0.0.9
route add -net 192.168.200.0/28 gw 10.0.0.9
route add -net 10.30.0.0/30 gw 10.0.0.9

dhclient eth2

cat /proc/sys/net/ipv4/ip_forward

echo 1 > /proc/sys/net/ipv4/ip_forward

iptables -t nat -A POSTROUTING -o eth2 -s 192.168.205.0/29 -j MASQUERADE

iptables -t nat -A POSTROUTING -o eth2 -s 172.16.50.12/30 -j MASQUERADE

iptables -t nat -A POSTROUTING -o eth2 -s 172.16.50.32/29 -j MASQUERADE


