{"id":189,"date":"2023-02-16T11:50:18","date_gmt":"2023-02-16T11:50:18","guid":{"rendered":"https:\/\/faq.powervps.ru\/?p=189"},"modified":"2024-03-20T06:48:15","modified_gmt":"2024-03-20T06:48:15","slug":"%d0%be%d0%b3%d1%80%d0%b0%d0%bd%d0%b8%d1%87%d0%b5%d0%bd%d0%b8%d0%b5-%d0%b7%d0%b0%d0%bf%d1%80%d0%be%d1%81%d0%be%d0%b2-%d0%ba-%d0%bb%d0%be%d0%ba%d0%b0%d0%bb%d1%8c%d0%bd%d0%be%d0%bc%d1%83-%d0%b4%d0%b8","status":"publish","type":"post","link":"https:\/\/faq.powervps.ru\/?p=189","title":{"rendered":"\u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043a \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u043c\u0443 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0443 ip"},"content":{"rendered":"<p>\u0414\u043b\u044f Linux<br \/>\n\u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0432 iptables. \u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0438\u0445 \u0432 \u0430\u0432\u0442\u043e\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443. \u0414\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043f\u043e\u0441\u043b\u0435 \u0440\u0435\u0441\u0442\u0430\u0440\u0442\u0430 \u041e\u0421.<\/p>\n<p>iptables -A OUTPUT -d 172.16.0.0\/12 -j DROP<br \/>\niptables -A OUTPUT -d 10.0.0.0\/8 -j DROP<br \/>\niptables -A OUTPUT -d 192.168.0.0\/16 -j DROP<br \/>\niptables -A OUTPUT -d 100.64.0.0\/10 -j DROP<br \/>\niptables -A OUTPUT -d 169.254.0.0\/16 -j DROP<\/p>\n<p>iptables -A FORWARD -d 172.16.0.0\/12 -j DROP<br \/>\niptables -A FORWARD -d 10.0.0.0\/8 -j DROP<br \/>\niptables -A FORWARD -d 192.168.0.0\/16 -j DROP<br \/>\niptables -A FORWARD -d 100.64.0.0\/10 -j DROP<br \/>\niptables -A FORWARD -d 169.254.0.0\/16 -j DROP<\/p>\n<p>\u0410\u0432\u0442\u043e\u0441\u0442\u0430\u0440\u0442 \u0434\u043b\u044f Ubuntu:<br \/>\napt-get install iptables-persistent<\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"http:\/\/faq.powervps.ru\/wp-content\/uploads\/2023\/02\/doc_2023-02-16_14-49-31.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-190\" src=\"http:\/\/faq.powervps.ru\/wp-content\/uploads\/2023\/02\/doc_2023-02-16_14-49-31.png\" alt=\"\" width=\"810\" height=\"483\" srcset=\"https:\/\/faq.powervps.ru\/wp-content\/uploads\/2023\/02\/doc_2023-02-16_14-49-31.png 810w, https:\/\/faq.powervps.ru\/wp-content\/uploads\/2023\/02\/doc_2023-02-16_14-49-31-300x179.png 300w, https:\/\/faq.powervps.ru\/wp-content\/uploads\/2023\/02\/doc_2023-02-16_14-49-31-768x458.png 768w\" sizes=\"auto, (max-width: 810px) 100vw, 810px\" \/><\/a>\u0412 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043d\u0430 \u0432\u0441\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0432\u044b\u0431\u0440\u0430\u0442\u044c Yes<\/p>\n<p>&nbsp;<\/p>\n<p>\u0414\u043b\u044f Windows<\/p>\n<p>\u041a\u0430\u043a \u0438 \u0432 Linux, \u0432 Windows \u043c\u043e\u0436\u043d\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u043c IP-\u0430\u0434\u0440\u0435\u0441\u0430\u043c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0440\u0430\u0432\u0438\u043b \u0431\u0440\u0430\u043d\u0434\u043c\u0430\u0443\u044d\u0440\u0430. \u0412\u043e\u0442 \u043a\u0430\u043a \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u0430:<\/p>\n<ol>\n<li>\u041e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u043e\u043a\u043d\u043e &#8220;\u0411\u0440\u0430\u043d\u0434\u043c\u0430\u0443\u044d\u0440 Windows \u0441 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u043d\u044b\u043c\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438 \u0437\u0430\u0449\u0438\u0442\u044b&#8221;.<\/li>\n<li>\u041d\u0430\u0436\u043c\u0438\u0442\u0435 \u043d\u0430 &#8220;\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u0430&#8230;&#8221; \u0432 \u043f\u0440\u0430\u0432\u043e\u0439 \u043f\u0430\u043d\u0435\u043b\u0438.<\/li>\n<li>\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u0442\u0438\u043f \u043f\u0440\u0430\u0432\u0438\u043b\u0430 &#8220;\u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430&#8221; \u0438 \u043d\u0430\u0436\u043c\u0438\u0442\u0435 &#8220;\u0414\u0430\u043b\u0435\u0435&#8221;.<\/li>\n<li>\u0423\u043a\u0430\u0436\u0438\u0442\u0435 \u043f\u0443\u0442\u044c \u043a \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u043c\u0443 \u0444\u0430\u0439\u043b\u0443 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b, \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u043f\u0440\u0435\u0442\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u043c IP-\u0430\u0434\u0440\u0435\u0441\u0430\u043c, \u0438\u043b\u0438 \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 &#8220;\u0412\u0441\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b&#8221; \u0434\u043b\u044f \u0437\u0430\u043f\u0440\u0435\u0442\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u0441\u043e \u0432\u0441\u0435\u0433\u043e \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430.<\/li>\n<li>\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u0442\u0438\u043f \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f, \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, &#8220;\u0418\u0441\u0445\u043e\u0434\u044f\u0449\u0435\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435&#8221;.<\/li>\n<li>\u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u043e\u043a\u043d\u0435 \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 &#8220;\u041b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0435 IP-\u0430\u0434\u0440\u0435\u0441\u0430&#8221; \u0438 \u043d\u0430\u0436\u043c\u0438\u0442\u0435 &#8220;\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c&#8230;&#8221;.<\/li>\n<li>\u0412\u0432\u0435\u0434\u0438\u0442\u0435 IP-\u0430\u0434\u0440\u0435\u0441\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, &#8220;172.16.0.0\/12&#8221;, &#8220;10.0.0.0\/8&#8221;, &#8220;192.168.0.0\/16&#8221;, &#8220;100.64.0.0\/10&#8221; \u0438 &#8220;169.254.0.0\/16&#8221;.<\/li>\n<li>\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u043a \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f\u043c \u0441 \u0437\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 IP-\u0430\u0434\u0440\u0435\u0441\u0430\u043c\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, &#8220;\u0417\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435&#8221;.<\/li>\n<li>\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0438\u043c\u044f \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0438 \u043d\u0430\u0436\u043c\u0438\u0442\u0435 &#8220;\u0413\u043e\u0442\u043e\u0432\u043e&#8221;.<\/li>\n<\/ol>\n<p>\u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0431\u0440\u0430\u043d\u0434\u043c\u0430\u0443\u044d\u0440 Windows \u0431\u0443\u0434\u0435\u0442 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0441\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u043a \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u043c \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u043c IP-\u0430\u0434\u0440\u0435\u0441\u0430\u043c. \u0415\u0441\u043b\u0438 \u043d\u0443\u0436\u043d\u043e \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0441 \u044d\u0442\u0438\u0445 \u0430\u0434\u0440\u0435\u0441\u043e\u0432, \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u0442\u0438\u043f \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f &#8220;\u0412\u0445\u043e\u0434\u044f\u0449\u0435\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435&#8221; \u0432 \u0448\u0430\u0433\u0435 5.<\/p>\n<p><strong>PowerShell Script<\/strong><\/p>\n<div class=\"code-box\">\n<pre># Set the list of IP addresses to block\r\n$blockedIPs = @(\"172.16.0.0\/12\", \"10.0.0.0\/8\", \"192.168.0.0\/16\", \"100.64.0.0\/10\", \"169.254.0.0\/16\")\r\n\r\n# Set the connection type (Outbound or Inbound)\r\n$connectionType = \"Outbound\" # or \"Inbound\" for inbound connections\r\n\r\n# Set the action (Block the connection)\r\n$action = \"Block\"\r\n\r\n# Create a new firewall rule\r\nNew-NetFirewallRule -DisplayName \"Block Local IP Addresses\" -Direction $connectionType -RemoteAddress $blockedIPs -Action $action -Profile Any -Enabled True\r\n<\/pre>\n<\/div>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0414\u043b\u044f Linux \u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0432 iptables. \u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0438\u0445 \u0432 \u0430\u0432\u0442\u043e\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443. \u0414\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043f\u043e\u0441\u043b\u0435 \u0440\u0435\u0441\u0442\u0430\u0440\u0442\u0430 \u041e\u0421. iptables -A OUTPUT -d 172.16.0.0\/12 -j DROP iptables -A OUTPUT -d 10.0.0.0\/8 -j DROP iptables -A OUTPUT -d 192.168.0.0\/16 -j DROP iptables -A OUTPUT -d 100.64.0.0\/10 -j DROP iptables -A OUTPUT -d 169.254.0.0\/16 -j DROP iptables -A [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-189","post","type-post","status-publish","format-standard","hentry","category-1"],"_links":{"self":[{"href":"https:\/\/faq.powervps.ru\/index.php?rest_route=\/wp\/v2\/posts\/189","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/faq.powervps.ru\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/faq.powervps.ru\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/faq.powervps.ru\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/faq.powervps.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=189"}],"version-history":[{"count":8,"href":"https:\/\/faq.powervps.ru\/index.php?rest_route=\/wp\/v2\/posts\/189\/revisions"}],"predecessor-version":[{"id":348,"href":"https:\/\/faq.powervps.ru\/index.php?rest_route=\/wp\/v2\/posts\/189\/revisions\/348"}],"wp:attachment":[{"href":"https:\/\/faq.powervps.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=189"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/faq.powervps.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=189"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/faq.powervps.ru\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=189"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}