I have a router setup to forward 192.168.1.x (private/internal) addresses to A.B.C.x (public) addresses and public to private. The x variable remains the same.
192.168.1.x ß à eth0 (router/iptables) eth1 ß à A.B.C.x
Using the following configuration I have had no luck getting anything to forward. (yes I’ve enabled ip_forward and correctly compiled the kernel). If I run a traceroute from a machine outside our network it will find the router, but if I traceroute a machine behind the firewall (A.B.C.x), the trace will hang just before it gets to my router and then won’t find my router.
Route:
Route add –net A.B.C.x netmask 255.255.255.255 dev eth1
(also add default gateway and loopback interface)
iptables:
iptables –t nat –A PREROUTING –d A.B.C.x –I eth0 –j DNAT –to 192.168.1.x
iptables –t nat –A POSTROUTING –s 192.168.1.x –I eth0 –j SNAT –to A.B.C.x
Thanks,
Patrick A.