{"id":21,"date":"2006-07-11T09:48:29","date_gmt":"2006-07-11T09:48:29","guid":{"rendered":"http:\/\/ramblingsofasysadmin.com\/blog\/?p=21"},"modified":"2006-07-11T09:48:29","modified_gmt":"2006-07-11T09:48:29","slug":"iptables-port-redirection-smtp-servers","status":"publish","type":"post","link":"https:\/\/ramblingsofasysadmin.com\/?p=21","title":{"rendered":"iptables port redirection (smtp servers)."},"content":{"rendered":"<p>this is a quick tutorial on tables port redirection.<br \/>\nwe have a few clients whose outgoing port 25 is blocked by their ISP due to vulnerabilities and exploits that cause this port to send out considerable amounts of spam.<br \/>\nthis is never an obstacle for someone who hosts on a linux server with iptables, because you simply can forward traffic from port 25 to another port (e.g. 26, as in the example below):<br \/>\n<font face=\"courier\"># iptables -t nat -I PREROUTING -p tcp &#8211;dport 26 -j REDIRECT &#8211;to-ports 25<\/font><br \/>\neasy, isn&#8217;t it?<br \/>\nof course, if 26 is blocked, you can substitute another open port &#8212; but 25 must remain the same, as 25 is the standard smtp (outgoing email) port.<br \/>\nfor someone who needs to utilize these settings, s\/he would be required to go to outlook or whatever email application is being used and change the smtp port from standard 25 to 26 (in outlook, this can be done by going to tools > email accounts > view or change existing email accounts > select the questionable email account > change > more settings > advanced tab > change 25 to 26).<br \/>\nthen, try to send out the email.  it should no longer be sitting in the user&#8217;s outbox.<br \/>\nto verify that the change was made on the linux side, simply run:<br \/>\n<font face=\"courier\"># iptables -t nat &#8211;list<\/font><br \/>\nthe output should show something like this:<br \/>\n<font face=\"courier\">Chain PREROUTING (policy ACCEPT)<br \/>\ntarget     prot opt source               destination<br \/>\nREDIRECT   tcp  &#8212;  anywhere             anywhere            tcp dpt:26 redir ports 25<br \/>\n<\/font><br \/>\nconfirmed &#8212; it is working!<br \/>\nmake sure to save your changes so that the rules are maintained between reboots:<br \/>\n<font face=\"courier\"># \/sbin\/iptables-save<\/font><\/p>\n","protected":false},"excerpt":{"rendered":"<p>this is a quick tutorial on tables port redirection. we have a few clients whose outgoing port 25 is blocked by their ISP due to vulnerabilities and exploits that cause this port to send out considerable amounts of spam. this is never an obstacle for someone who hosts on a linux server with iptables, because you simply can forward traffic from port 25 to another port (e.g. 26, as in the example below): # iptables <span class=\"ellipsis\">&hellip;<\/span> <span class=\"more-link-wrap\"><a href=\"https:\/\/ramblingsofasysadmin.com\/?p=21\" class=\"more-link\"><span>Read More &rarr;<\/span><\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-21","post","type-post","status-publish","format-standard","hentry","category-tutorials"],"_links":{"self":[{"href":"https:\/\/ramblingsofasysadmin.com\/index.php?rest_route=\/wp\/v2\/posts\/21","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ramblingsofasysadmin.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ramblingsofasysadmin.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ramblingsofasysadmin.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ramblingsofasysadmin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=21"}],"version-history":[{"count":0,"href":"https:\/\/ramblingsofasysadmin.com\/index.php?rest_route=\/wp\/v2\/posts\/21\/revisions"}],"wp:attachment":[{"href":"https:\/\/ramblingsofasysadmin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=21"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ramblingsofasysadmin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=21"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ramblingsofasysadmin.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=21"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}