{"id":93,"date":"2010-04-04T18:12:40","date_gmt":"2010-04-04T18:12:40","guid":{"rendered":"http:\/\/www.huzs.top\/?p=93"},"modified":"2010-04-04T18:12:40","modified_gmt":"2010-04-04T18:12:40","slug":"93","status":"publish","type":"post","link":"https:\/\/www.huzs.top\/?p=93","title":{"rendered":"iptables"},"content":{"rendered":"<p>iptables -t nat -L\u00a0\u00a0\u67e5\u770bnat\u8868\u4e2d\u6240\u6709\u4fe1\u606f\\n\\niptables -F\u00a0\u00a0\u5220\u9664filter\u8868\u4e2d\u6240\u6709\u89c4\u5219\\niptables -t nat -F\u00a0\u00a0\u5220\u9664nat\u8868\u4e2d\u6240\u6709\u89c4\u5219\\n\\niptables -X\u00a0\u00a0\u5220\u9664\u94fe\\n\\niptables -A\u00a0\u00a0\u6dfb\u52a0\u89c4\u5219\\niptables -D\u00a0\u00a0\u5220\u9664\u89c4\u5219\\n\\n\u8bbe\u7f6e\u5185\u7f6e\u89c4\u5219\u94fe\u7684\u7f3a\u7701\u7b56\u7565\\niptables -P INPUT Drop(\u7cfb\u7edf\u9ed8\u8ba4\u662fACCEPT)\\n<!--more-->\\n\u8bbe\u7f6e\u4e3b\u673a\u9632\u706b\u5899\u7b56\u7565\\niptables -F\u00a0\u00a0\u6e05\u695a\u6240\u6709\u89c4\u5219\\niptables -X\u00a0\u00a0\u6e05\u9664\u6240\u6709\u94fe\\niptables -Z\u00a0\u00a0\u6e05\u96f6\u8ba1\u6570\u5668\\niptables -P INPUT Drop \u8bbe\u7f6e\u5185\u7f6e\u89c4\u5219\u94fe\u7684\u7f3a\u7701\u7b56\u7565\u4e3a\u4e22\u5f03\\niptables -A INPUT -i lo -j ACCEPT\\niptables -A INPUT -i eth0 -p tcp &#8211;dport 22 -j ACCEPT\\niptables -A INPUT -i eth0 -p tcp &#8211;dport 21 -j ACCEPT\\niptables -A INPUT -i eth0 -p tcp &#8211;dport 80 -j ACCEPT\\nservice iptables save\\n\\n1\\niptables -P INPUT ACCEPT\\niptables -P FORWARD ACCEPT\\niptables -P OUTPUT ACCEPT\\n\\n2\\niptables -P INPUT Drop\\niptables -P FORWARD ACCEPT\\niptables -P OUTPUT ACCEPT\\n\\n&#8212;&#8212;&#8211;RULES&#8212;&#8212;&#8212;\\n\u53ea\u5141\u8bb8\u5185\u7f51PING\\niptables -I INPUT -s 192.168.0.0\/23 -p icmp -j ACCEPT\\n\u53ea\u5141\u8bb8\u5185\u7f51SSH\\niptables -I INPUT -s 192.168.0.0\/23 -p tcp &#8211;dport 22 -j ACCEPT\\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-\\n\\n3\\niptables -P INPUT Drop\\niptables -P FORWARD Drop\\niptables -P OUTPUT ACCEPT\\n\\n4\\niptables -P INPUT Drop\\niptables -P FORWARD Drop\\niptables -P OUTPUT Drop\\n\\niptables -A INPUT -p tcp &#8211;dport 22 -j ACCEPT\\niptables -A INPUT -p tcp &#8211;dport 80 -j ACCEPT\\niptables -A FORWARD -p udp &#8211;dport 53 -j ACCEPT\\niptables -A INPUT -p udp &#8211;dport 53 -j ACCEPT\\n\\n\\niptables -P INPUT Drop\\niptables -A OUTPUT -p tcp &#8211;dport 22 -j ACCEPT\\niptables -A OUTPUT -p tcp &#8211;dport 80 -j ACCEPT\\niptables -P OUTPUT Drop<\/p>\n","protected":false},"excerpt":{"rendered":"<p>iptables -t nat -L\u00a0\u00a0\u67e5\u770bnat\u8868\u4e2d\u6240\u6709\u4fe1\u606f\\n\\niptables -F\u00a0\u00a0\u5220\u9664filte [&hellip;]<\/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":[26],"class_list":["post-93","post","type-post","status-publish","format-standard","hentry","category-linux","tag-linux"],"_links":{"self":[{"href":"https:\/\/www.huzs.top\/index.php?rest_route=\/wp\/v2\/posts\/93","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.huzs.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.huzs.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.huzs.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.huzs.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=93"}],"version-history":[{"count":0,"href":"https:\/\/www.huzs.top\/index.php?rest_route=\/wp\/v2\/posts\/93\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.huzs.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=93"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.huzs.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=93"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.huzs.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=93"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}