So what am I doing wrong here, I have a g/way that is supposed to be protecting a private server from the internet by NAT'ing the public/private addresses.
The g/way has a alias for the public address running on its publlic i/face so the config is like this
PUB=x.x.x.101
PRV=y.y.y.101
I have a table this in my iptables
--table nat --append POSTROUTING --source $PRV --out-interface $INET_IFACE --jump SNAT --to-source $PUB
but it does not work
I have the following in my iptables for testing
--table mangle --append PREROUTING --source $PRV --jump LOG --log-prefix "PRV in mangle PREROUTING "
--table mangle --append FORWARD --source $PRV --jump LOG --log-prefix "PRV in mangle FORWARD "
--table mangle --append PREROUTING --source $PRV --jump LOG --log-prefix "PRV in mangle POSTROUTING "
--table nat --append POSTROUTING --source $PRV --jump LOG --log-prefix "PRV in nat POSTROUTING "
so I can clearly see in the log file that the private host is going all the way through the mangle table as I expect it to but it never ends up in the nat table and so never gets NAT'd to the public address to get out on to the internet :-(
Okay I know I have something wrong but what?
TIA,
Pep
The g/way has a alias for the public address running on its publlic i/face so the config is like this
PUB=x.x.x.101
PRV=y.y.y.101
I have a table this in my iptables
--table nat --append POSTROUTING --source $PRV --out-interface $INET_IFACE --jump SNAT --to-source $PUB
but it does not work
I have the following in my iptables for testing
--table mangle --append PREROUTING --source $PRV --jump LOG --log-prefix "PRV in mangle PREROUTING "
--table mangle --append FORWARD --source $PRV --jump LOG --log-prefix "PRV in mangle FORWARD "
--table mangle --append PREROUTING --source $PRV --jump LOG --log-prefix "PRV in mangle POSTROUTING "
--table nat --append POSTROUTING --source $PRV --jump LOG --log-prefix "PRV in nat POSTROUTING "
so I can clearly see in the log file that the private host is going all the way through the mangle table as I expect it to but it never ends up in the nat table and so never gets NAT'd to the public address to get out on to the internet :-(
Okay I know I have something wrong but what?
TIA,
Pep