{"id":1691,"date":"2021-06-07T00:02:21","date_gmt":"2021-06-06T16:02:21","guid":{"rendered":"https:\/\/www.wjxy.net.cn\/?p=1691"},"modified":"2023-10-04T06:32:34","modified_gmt":"2023-10-03T22:32:34","slug":"centos-7-%e5%ae%89%e8%a3%85%e5%8f%8a%e9%85%8d%e7%bd%ae-iptables-%e6%88%90%e4%b8%ba-zerotier%e7%bd%91%e5%85%b3","status":"publish","type":"post","link":"https:\/\/www.wjxy.net.cn\/?p=1691","title":{"rendered":"centos 7 \u5b89\u88c5\u53ca\u914d\u7f6e iptables \u6210\u4e3a zerotier\u7f51\u5173"},"content":{"rendered":"<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>\u4fee\u6539\/etc\/sysctl.conf\u6587\u4ef6<\/p>\n<p>net.ipv4.ip_forward = 1<\/p>\n<p>sysctl -p \u00a0\u68c0\u67e5\u7ed3\u679c<\/p>\n<p>systemctl disables firewalld<\/p>\n<p>yum remove firewalld<\/p>\n<p><code>yum install iptables-services<\/code><\/p>\n<p>1.<\/p>\n<p>iptables -A FORWARD -d 192.168.0.0\/24 -j ACCEPT\u00a0 \u6216\u8005 iptables -A FORWARD -o zt7nnojemu -j ACCEPT\u00a0 \u00a0\/ &#8220;zt7nnojemu&#8221; \u4e3aZEROTIER\u865a\u62df\u7f51\u5361<\/p>\n<p><code>iptables -A FORWARD -j ACCEPT<\/code> \uff08\u4e0d\u5e26\u53c2\u6570\u4e3a\u8f6c\u53d1\u6240\u6709\u7aef\u53e3\uff09<\/p>\n<p>2.<\/p>\n<p><code>iptables -t nat -A POSTROUTING -j MASQUERADE<\/code><\/p>\n<hr \/>\n<p>\u8ba1\u7b97\u673a\u8bbe\u7f6e\u8def\u7531\u8868<\/p>\n<p>route add 172.30.0.0 mask 255.255.0.0 192.168.0.229<\/p>\n<p>Zerotire-cli \u663e\u793a<\/p>\n<p>Please check that the service is running and that TCP port 9993 can be contacted via 127.0.0.1<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; &nbsp; &nbsp; \u4fee\u6539\/etc\/sysctl.conf\u6587\u4ef6 net.ipv4.ip_f [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[29],"tags":[],"_links":{"self":[{"href":"https:\/\/www.wjxy.net.cn\/index.php?rest_route=\/wp\/v2\/posts\/1691"}],"collection":[{"href":"https:\/\/www.wjxy.net.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wjxy.net.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wjxy.net.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wjxy.net.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1691"}],"version-history":[{"count":6,"href":"https:\/\/www.wjxy.net.cn\/index.php?rest_route=\/wp\/v2\/posts\/1691\/revisions"}],"predecessor-version":[{"id":1693,"href":"https:\/\/www.wjxy.net.cn\/index.php?rest_route=\/wp\/v2\/posts\/1691\/revisions\/1693"}],"wp:attachment":[{"href":"https:\/\/www.wjxy.net.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1691"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wjxy.net.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1691"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wjxy.net.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1691"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}