{"id":6056,"date":"2022-12-22T09:05:40","date_gmt":"2022-12-22T07:05:40","guid":{"rendered":"https:\/\/skeletor.org.ua\/?p=6056"},"modified":"2022-12-22T09:06:00","modified_gmt":"2022-12-22T07:06:00","slug":"freebsd-%d0%b4%d0%b5%d1%8f%d0%ba%d1%96-%d0%bd%d1%8e%d0%b0%d0%bd%d1%81%d0%b8-%d0%bf%d1%80%d0%be-net-inet-ip-forwarding","status":"publish","type":"post","link":"https:\/\/skeletor.org.ua\/?p=6056","title":{"rendered":"[FreeBSD] \u0414\u0435\u044f\u043a\u0456 \u043d\u044e\u0430\u043d\u0441\u0438 \u043f\u0440\u043e net.inet.ip.forwarding"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">\u041f\u0440\u043e\u0447\u0438\u0442\u0430\u0432 \u0443 \u0440\u043e\u0437\u0441\u0438\u043b\u0446\u0456 \u043f\u043e <strong>FreeBSD<\/strong>, \u0449\u043e \u0432\u0438\u044f\u0432\u043b\u044f\u0454\u0442\u044c\u0441\u044f, \u0454 \u0432\u0456\u0434\u043c\u0456\u043d\u043d\u0456\u0441\u0442\u044c, \u044f\u043a \u0441\u0430\u043c\u0435 \u0432\u043c\u0438\u043a\u0430\u0442\u0438 <strong>forward&#8217;\u0456\u043d\u0433<\/strong> \u0456 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0446\u0435 \u0440\u043e\u0431\u0438\u0442\u0438 (\u0441\u0430\u043c\u0435 \u0443 <strong>FreeBSD<\/strong>) \u0447\u0435\u0440\u0435\u0437<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>gateway_enable=\"YES\"<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0443 <strong>\/etc\/rc.conf<\/strong>. \u0427\u043e\u043c\u0443? \u041f\u043e\u044f\u0441\u043d\u0435\u043d\u043d\u044f \u0437\u0430\u043b\u0438\u0448\u0443 \u0446\u0438\u0442\u0430\u0442\u043e\u044e, \u0431\u0435\u0437 \u043f\u0435\u0440\u0435\u043a\u043b\u0430\u0434\u0443:<\/p>\n\n\n<p><!--more--><\/p>\n<blockquote>\n<p><span style=\"color: #993366;\">Never set net.inet.ip.forwarding=1 manually or via \/etc\/sysctl.conf.<\/span><\/p>\n<p><span style=\"color: #993366;\">Always use gateway_enable=&#8221;YES&#8221; in \/etc\/rc.conf, or else system scripts started with devd<\/span><br><span style=\"color: #993366;\">on any interface creation (tunX, ngX, etc.) will switch forwarding to 0 again.<\/span><\/p>\n<p><span style=\"color: #993366;\">Some scripts (f.e. from \/etc\/devd.conf) invoke \/etc\/pccard_ether $subsystem start<\/span><br><span style=\"color: #993366;\">(the name &#8220;pccard_ether&#8221; is just historic, it serves any cloned network interface).<\/span><\/p>\n<p><span style=\"color: #993366;\">It runs &#8220;\/etc\/rc.d\/netif quietstart&#8221; $ifn that runs &#8220;\/etc\/rc.d\/routing static any $_if&#8221;<\/span><br><span style=\"color: #993366;\">that may reset net.inet.ip.forwarding=0 unless you have gateway_enable=&#8221;YES&#8221; in \/etc\/rc.conf<\/span><br><span style=\"color: #993366;\">despite you could have set net.inet.ip.forwarding=1 via sysctl.conf.<\/span><\/p>\n<\/blockquote>","protected":false},"excerpt":{"rendered":"<p>\u041f\u0440\u043e\u0447\u0438\u0442\u0430\u0432 \u0443 \u0440\u043e\u0437\u0441\u0438\u043b\u0446\u0456 \u043f\u043e FreeBSD, \u0449\u043e \u0432\u0438\u044f\u0432\u043b\u044f\u0454\u0442\u044c\u0441\u044f, \u0454 \u0432\u0456\u0434\u043c\u0456\u043d\u043d\u0456\u0441\u0442\u044c, \u044f\u043a \u0441\u0430\u043c\u0435 \u0432\u043c\u0438\u043a\u0430\u0442\u0438 forward&#8217;\u0456\u043d\u0433 \u0456 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0446\u0435 \u0440\u043e\u0431\u0438\u0442\u0438 (\u0441\u0430\u043c\u0435 \u0443 FreeBSD) \u0447\u0435\u0440\u0435\u0437 gateway_enable=&#8221;YES&#8221; \u0443 \/etc\/rc.conf. \u0427\u043e\u043c\u0443? \u041f\u043e\u044f\u0441\u043d\u0435\u043d\u043d\u044f \u0437\u0430\u043b\u0438\u0448\u0443 \u0446\u0438\u0442\u0430\u0442\u043e\u044e, \u0431\u0435\u0437 \u043f\u0435\u0440\u0435\u043a\u043b\u0430\u0434\u0443:<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-6056","post","type-post","status-publish","format-standard","hentry","category-freebsd"],"_links":{"self":[{"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/posts\/6056","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=6056"}],"version-history":[{"count":2,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/posts\/6056\/revisions"}],"predecessor-version":[{"id":6058,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/posts\/6056\/revisions\/6058"}],"wp:attachment":[{"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6056"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6056"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6056"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}