Why port redirection using iptables NAT sometimes does not work ?
Issue
- Port redirection can be done using iptables rules as following
iptables -t nat -A PREROUTING -i bond0 --dst x.x.x.x -p tcp --dport 1234 -j REDIRECT --to-port 4321
iptables -t nat -A PREROUTING -i bond1 --dst y.y.y.y -p tcp --dport 1234 -j REDIRECT --to-port 4321
-
But after some time these rule does not seem to work.
-
When we use following command to see whether the ports we are using in iptables rules are open or not, the NAT rules start working again.
nmap -sX x.x.x.x
Environment
- Red Hat Enterprise Linux Server release 5, 6
- iptables
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
