I am an ubuntu noob and would appreciate help with DNAT on Ubuntu 12.04, which I am using for a firewall/router. I have two public interfaces and one private interface. I want to DNAT traffic from public interface eth0 to 10.1.1.5 on the private LAN, and I want to DNAT traffic from public interface eth2 to 10.1.1.6 on the private LAN.
I am using IPTABLES, and this is my configuration:
/sbin/iptables -t nat -A PREROUTING -p tcp -d X.X.X.X --dport 80 -j DNAT --to
/sbin/iptables -t nat -A PREROUTING -p tcp -d y.y.y.y --dport 80 -j DNAT --to
x.x.x.x = eth0
y.y.y.y = eth2
DNAT works for eth0 but not for eth2, although I can ping y.y.y.y from the public side.
Can anyone please help me determine why DNAT is not working for eth2? Does DNAT only work on the primary interface?
Thanks in advance!