![]() |
port forwarding does not work on additional ip addresses
hi,
i am probably missing something really stupid but... i have just added an additional ip address to my external interface ( yes my isp knows about the ip address and i have had another machine on it before ). my system has assiged the interface name eth0 : 0 ( the spaces are to prevent a smiley poping up ) for some reason, the port forwarding is not working at all on any virtual interface i used the following line to add in the port forwarding: ( i have changed the external ip address Code:
iptables -t nat -A PREROUTING -p tcp -i 44.44.44.46 --dport 8080 -j DNAT --to-destination 192.168.0.201:80 and it would be good to have it all written down too :) does anyone have any ideas as to what is wrong? i have only the basic stuff in my iptables ( set up for NAT ) |
Don't create a virtual interface just bind additional address to the NIC with
ip add addr add <ip> dev <device>; Are you SNAT the connection on the way out? iptables -t nat -A POSTROUTING -p tcp -s 192.168.0.201 -J SNAT --to-source 44.44.44.46 or masquearing the connection is OK too Your DNAT rule should be iptables -t nat -A PREROUTING -p tcp -d 44.44.44.46 --dport 8080 -j DNAT --to-destination 192.168.0.201:80 Not iptables -t nat -A PREROUTING -p tcp -i 44.44.44.46 --dport 8080 -j DNAT --to-destination 192.168.0.201:80 The -i is interface option. |
All times are GMT -5. The time now is 08:45 PM. |