Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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 stackoverflow.com Nov 12 '11 at 14:49

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

1 Answer 1

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.