﻿{"id":220,"date":"2014-09-28T11:50:40","date_gmt":"2014-09-28T03:50:40","guid":{"rendered":"http:\/\/blog.sway.com.cn\/?p=220"},"modified":"2014-11-28T17:02:33","modified_gmt":"2014-11-28T09:02:33","slug":"centos-6-0-iptables-%e5%bc%80%e6%94%be%e7%ab%af%e5%8f%a380-3306-22%e7%ab%af%e5%8f%a3","status":"publish","type":"post","link":"http:\/\/blog.sway.com.cn\/?p=220","title":{"rendered":"CENTOS 6.0 iptables \u5f00\u653e\u7aef\u53e380 3306 22\u7aef\u53e3"},"content":{"rendered":"<pre class=\"lang:sh decode:true \">#\/sbin\/iptables\u00a0-I INPUT -p tcp --dport 80 -j ACCEPT<\/pre>\n<pre class=\"lang:sh decode:true \">\u00a0#\/sbin\/iptables -I INPUT -p tcp --dport 22 -j ACCEPT<\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"lang:sh decode:true \">#\/sbin\/iptables -I INPUT -p tcp --dport 3306 -j ACCEPT<\/pre>\n<p>&nbsp;<\/p>\n<p>\u7136\u540e\u4fdd\u5b58\uff1a #\/etc\/rc.d\/init.d\/iptables save<\/p>\n<p><wbr \/><\/p>\n<p>\u67e5\u770b\u6253\u5f00\u7684\u7aef\u53e3\uff1a<\/p>\n<pre class=\"lang:sh decode:true \"># \/etc\/init.d\/iptables status<\/pre>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<p>\u8865\u5145\u8bf4\u660e\uff1a<\/p>\n<p>#\u5173\u95ed\u9632\u706b\u5899<\/p>\n<p>\/etc\/init.d\/iptables stop<\/p>\n<p>service iptables stop # \u505c\u6b62\u670d\u52a1<\/p>\n<p>&nbsp;<\/p>\n<p>#\u67e5\u770b\u9632\u706b\u5899\u4fe1\u606f<\/p>\n<p>\/etc\/init.d\/iptables status<br \/>\n#\u5f00\u653e\u7aef\u53e3:8080<\/p>\n<p>\/sbin\/iptables -I INPUT -p tcp &#8211;dport 8080 -j ACCEPT<\/p>\n<p>&nbsp;<\/p>\n<p>#\u91cd\u542f\u9632\u706b\u5899\u4ee5\u4fbf\u6539\u52a8\u751f\u6548:(\u6216\u8005\u76f4\u63a5\u91cd\u542f\u7cfb\u7edf)<\/p>\n<p>\/etc\/init.d\/iptables restart<\/p>\n<p>&nbsp;<\/p>\n<p>#\u5c06\u66f4\u6539\u8fdb\u884c\u4fdd\u5b58<\/p>\n<p>\/etc\/rc.d\/init.d\/iptables save<\/p>\n<p>&nbsp;<\/p>\n<p>\u53e6\u5916\u76f4\u63a5\u5728\/etc\/sysconfig\/iptables\u4e2d\u589e\u52a0\u4e00\u884c\uff1a<\/p>\n<p>-A RH-Firewall-1-INPUT -m state \u2013state NEW -m tcp -p tcp \u2013dport 8080 -j ACCEPT<\/p>\n<p>#\u6c38\u4e45\u5173\u95ed\u9632\u706b\u5899 <a href=\"http:\/\/www.so.com\/s?q=chkconfig&amp;ie=utf-8&amp;src=se_lighten_f\" target=\"_blank\">chkconfig<\/a>\u00a0\u2013level 35 iptables off #\u6b64\u65b9\u6cd5\u6e90\u81ea\u7f51\u7edc\uff0c\u672a\u5b9e\u9a8c\uff0c\u5b89\u5168\u8003\u8651\u62d2\u7edd\u4f7f\u7528\u6b64\u65b9\u6cd5<\/p>\n","protected":false},"excerpt":{"rendered":"<p>#\/sbin\/iptables\u00a0-I INPUT -p tcp &#8211;dport  &hellip; <a href=\"http:\/\/blog.sway.com.cn\/?p=220\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7,11],"tags":[23,99,101,100,234],"class_list":["post-220","post","type-post","status-publish","format-standard","hentry","category-7","category-11","tag-centos","tag-centos6","tag-ip6tables","tag-iptables","tag-linux"],"_links":{"self":[{"href":"http:\/\/blog.sway.com.cn\/index.php?rest_route=\/wp\/v2\/posts\/220","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/blog.sway.com.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.sway.com.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.sway.com.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.sway.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=220"}],"version-history":[{"count":4,"href":"http:\/\/blog.sway.com.cn\/index.php?rest_route=\/wp\/v2\/posts\/220\/revisions"}],"predecessor-version":[{"id":232,"href":"http:\/\/blog.sway.com.cn\/index.php?rest_route=\/wp\/v2\/posts\/220\/revisions\/232"}],"wp:attachment":[{"href":"http:\/\/blog.sway.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=220"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.sway.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=220"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.sway.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=220"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}