{"id":223,"date":"2010-06-22T15:57:43","date_gmt":"2010-06-22T12:57:43","guid":{"rendered":"http:\/\/skeletor.org.ua\/?p=223"},"modified":"2018-07-02T12:07:53","modified_gmt":"2018-07-02T09:07:53","slug":"ipfw-%d0%b8-%d1%84%d0%b8%d0%bb%d1%8c%d1%82%d1%80%d0%b0%d1%86%d0%b8%d1%8f-%d0%bf%d0%be-macy","status":"publish","type":"post","link":"https:\/\/skeletor.org.ua\/?p=223","title":{"rendered":"ipfw \u0438 \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u044f \u043f\u043e MAC&#8217;y"},"content":{"rendered":"<p>\u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0439 \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u044e \u043f\u043e\u00a0<strong>MAC&#8217;y<\/strong> \u043d\u0443\u0436\u043d\u044b 2 \u0443\u0441\u043b\u043e\u0432\u0438\u044f:<\/p>\n<p><strong><span style=\"color: #ff0000;\">1)ipfw \u0432\u0435\u0440\u0441\u0438\u0438 2<\/span><\/strong><\/p>\n<p>\u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441\u00a0<strong>FreeBSD 5.X<\/strong>\u00a0\u0438 \u0432\u044b\u0448\u0435, \u0442\u043e \u0443 \u0432\u0430\u0441 \u0443\u0436\u0435 \u0435\u0441\u0442\u044c\u00a0<strong>ipfw2<\/strong>, \u0435\u0441\u043b\u0438 \u0436\u0435 \u043d\u0435\u0442 &#8211; \u0442\u043e\u0433\u0434\u0430 \u043f\u0435\u0440\u0435\u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u044f\u0434\u0440\u043e \u0441 \u043e\u043f\u0446\u0438\u0435\u0439 &#8220;<strong>options\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 IPFW2<\/strong>&#8221;<\/p>\n<p><!--more--><\/p>\n<p><strong><span style=\"color: #ff0000;\">2)sysctl net.link.ether.ipfw=1<\/span><\/strong><\/p>\n<p><em><strong><span style=\"color: #ff6600;\">\u041f\u041e\u0421\u041b\u0415 \u041f\u0420\u0418\u041c\u0415\u041d\u0415\u041d\u0418\u042f \u042d\u0422\u041e\u0419 \u0421\u0422\u0420\u041e\u041a\u0418 \u041d\u0410 \u041a\u041e\u041c\u041f\u042c\u042e\u0422\u0415\u0420\u0410\u0425 \u041c\u041e\u0416\u0415\u0422 \u041f\u0420\u041e\u041f\u0410\u0414\u0410\u0422\u042c \u0418\u041d\u0422\u0415\u0420\u041d\u0415\u0422, \u0425\u041e\u0422\u042f \u041f\u0418\u041d\u0413\u0418, \u0422\u0420\u0410\u0421\u0421\u0418\u0420\u041e\u0412\u041a\u0418 \u0428\u041b\u0418. \u0422\u0410\u041a \u0427\u0422\u041e \u0418\u041c\u0415\u0419\u0422\u0415 \u0412\u0412\u0418\u0414\u0423.<\/span><\/strong><\/em><strong><em><br \/>\n<\/em><\/strong><\/p>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u0442\u0440\u043e\u043a\u0443\u00a0<strong>net.link.ether.ipfw=1<\/strong> \u0432\u00a0<strong>\/etc\/sysctl.conf<\/strong> \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0438\u0437 \u043a\u043e\u043d\u0441\u043e\u043b\u0438<\/p>\n<p><code>#sysctl net.link.ether.ipfw=1<\/code><\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0434\u043b\u044f \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u0438 \u0441\u00a0<strong>MAC<\/strong>. \u0421\u0430\u043c\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<p><code>ipfw add {allow|deny} {all|ip|tcp|udp} from {any|host} to {any|host} MAC 00:11:22:33:44:55 mac-type {ipv4|ipv6|vlan}<\/code><\/p>\n<p><span style=\"color: #ff0000;\"><em><strong>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435.<\/strong><\/em><\/span><\/p>\n<p>\u0412 <strong>11.2<\/strong> \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u043b\u0438 \u0431\u0430\u0433 \u0441 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u043e\u0439 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 <strong>L2<\/strong>. \u0414\u043e \u044d\u0442\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u043f\u0430\u043a\u0435\u0442\u044b \u043c\u043e\u0433\u043b\u0438 \u043d\u0435 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c\u0441\u044f.<\/p>\n<p><strong><span style=\"color: #ff6600;\">\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/span><\/strong><\/p>\n<p><code>#ipfw add deny all from any to any MAC src-mac 00:11:22:33:44:55 mac-type ipv4<br \/>\n<\/code><br \/>\n\u0422\u0430\u043a \u0436\u0435 \u043c\u043e\u0436\u043d\u043e, \u0432\u043c\u0435\u0441\u0442\u043e\u00a0<strong>ipv4<\/strong> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0448\u0435\u0441\u0442\u043d\u0430\u0434\u0446\u0430\u0442\u0438\u0440\u0438\u0447\u043d\u044b\u0439 \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442\u00a0<strong>0x0800<\/strong>.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u043d\u0435 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c\u00a0<strong>mac-type<\/strong>, \u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u0430\u043b\u0438\u0442\u0441\u044f \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435<\/p>\n<p><code>ipfw: Incorrect MAC address<\/code><\/p>\n<p>\u0442\u0430\u043a \u0447\u0442\u043e, \u0431\u0443\u0434\u044c\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u044b!<\/p>\n<p>\u0410 \u0435\u0449\u0451 \u0445\u043e\u0442\u0435\u043b \u0431\u044b \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u044d\u0442\u043e (\u043d\u0430\u0448\u0451\u043b \u043d\u0430 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 \u0444\u043e\u0440\u0443\u043c\u043e\u0432)<\/p>\n<p>1. \u0442\u0440\u0430\u043d\u0437\u0438\u0442\u043d\u044b\u0439 \u043f\u0430\u043a\u0435\u0442 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442 \u0447\u0435\u0440\u0435\u0437 \u0444\u0430\u0435\u0440\u0432\u043e\u043b 4(\u0447\u0435\u0442\u044b\u0440\u0435) \u0440\u0430\u0437\u0430<br \/>\n2.<\/p>\n<pre>allow ip from  to any<\/pre>\n<p>&#8211; \u043d\u0435 \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u0442 \u043f\u0430\u043a\u0435\u0442 \u0441 , \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u0442 \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440<\/p>\n<pre>allow ip from  to any mac any<\/pre>\n<p>\u0430 \u0442\u0430\u043a\u0436\u0435, \u0435\u0441\u043b\u0438 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d \u043f\u043e \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0443 \u0432\u0441\u0435 \u0437\u0430\u043f\u0440\u0435\u0449\u0435\u043d\u043e \u043a\u0440\u043e\u043c\u0435 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u043d\u043e\u0433\u043e \u0431\u043b\u043e\u043a\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0442\u0430\u043a\u0436\u0435 \u0448\u0438\u0440\u043e\u043a\u043e\u0432\u0435\u0449\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0442\u0440\u0430\u0444\u0438\u043a arp \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430,<br \/>\n\u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u0431\u044b\u0447\u043d\u043e \u0443\u043f\u0440\u043e\u0449\u0430\u044e\u0442 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0430 <strong>layer2<\/strong>, \u043e \u0447\u0435\u043c \u0435\u0441\u0442\u044c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0430\u044f \u0437\u0430\u043f\u0438\u0441\u044c \u0432 <strong>man<\/strong> <strong>ipfw<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0439 \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u044e \u043f\u043e\u00a0MAC&#8217;y \u043d\u0443\u0436\u043d\u044b 2 \u0443\u0441\u043b\u043e\u0432\u0438\u044f: 1)ipfw \u0432\u0435\u0440\u0441\u0438\u0438 2 \u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441\u00a0FreeBSD 5.X\u00a0\u0438 \u0432\u044b\u0448\u0435, \u0442\u043e \u0443 \u0432\u0430\u0441 \u0443\u0436\u0435 \u0435\u0441\u0442\u044c\u00a0ipfw2, \u0435\u0441\u043b\u0438 \u0436\u0435 \u043d\u0435\u0442 &#8211; \u0442\u043e\u0433\u0434\u0430 \u043f\u0435\u0440\u0435\u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u044f\u0434\u0440\u043e \u0441 \u043e\u043f\u0446\u0438\u0435\u0439 &#8220;options\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 IPFW2&#8221;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,10,13],"tags":[],"class_list":["post-223","post","type-post","status-publish","format-standard","hentry","category-freebsd","category-others","category-security"],"_links":{"self":[{"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/posts\/223","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=223"}],"version-history":[{"count":7,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/posts\/223\/revisions"}],"predecessor-version":[{"id":5493,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/posts\/223\/revisions\/5493"}],"wp:attachment":[{"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=223"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=223"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=223"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}