I have a two subnet configuration at my house.
The first subnet (192.168.1.0/24) includes my broadband modem/router.
My second subnet (192.168.2.0/24) contains all of my client computers - desktops, xbox, laptops, etc
Sitting on both these networks is my debian box (acting as a router) - it has two interfaces:
eth1 192.168.1.2 (first subnet)
eth0 192.168.2.2 (second subnet)
Now in order for my client computers to access the net I configured the Debian box to NAT using the command:
Code:
iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE
(I have a script that sets up a bunch of other iptables rules as well as enabling ip forwarding)
So Now the questions!
1. Is it inefficient to have my packets being NAT'ed twice - once at the modem and once at my debian box ??
2. Should I get rid of NAT and just have the packets forwarded on to the first subnet from the second?
3. Does anyone know how would I should go about doing this?
let me know if you want me to post my full IPTABLES script.