Linux iptables: Port Redirection Example

Linux iptables: Port Redirection Example: "How do I redirect 80 port to 8123 using iptables?

You can easily redirect incoming traffic by inserting rules into PREROUTING chain of the nat table. You can set destination port using the REDIRECT target.
Syntax
The syntax is as follows to redirect tcp $srcPortNumber port to $dstPortNumber:
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport [...]

Answer to 'Linux iptables: Port Redirection Example'


Copyright © nixCraft. All Rights Reserved.

"