Redirecting traffic coming to port 26 to port 25

# redirect traffic coming in on port 26 to port 25
/sbin/iptables -t nat -I PREROUTING -p tcp –dport 26 -j REDIRECT –to-port 25
# make it so that this command runs on server boot up.
if ! grep -qai 26 /etc/rc.local; then
echo ‘/sbin/iptables -t nat -I PREROUTING -p tcp –dport 26 -j REDIRECT –to-port 25’ >> /etc/rc.local
fi

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: