I have 1 server is still running with
web service and
reverse proxy service. My server also have 2 IPs.
Web service with port: 80
Reverse proxy service with port: 6060
IP: 1.2.3.4 and 5.6.7.8
So, I want config with iptables to redirect port, example:
Code:
iptables -t nat -A PREROUTING -p tcp --dport 80 ! -s 1.2.3.4 -j REDIRECT --to-ports 6060
iptables -t nat -A PREROUTING -p tcp --dport 80 ! -s 5.6.7.8 -j REDIRECT --to-ports 6060
But, problem will occured: if first run config like that, second rule not work. Because first rule detect and redirect to:
1.2.3.4:6060
Yes, it's time second rule not effective.
I don't want to re-config web service to listen other port.
Thank all read.