I'm pretty new to iptables. My server has two Ethernet cards (eth0, eth1) and an ADSL router that is in bridge mode connected to the eth0 which created ppp0 when dialed.
I'm trying to forward external port 80 to my local machine (192.168.2.2) connected in eth1.
My Internet sharing is done by:
iptables -t nat -A POSTROUTING -s 192.168.2.0/255.255.255.0 -o ppp0 -j MASQUERADE
(if there is a better way feel free to show me)
I am trying to use:
iptables -A FORWARD -i eth1 -p tcp --dport 80 -j ACCEPT
iptables -t nat -A PREROUTING -p tcp -i eth1 --dport 80 -j DNAT --to-destination 192.168.2.2:80
but I don't know to which Ethernet interface I should be pointing it. Any ideas?