Archive for the tag 'redirect port'

SBDavid

How to redirect port using IPTABLES

How to redirect port using IPTABLES

You can redirect the port in IPTABLES using the prerouting parameter.

Following is the command you can use to redirect the traffic of the SMTP server port 587 to port 25.
This is very useful when your ISP may have the SMTP port 25 blocked so you need an additional SMTP port to connect to send emails.

iptables -t nat -I PREROUTING -p tcp –dport 587 -j REDIRECT –to-port 25

Then Run iptables save

/etc/init.d/iptables save

Restart Iptables

/etc/init.d/iptables restart