I had nat working with class C addresses like this:

Linux box with 2 interfaces
eth0 204.204.1.11  (public -- or somthing similar)
eth1 192.168.1.1 (private)

Our gateway to Internet 204.204.1.1 (set on this linux box)

On a PC
192.168.1.50
gateway 192.168.1.1
netmask 255.255.255.0

iptables -t nat -A POSTROUTING -o eth0 -j SNAT --to-source 204.204.1.11

and that works fine.

But I have more than 254 machines so I need a wider range.  I thought I 
could use class B addresses but I am unsure how to use it.  I changed it to:

eth0 public 204.204.1.11
eth1 172.16.0.1
netmask 255.255.0.0

Our gateway to internet is 204.204.1.1

On the PC
172.16.0.60
gateway 172.16.0.1
netmask 255.255.0.0

same iptables command as above -- this works fine

BUT how do I then use other addresses on the PC?? I try to setup a PC 
with 172.16.1.50 with gateway 172.16.0.1 but it cannot ping its gateway. 
 Do I need to setup some kind of static route on the linux box?  

I look in the books and they always talk about subnetting but it seems 
they always have more gateways ....  

I know this isn't technically at iptables question but if someone could 
point me in the right direction I would be grateful

Thanks
Jon Church




Reply via email to