Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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

My PC has two IP addresses. How can I forward incoming requests on port 80 to 8080 from one of my IP using iptables in CentOS ?

For example, I have ip addresses and, I want to forward port 80 to port8080 and just for but not

How do I do this?

share|improve this question

migrated from Nov 12 '11 at 14:49

This question came from our site for professional and enthusiast programmers.

iptables -t nat -A PREROUTING -d -p tcp --dport 80 -j DNAT --to-destination
share|improve this answer

Your Answer


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