Quote:
Originally Posted by dlugasx
hi all,
does anybody knows how can I forward port using iptables ?
in my server I have three interfaces
eth0 xx.xx.xx.xx
eth1 xx.xx.xx.xx
eth0:1 xx.xx.xx.xx
eth0:2 88.88.88.88 (ip is not real just for example)
I would like to redirect port from interface eth0:2 to 192.168.1.12:80.
I know how to do it with normal interface, I mean eth0, eth1 etc etc. Iptables doesnt work correctly with alias eth0:2 on my machine.
How can I redirect port 80 from IP: 88.88.88.88 from interface eth0:2 to local address 192.168.1.12:80 ???
It have to be NAT...
help ...
|
The beauty of linux is several ways to do one thing.
One way would be
Code:
iptables -i eth0 -t nat -A PREROUTING -p tcp -d 15.45.23.67 --dport 80 -j DNAT --to-destination 192.168.1.1:80
specifying port and incoming ip is optional..
Code:
iptables -i eth0 -t nat -A PREROUTING -p tcp -j DNAT --to-destination ipaddr/ipaddrrange/port/portrange
man iptables
actually.....i dont think i have even answered your question....i just read it properly...