centos 5.x

I'm wondering how I can forward "all" ports incoming to a eth0:alias IP to a specific internal IP address.

I have found ways to-do this for particular ports, but I wish to forward every port.

Can someone point me in the right direction please!

:-)

link|improve this question
feedback

2 Answers

Hi I believe this step by step how to should be what you need.

http://www.howtoforge.com/nat_iptables

You want to go with NAT instead of PAT.

link|improve this answer
feedback

Pablo is absolutely right, but I might as well provide a sample line here, which assumes your eth0:alias address is 1.2.3.5 and your internal IP of choice is 10.1.1.2:

iptables -t nat -A PREROUTING  -p tcp -i eth0 -d 1.2.3.5 -j DNAT --to-destination 10.11.1.2

If you want UDP as well, either have a second line for udp or just remove -p tcp.

This answer is no substitute for reading and understanding a good HOWTO, but it gives you some idea of where to start looking.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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