{"id":1704,"date":"2014-08-15T02:06:13","date_gmt":"2014-08-14T20:06:13","guid":{"rendered":"http:\/\/notes.norfolks.org\/?p=1704"},"modified":"2020-03-10T02:33:35","modified_gmt":"2020-03-09T20:33:35","slug":"iptables-%d0%bf%d0%be%d0%bb%d0%b5%d0%b7%d0%bd%d0%be%d0%b5","status":"publish","type":"post","link":"https:\/\/notes.norfolks.fun\/?p=1704","title":{"rendered":"Iptables. \u041f\u043e\u043b\u0435\u0437\u043d\u043e\u0435"},"content":{"rendered":"<p># iptables -L -n -v<\/p>\n<pre lang=\"bash\">\niptables [-t \u0422\u0410\u0411\u041b\u0418\u0426\u0410] -A \u0426\u0415\u041f\u041e\u0427\u041a\u0410 \u041f\u0410\u0420\u0410\u041c\u0415\u0422\u0420\u042b -j \u0414\u0415\u0419\u0421\u0422\u0412\u0418\u0415<\/pre>\n<p>\u041a\u043b\u044e\u0447\u0438 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0446\u0435\u043f\u043e\u0447\u043a\u0430\u043c\u0438:<br \/>\n<code>-A - \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u043e\u0432\u043e\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u043e.<br \/>\n-D - \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u043e.<br \/>\n-F - \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0432\u0441\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u0430.<br \/>\n-R - \u0437\u0430\u043c\u0435\u043d\u0430 \u043f\u0440\u0430\u0432\u0438\u043b\u0430.<br \/>\n-L - \u0432\u044b\u0432\u043e\u0434 \u0441\u043f\u0438\u0441\u043a\u0430 \u0432\u0441\u0435\u0445 \u043f\u0440\u0430\u0432\u0438\u043b.<br \/>\n-N - \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043d\u043e\u0432\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a<br \/>\n-I - \u0432\u0441\u0442\u0430\u0432\u043a\u0430 \u043f\u0440\u0430\u0432\u0438\u043b \u0432 \u043d\u0430\u0447\u0430\u043b\u043e \u0446\u0435\u043f\u043e\u0447\u043a\u0438<br \/>\n<\/code><\/p>\n<p>\u0412 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 <strong>filter<\/strong> (\u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e) \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0446\u0435\u043f\u043e\u0447\u043a\u0438:<br \/>\n<code><strong>INPUT<\/strong> - \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0439 \u0442\u0440\u0430\u0444\u0438\u043a.<br \/>\n<strong>OUTPUT<\/strong> - \u0438\u0441\u0445\u043e\u0434\u044f\u0449\u0438\u0439 \u0442\u0440\u0430\u0444\u0438\u043a.<br \/>\n<strong>FORWARD<\/strong> - \u043f\u0435\u0440\u0435\u0441\u044b\u043b\u0430\u0435\u043c\u044b\u0439(\u0442\u0440\u0430\u043d\u0437\u0438\u0442\u043d\u044b\u0439) \u0442\u0440\u0430\u0444\u0438\u043a.<\/code><br \/>\n_________________________________________________<br \/>\n\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b:<br \/>\n<code><strong>-p<\/strong> - \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b, \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c all,icmp,tcp,udp.<br \/>\n<strong>-s<\/strong> - ip \u0430\u0434\u0440\u0435\u0441\/\u0445\u043e\u0441\u0442 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430.<br \/>\n<strong>-d<\/strong> - ip \u0430\u0434\u0440\u0435\u0441\/\u0445\u043e\u0441\u0442 \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f.<br \/>\n<strong>-i<\/strong> - \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0438\u0448\u0435\u043b \u043f\u0430\u043a\u0435\u0442.<br \/>\n<strong>-o<\/strong> - \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0441 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0443\u0439\u0434\u0435\u0442 \u043f\u0430\u043a\u0435\u0442 .<\/code><br \/>\n_________________________________________________<br \/>\n<code>--<strong>sport<\/strong> - \u043f\u043e\u0440\u0442 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430.<br \/>\n--<strong>dport<\/strong> - \u043f\u043e\u0440\u0442 \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f.<\/code><br \/>\n_________________________________________________<br \/>\n\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u044f:<br \/>\n<code><strong>ACCEPT<\/strong> - \u0440\u0430\u0437\u0440\u0435\u0448\u0438\u0442\u044c \u043f\u0430\u043a\u0435\u0442\u044b.<br \/>\n<strong>REJECT<\/strong> - \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0430\u043a\u0435\u0442\u044b \u0441 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435\u043c \u043e\u0431 \u043e\u0442\u043a\u0430\u0437\u0435.<br \/>\n<strong>DROP<\/strong> - \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0430\u043a\u0435\u0442\u044b(\u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442, \u043d\u0435\u0436\u0435\u043b\u0438 REJECT, \u0442.\u043a \u0434\u043b\u044f \u0431\u043b\u043e\u043a\u0438\u0440\u0443\u0435\u043c\u043e\u0433\u043e ip \u0430\u0434\u0440\u0435\u0441\u0430(\u0438\u043b\u0438 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u043e\u0432) \u0431\u0443\u0434\u0435\u0442 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0439 \u044d\u0444\u0444\u0435\u043a\u0442 \u0442\u043e\u043c\u0443, \u043a\u043e\u0433\u0434\u0430 \u0441\u0435\u0440\u0432\u0435\u0440 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0434\u0430\u0443\u043d\u0435).<\/code><\/p>\n<p>\u041f\u0440\u043e\u0441\u043c\u043e\u0442\u0440 \u0441\u043f\u0438\u0441\u043a\u0430 \u0441 \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u043c\u0438<\/p>\n<pre lang=\"sh\">iptables -L INPUT --line-numbers<\/pre>\n<p>\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u043c\u0435\u0436\u0434\u0443 1 \u0438 2 \u0441\u0442\u0440\u043e\u043a\u043e\u0439:<\/p>\n<pre lang=\"sh\">iptables -I INPUT 2 -s 202.54.1.2 -j DROP<\/pre>\n<p>-==Links==-<br \/>\n<a href=\"http:\/\/wolf-et.ru\/linux\/iptables-for-dummies\/\">http:\/\/wolf-et.ru\/linux\/iptables-for-dummies\/<\/a><br \/>\n<a href=\"http:\/\/vasilisc.com\/21-examples-iptables\">http:\/\/vasilisc.com\/21-examples-iptables<\/a><br \/>\n<a href=\"http:\/\/debuntu.ru\/note\/nastroyka-iptables\">http:\/\/debuntu.ru\/note\/nastroyka-iptables<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p># iptables -L -n -v iptables [-t \u0422\u0410\u0411\u041b\u0418\u0426\u0410] -A \u0426\u0415\u041f\u041e\u0427\u041a\u0410 \u041f\u0410\u0420\u0410\u041c\u0415\u0422\u0420\u042b -j \u0414\u0415\u0419\u0421\u0422\u0412\u0418\u0415 \u041a\u043b\u044e\u0447\u0438 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0446\u0435\u043f\u043e\u0447\u043a\u0430\u043c\u0438: -A &#8212; \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u043e\u0432\u043e\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u043e. -D &#8212; \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u043e. -F &#8212; \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0432\u0441\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u0430. -R &#8212; \u0437\u0430\u043c\u0435\u043d\u0430 \u043f\u0440\u0430\u0432\u0438\u043b\u0430. -L &#8212; \u0432\u044b\u0432\u043e\u0434 \u0441\u043f\u0438\u0441\u043a\u0430 &hellip; <a href=\"https:\/\/notes.norfolks.fun\/?p=1704\">\u0427\u0438\u0442\u0430\u0442\u044c \u0434\u0430\u043b\u0435\u0435 <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[41,14,8],"tags":[],"class_list":["post-1704","post","type-post","status-publish","format-standard","hentry","category-iptables","category-linux","category-8"],"_links":{"self":[{"href":"https:\/\/notes.norfolks.fun\/index.php?rest_route=\/wp\/v2\/posts\/1704","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/notes.norfolks.fun\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/notes.norfolks.fun\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/notes.norfolks.fun\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/notes.norfolks.fun\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1704"}],"version-history":[{"count":15,"href":"https:\/\/notes.norfolks.fun\/index.php?rest_route=\/wp\/v2\/posts\/1704\/revisions"}],"predecessor-version":[{"id":3027,"href":"https:\/\/notes.norfolks.fun\/index.php?rest_route=\/wp\/v2\/posts\/1704\/revisions\/3027"}],"wp:attachment":[{"href":"https:\/\/notes.norfolks.fun\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1704"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/notes.norfolks.fun\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1704"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/notes.norfolks.fun\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1704"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}