Hello
I'm trying to create containers to be used as gateways. Let me explain:
HN (192.168.0.1)
/--------------------------------------------\
| |
| VE VE |
| .---------. .---------. |
| | 100 | | 101 | |
| '---------' '---------' |
| ^ ^ |
| | | |
\----------|----------------------|----------/
| |
| |
V V
.---------. .---------.
| 200 | | 201 |
'---------' '---------'
Notebook Notebook
The numbers represent the IP addr (192.168.0.X)
My HN has 2 NICs, one has an external (real) IP, the other is in the 192.168.0.0 range. Every VE and computer are in the same ip range.
I want to use separates gateways to get to the internet, each notebook connecting to a different gw. My DHCPD is assigning everything correctly, no problems there.
When I use
iptables -t nat -A POSTROUTING -j SNAT -s 192.168.0.0/16 -o eth1 --to-source $EXTERNAL_IP
everyone has Internet access, including the notebooks BUT they are not using the gateways! What should I do to ensure that each notebook just exits the network through it's assigned gateway? I know I'll need a lot o iptables-magic but I just don't know where to start!
Thanks in advance