{"id":51,"date":"2005-10-31T23:51:22","date_gmt":"2005-11-01T07:51:22","guid":{"rendered":"http:\/\/hongyu.org\/wordpress\/?p=51"},"modified":"2005-11-01T16:00:50","modified_gmt":"2005-11-02T00:00:50","slug":"iptables","status":"publish","type":"post","link":"https:\/\/www.hongyu.org\/wordpress\/?p=51","title":{"rendered":"iptables"},"content":{"rendered":"<p>* In the text below the single &#8216;-&#8216; in front of long option should be double &#8216;-&#8216;, such as -dport should dash-dash-dport. WordPress messed up with  double dashes.<\/p>\n<p>. redirect all traffic destined to port 80 to port 22 only from a specific IP address<br \/>\niptables -t nat -A PREROUTING -p tcp &#8211;dport 80 -s 127.1.1.2 -j REDIRECT &#8211;to-ports 22<\/p>\n<p>. redirect all traffic destined to port 80 to port 22 only from a specific MAC address<br \/>\niptables -t nat -A PREROUTING -p tcp &#8211;dport 80 -m mac &#8211;mac-source 00:06:5B:95:89:41 -j REDIRECT &#8211;to-ports 22<\/p>\n<p>. list all rules in nat table<br \/>\n<em>iptables -t nat -n -L<\/em><\/p>\n<p>. delete rule 1 in nat table on PREROUTING chain<br \/>\niptables -t nat -D PREROUTING 1<\/p>\n","protected":false},"excerpt":{"rendered":"<p>* In the text below the single &#8216;-&#8216; in front of long option should be double &#8216;-&#8216;, such as -dport should dash-dash-dport. WordPress messed up with double dashes. . redirect all traffic destined to port 80 to port 22 only from a specific IP address iptables -t nat -A PREROUTING -p tcp &#8211;dport 80 -s &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.hongyu.org\/wordpress\/?p=51\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;iptables&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[2],"tags":[],"_links":{"self":[{"href":"https:\/\/www.hongyu.org\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/51"}],"collection":[{"href":"https:\/\/www.hongyu.org\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hongyu.org\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hongyu.org\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hongyu.org\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=51"}],"version-history":[{"count":0,"href":"https:\/\/www.hongyu.org\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/51\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.hongyu.org\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=51"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hongyu.org\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=51"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hongyu.org\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=51"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}