NAT on one interface Home Page › Forums › Network Management › Networking › NAT on one interface This topic contains 5 replies, has 0 voices, and was last updated by somleac 9 years, 4 months ago. Viewing 7 posts - 1 through 7 (of 7 total) Author Posts January 20, 2010 at 11:24 am #42152 somleacMember Hi, I need to set up a router box with following configuration: ETH0 : LAN : 192.168.x.x/24 ETH1 : WAN : eg.: 18.104.22.168 ETH2 : Servers subnet : eg.: 100.100.100.0/28 I need to have NAT enabled only for LAN to WAN and Servers subnet just routed from eth2 to eth1. As far as I understood NAT configured from inside the ZeroShell interface will enable all traffic to be NAT-ed which I do not need. I need help in configuring scripts for NAT. Thanks. somleac. January 20, 2010 at 10:59 pm #49412 ppaliasMember In your case you’ll have to manually write down the iptables commands in a script and create a script to run it post boot. http://www.frozentux.net/documents/iptables-tutorial/ A fine iptables tutorial. January 21, 2010 at 9:36 am #49413 somleacMember Thank you ppalias. I know that hard way … 🙂 – knows as r.t.f.m. I hoped that somebody had the same issue and can give me a more precise solution. Regards, somleac January 21, 2010 at 10:40 am #49414 ppaliasMember Something like this maybe iptables -t nat -I 1 POSTROUTING --src 192.168.x.x/24 -o eth1 -j MASQUERADE January 22, 2010 at 10:33 am #49415 somleacMember Thank you ppalias for your fas replay. Unfortunately I can not test the configuration this days. I will come back late next week with details about. regards, somleac. January 22, 2010 at 6:34 pm #49416 ppaliasMember Just an edit on the command. January 31, 2010 at 6:03 am #49417 somleacMember Hi ppalias, Finally I managed to test the config. You gave me a good command. Talking to a friend I choose to use -A instead of -I 1 argument. Thank you ppalias. somleac Author Posts Viewing 7 posts - 1 through 7 (of 7 total) You must be logged in to reply to this topic.