{"id":454,"date":"2020-11-07T14:55:24","date_gmt":"2020-11-07T06:55:24","guid":{"rendered":"https:\/\/blog.73007300.xyz\/?p=454"},"modified":"2020-11-07T14:55:24","modified_gmt":"2020-11-07T06:55:24","slug":"windows%e9%98%b2%e7%81%ab%e5%a2%99%e5%b0%8f%e7%bb%93","status":"publish","type":"post","link":"https:\/\/blog.73007300.xyz\/?p=454","title":{"rendered":"Windows\u9632\u706b\u5899\u5c0f\u7ed3"},"content":{"rendered":"<div>&nbsp;windows\u9632\u706b\u5899\u9ed8\u8ba4\u53ea\u8981\u4e0d\u52a0block\u7b56\u7565\uff0c\u6ca1\u5f00\u653e\u7684\u5c31\u662f\u5173\u95ed<\/div>\n<div>\n<div><img decoding=\"async\" src=\"https:\/\/blog.73007300.xyz\/wp-content\/uploads\/2020\/11\/1fa9f00499d067c3856b5a44631af8fb_71822882-7043-49ee-80c8-18389dfc2004.png\"><\/div>\n<div>\u53ef\u4ee5\u901a\u8fc7netsh\u914d\u7f6e\u5982\u4e0a\u7b56\u7565\uff1a<\/div>\n<\/div>\n<div data-mode=\"Shell\" data-theme=\"default\">\n<pre><code>netsh advfirewall set currentprofile  blockinbound,allowoutbound<\/code><\/pre>\n<\/div>\n<div>\u5176\u5b83\u4e00\u4e9b\u4f8b\u5b50<\/div>\n<div data-mode=\"Shell\" data-theme=\"default\">\n<pre><code># \u6062\u590d\u521d\u59cb\u9632\u706b\u5899\u8bbe\u7f6e\nnetsh advfirewall reset\n# \u5173\u95ed\u9632\u706b\u5899\nnetsh advfirewall set allprofiles state off\n# \u5f00\u542f\u9632\u706b\u5899\nnetsh advfirewall set allprofile state on \n# \u67e5\u770b\u72b6\u6001\nnetsh advfirewall show allprofiles\n# \u5173\u95ed\u5df2\u6709\u89c4\u5219\nNETSH ADVFIREWALL FIREWALL SET RULE all NEW enable=no\n\n# \u76f4\u63a5\u7981\u6b62\u6307\u5b9a\u7aef\u53e3 \u4f1a\u5bfc\u81f4\u5176\u5b83\u6ca1\u6307\u5b9a\u7684\u7aef\u53e3\u653e\u5f00\n# \u4fdd\u8bc1\u4e0d\u4f1a\u5173\u95ed\u4e1a\u52a1\u7aef\u53e3\nnetsh advfirewall set allprofile state on \nnetsh advfirewall firewall add rule dir=in action=block protocol=UDP localport=53 name=\"Block_UDP-53\"\nnetsh advfirewall firewall add rule dir=in action=block protocol=TCP localport=445 name=\"Block_TCP-445\"\nnetsh advfirewall firewall add rule dir=in action=block protocol=TCP localport=135 name=\"Block_TCP-135\"\nnetsh advfirewall firewall add rule dir=in action=block protocol=TCP localport=137 name=\"Block_TCP-137\"\nnetsh advfirewall firewall add rule dir=in action=block protocol=TCP localport=138 name=\"Block_TCP-138\"\nnetsh advfirewall firewall add rule dir=in action=block protocol=TCP localport=139 name=\"Block_TCP-139\"\nnetsh advfirewall firewall add rule dir=in action=block protocol=TCP localport=3389 name=\"Block_TCP-3389\"\n\n\n# 3389\u5bf9\u6307\u5b9aIP\u653e\u884c \nnetsh advfirewall firewall add rule name=\"Allow baoleiji access 3389\" dir=in protocol=TCP action=allow localport=3389  remoteip=\"10.153.127.110\"\nnetsh advfirewall firewall add rule name=\"Allow baoleiji access 3389\" dir=in protocol=TCP action=allow localport=3389  remoteip=\"192.168.111.129\"\n\n#  \u5220\u6389\u6307\u5b9a\u540d\u79f0\u7684\u89c4\u5219\nnetsh advfirewall firewall delete rule name=\"Block_UDP-53\"\nnetsh advfirewall firewall delete rule name=\"Block_TCP-135\"\nnetsh advfirewall firewall delete rule name=\"Block_TCP-137\"\nnetsh advfirewall firewall delete rule name=\"Block_TCP-138\"\nnetsh advfirewall firewall delete rule name=\"Block_TCP-139\"\nnetsh advfirewall firewall delete rule name=\"Block_TCP-445\"\nnetsh advfirewall firewall delete rule name=\"Block_TCP-1245\"\nnetsh advfirewall firewall delete rule name=\"Block_TCP-1433\"\nnetsh advfirewall firewall delete rule name=\"Block_TCP-3306\"\nnetsh advfirewall firewall delete rule name=\"Block_TCP-3389\"\n#\u7981\u7528 \u6307\u5b9a\u7aef\u53e3\u4e0a\u7684\u89c4\u5219\nNETSH ADVFIREWALL FIREWALL SET RULE  name=all dir=in localport=53  protocol=UDP NEW enable=no\nNETSH ADVFIREWALL FIREWALL SET RULE  name=all dir=in localport=135  protocol=TCP NEW enable=no\nNETSH ADVFIREWALL FIREWALL SET RULE  name=all dir=in localport=137  protocol=TCP NEW enable=no\nNETSH ADVFIREWALL FIREWALL SET RULE  name=all dir=in localport=138  protocol=TCP NEW enable=no\nNETSH ADVFIREWALL FIREWALL SET RULE  name=all dir=in localport=139  protocol=TCP NEW enable=no\nNETSH ADVFIREWALL FIREWALL SET RULE  name=all dir=in localport=445  protocol=TCP NEW enable=no\nNETSH ADVFIREWALL FIREWALL SET RULE  name=all dir=in localport=1245  protocol=TCP NEW enable=no\nNETSH ADVFIREWALL FIREWALL SET RULE  name=all dir=in localport=3389  protocol=TCP NEW enable=no\n\n# \u53ea\u5141\u8bb8\u5821\u5792\u673a\uff0810.153.127.110\uff09\u8bbf\u95ee3389\nnetsh advfirewall firewall add rule name=\"Allow baoleiji access 3389\" dir=in protocol=TCP action=allow localport=3389  remoteip=\"10.153.127.110\"\n\n# \u5220\u6389\u6307\u5b9a\u7aef\u53e3\uff0c\u6307\u5b9a\u534f\u8bae\u4e0a\u7684\u89c4\u5219 \u4e0d\u5efa\u8bae\u4f7f\u7528\nnetsh advfirewall firewall delete rule name=all dir=in localport=53  protocol=UDP\nnetsh advfirewall firewall delete rule name=all dir=in localport=135  protocol=TCP\nnetsh advfirewall firewall delete rule name=all dir=in localport=137  protocol=TCP\nnetsh advfirewall firewall delete rule name=all dir=in localport=138  protocol=TCP\nnetsh advfirewall firewall delete rule name=all dir=in localport=139  protocol=TCP\nnetsh advfirewall firewall delete rule name=all dir=in localport=445  protocol=TCP\nnetsh advfirewall firewall delete rule name=all dir=in localport=1245  protocol=TCP\n\n\n# \u5f00\u542f\u9632\u706b\u5899\u963b\u6b62445\u5e76\u5f00\u653e\u5176\u4ed6\u6240\u6709\u7aef\u53e3\nnetsh advfirewall set allprofile state on \nnetsh advfirewall firewall add rule dir=in action=block protocol=TCP localport=445 name=\"Block_TCP-445\"\nnetsh advfirewall firewall add rule name=\"ALL port\" protocol=TCP dir=in localport=1-444 action=allow\nnetsh advfirewall firewall add rule name=\"ALL port\" protocol=TCP dir=in localport=446-65535 action=allow\n\n# \u91cd\u7f6e\u5168\u90e8\u89c4\u5219\uff0c\u53ea\u5141\u8bb8\u5821\u5792\u673a\u8bbf\u95ee3389\nnetsh advfirewall reset \nnetsh advfirewall set allprofile state on \nNETSH ADVFIREWALL FIREWALL SET RULE all NEW enable=no\nnetsh advfirewall firewall add rule name=\"Allow baoleiji access 3389\" dir=in protocol=TCP action=allow localport=3389  remoteip=\"10.153.127.110\"\n\n#\u67e5\u770b\u6240\u6709\u652f\u6301IPv6\u7684\u7f51\u5361\nGet-NetAdapterBinding -ComponentID ms_tcpip6\n#\u7981\u7528\u6240\u6709\u7f51\u5361\u7684IPv6\u534f\u8bae\nDisable-NetAdapterBinding -Name \"*\" -ComponentID ms_tcpip6\n# \u5982\u679c\u540e\u9762\u9700\u8981\u542f\u7528\uff0c\u6267\u884c\uff1a Enable-NetAdapterBinding -Name \"*\" -ComponentID ms_tcpip6\n\n# \u5b98\u65b9\u6587\u6863 https:\/\/docs.microsoft.com\/en-us\/previous-versions\/windows\/it-pro\/windows-server-2008-R2-and-2008\/dd734783(v=ws.10)?redirectedfrom=MSDN\n# \u7981\u7528\u89c4\u5219 https:\/\/www.tenforums.com\/tutorials\/90033-enable-disable-ipv6-windows.html<\/code><\/pre>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp;windows\u9632\u706b\u5899\u9ed8\u8ba4\u53ea\u8981\u4e0d\u52a0block\u7b56\u7565\uff0c\u6ca1\u5f00\u653e\u7684\u5c31\u662f\u5173\u95ed \u53ef\u4ee5\u901a\u8fc7netsh\u914d\u7f6e\u5982\u4e0a\u7b56\u7565\uff1a netsh advfirewall set currentprofile blockinbound,allowoutbound \u5176\u5b83\u4e00\u4e9b\u4f8b\u5b50 # \u6062\u590d\u521d\u59cb\u9632\u706b\u5899\u8bbe\u7f6e netsh advfirewall reset # \u5173\u95ed\u9632\u706b\u5899 netsh advfirewall set allprofiles state off # \u5f00\u542f\u9632\u706b\u5899 netsh advfirewall set allprofile state on # \u67e5\u770b\u72b6\u6001 netsh advfirewall show allprofiles # \u5173\u95ed\u5df2\u6709\u89c4\u5219 NETSH ADVFIREWALL FIREWALL SET RULE all NEW enable=no # \u76f4\u63a5\u7981\u6b62\u6307\u5b9a\u7aef\u53e3 \u4f1a\u5bfc\u81f4\u5176\u5b83\u6ca1\u6307\u5b9a\u7684\u7aef\u53e3\u653e\u5f00 # \u4fdd\u8bc1\u4e0d\u4f1a\u5173\u95ed\u4e1a\u52a1\u7aef\u53e3 netsh advfirewall set allprofile state [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.73007300.xyz\/index.php?rest_route=\/wp\/v2\/posts\/454"}],"collection":[{"href":"https:\/\/blog.73007300.xyz\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.73007300.xyz\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.73007300.xyz\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.73007300.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=454"}],"version-history":[{"count":1,"href":"https:\/\/blog.73007300.xyz\/index.php?rest_route=\/wp\/v2\/posts\/454\/revisions"}],"predecessor-version":[{"id":455,"href":"https:\/\/blog.73007300.xyz\/index.php?rest_route=\/wp\/v2\/posts\/454\/revisions\/455"}],"wp:attachment":[{"href":"https:\/\/blog.73007300.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=454"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.73007300.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=454"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.73007300.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=454"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}