I have a public facing box that also has a pseudo interface (please
note real ip addresses have not been disclosed)
eg: eth0 192.168.1.200
eth0:1 192.168.1.201
i have also registered a domain against each ip address
eg:
www.mydomain1.com forwards to 192.168.1.200:80
www.mydomain2.com forwards to 192.168.1.201:80
i am trying to set up some natting that will internally re-direct to a
different port - based upon the distination address
eg: for traffic hitting 192.168.1.200:80 -> 192.168.1.200:7100
for traffic hitting 192.168.1.201:80 -> 192.168.1.201:7200
here is my script:
#!/bin/sh
/sbin/iptables -A FORWARD -p tcp --dport 80 -j ACCEPT
/sbin/iptables -t nat -A PREROUTING -p tcp --dport 80 --dst
192.168.1.200/255.255.255.0 -j DNAT --to-destination
192.168.1.200:7100
/sbin/iptables -t nat -A PREROUTING -p tcp --dport 80 --dst
192.168.1.201/255.255.255.0 -j DNAT --to-destination
192.168.1.201:7200
gratefull for any advice as it's not working
thx