Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to forward connections on port 18600 to port 9980. I have this in /etc/sysconfig/iptables:

# Generated by iptables-save v1.3.5 on Mon Oct 21 18:30:43 2013
-A PREROUTING -p tcp -m tcp --dport 18600 -j REDIRECT --to-ports 9980
# Completed on Mon Oct 21 18:30:43 2013

and /etc/init.d/iptables status shows me this:

Table: nat
num  target     prot opt source               destination         
1    REDIRECT   tcp  --             tcp dpt:18600 redir ports 9980 

However, I can telnet from localhost to port 9980, but not 18600. What am I missing? (This is a CentOS-based VM.)

share|improve this question
up vote 1 down vote accepted

Packets from the local machine do not pass through the NAT PREROUTING table.

Test from another machine.

If you need to DNAT the traffic that originates from the local machine, use the NAT OUTPUT table.

share|improve this answer
Ah, I had no idea a different table was involved for local traffic. NAT OUTPUT was exactly what I needed. – cbmanica Oct 22 '13 at 16:25

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.