{"id":178,"date":"2022-05-25T11:22:46","date_gmt":"2022-05-25T11:22:46","guid":{"rendered":"https:\/\/blog.corvin.su\/?p=178"},"modified":"2022-05-25T11:22:46","modified_gmt":"2022-05-25T11:22:46","slug":"%d0%ba%d0%be%d0%bc%d0%b0%d0%bd%d0%b4%d1%8b-%d1%83%d0%bf%d1%80%d0%b0%d0%b2%d0%bb%d0%b5%d0%bd%d0%b8%d1%8f-%d1%84%d0%b0%d0%b5%d1%80%d0%b2%d0%be%d0%bb%d0%be%d0%bc-pf","status":"publish","type":"post","link":"https:\/\/blog.corvin.su\/?p=178","title":{"rendered":"\u041a\u043e\u043c\u0430\u043d\u0434\u044b \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0444\u0430\u0435\u0440\u0432\u043e\u043b\u043e\u043c pf"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0421\u043f\u0438\u0441\u043e\u043a \u043a\u043e\u043c\u0430\u043d\u0434 \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u0444\u0430\u0435\u0440\u0432\u043e\u043b\u043e\u043c <a rel=\"noreferrer noopener\" href=\"https:\/\/ru.wikipedia.org\/wiki\/Packet_Filter\" target=\"_blank\">pf<\/a>.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>pfctl -d<\/td><td>\u0432\u044b\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043f\u0430\u043a\u0435\u0442\u043d\u044b\u0439 \u0444\u0438\u043b\u044c\u0442\u0440<\/td><\/tr><tr><td>pfctl -e<\/td><td>\u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043f\u0430\u043a\u0435\u0442\u043d\u044b\u0439 \u0444\u0438\u043b\u044c\u0442\u0440<\/td><\/tr><tr><td>&nbsp;<\/td><\/tr><tr><td>pfctl -f \/etc\/pf.conf<\/td><td>\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0433 \u0438\u0437 <code>\/etc\/pf.conf<\/code><\/td><\/tr><tr><td>pfctl -n -f \/etc\/pf.conf<\/td><td>\u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043d\u0430 \u043e\u0448\u0438\u0431\u043a\u0438 <code>\/etc\/pf.conf<\/code>, \u043d\u043e \u043d\u0435 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u0435\u0433\u043e<\/td><\/tr><tr><td>pfctl -R -f \/etc\/pf.conf<\/td><td>\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0444\u0438\u0442\u0440\u0430\u0446\u0438\u0438 \u0438\u0437 <code>\/etc\/pf.conf<\/code><\/td><\/tr><tr><td>pfctl -N -f \/etc\/pf.conf<\/td><td>\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u0430 NAT \u0438\u0437 <code>\/etc\/pf.conf<\/code><\/td><\/tr><tr><td>pfctl -O -f \/etc\/pf.conf<\/td><td>\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u043f\u0446\u0438\u0438 \u0438\u0437 <code>\/etc\/pf.conf<\/code><\/td><\/tr><tr><td>&nbsp;<\/td><\/tr><tr><td>pfctl -F all<\/td><td>\u0441\u0431\u0440\u043e\u0441\u0438\u0442\u044c \u0432\u0441\u0451<\/td><\/tr><tr><td>pfctl -F rules<\/td><td>\u0441\u0431\u0440\u043e\u0441\u0438\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u0438<\/td><\/tr><tr><td>pfctl -F queue<\/td><td>\u0441\u0431\u0440\u043e\u0441\u0438\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0447\u0435\u0440\u0435\u0434\u0438<\/td><\/tr><tr><td>pfctl -F nat<\/td><td>\u0441\u0431\u0440\u043e\u0441\u0438\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u0430 NAT<\/td><\/tr><tr><td>pfctl -F info<\/td><td>\u0441\u0431\u0440\u043e\u0441\u0438\u0442\u044c \u0432\u0441\u044e \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443<\/td><\/tr><tr><td>pfctl -z clear<\/td><td>\u043e\u0447\u0438\u0441\u0442\u0438\u0442\u044c \u0432\u0441\u0435 \u0441\u0447\u0451\u0442\u0447\u0438\u043a\u0438<\/td><\/tr><tr><td>&nbsp;<\/td><\/tr><tr><td>pfctl -s rules<\/td><td>\u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0442\u0435\u043a\u0443\u0449\u0438\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u0438<\/td><\/tr><tr><td>pfctl -v -s rules show<\/td><td>\u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043f\u043e \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u043f\u0440\u0430\u0432\u0438\u043b\u0443 \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u0438<\/td><\/tr><tr><td>pfctl -vvsr<\/td><td>\u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0442\u0435\u043a\u0443\u0449\u0438\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u0438 \u0441 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u043d\u043e\u043c\u0435\u0440\u0430 \u043f\u0440\u0430\u0432\u0438\u043b\u0430<\/td><\/tr><tr><td>pfctl -v -s nat<\/td><td>\u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0442\u0435\u043a\u0443\u0449\u0438\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 NAT \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u043f\u043e \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u043f\u0440\u0430\u0432\u0438\u043b\u0443<\/td><\/tr><tr><td>pfctl -s nat -i xl1<\/td><td>\u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u0430 NAT \u0434\u043b\u044f \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 <code>xl1<\/code><\/td><\/tr><tr><td>pfctl -s queue<\/td><td>\u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u043e\u0447\u0435\u0440\u0435\u0434\u0438<\/td><\/tr><tr><td>pfctl -s state<\/td><td>\u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0442\u0430\u0431\u043b\u0438\u0446<\/td><\/tr><tr><td>pfctl -s info<\/td><td>\u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443 \u043f\u0440\u0430\u0432\u0438\u043b \u0438 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0441\u0447\u0451\u0442\u0447\u0438\u043a\u043e\u0432<\/td><\/tr><tr><td>pfctl -s all<\/td><td>\u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0432\u0441\u0435 \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e<\/td><\/tr><tr><td>&nbsp;<\/td><\/tr><tr><td>pfctl -t testtable -T show<\/td><td>\u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0433\u043e \u0442\u0430\u0431\u043b\u0438\u0446\u044b <code>testtable<\/code><\/td><\/tr><tr><td>pfctl -t testtable -T show -v<\/td><td>\u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440 \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438 \u043f\u043e \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u0430\u0434\u0440\u0435\u0441\u0443 \u0442\u0430\u0431\u043b\u0438\u0446\u044b <code>testtable<\/code><\/td><\/tr><tr><td>pfctl -t testtable -T add 192.168.1.1<\/td><td>\u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0430\u0434\u0440\u0435\u0441\u0430 <code>192.168.1.1<\/code> \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 <code>testtable<\/code><\/td><\/tr><tr><td>pfctl -t testtable -T delete 192.168.1.1<\/td><td>\u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u0430\u0434\u0440\u0435\u0441\u0430 <code>192.168.1.1<\/code> \u0438\u0437 \u0442\u0430\u0431\u043b\u0438\u0446\u044b <code>testtable<\/code><\/td><\/tr><tr><td>pfctl -t testtable -T flush<\/td><td>\u043e\u0447\u0438\u0441\u0442\u0438\u0442\u044c \u0442\u0430\u0431\u043b\u0438\u0446\u0443 <code>testtable<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>\u0421\u043f\u0438\u0441\u043e\u043a \u043a\u043e\u043c\u0430\u043d\u0434 \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u0444\u0430\u0435\u0440\u0432\u043e\u043b\u043e\u043c pf. pfctl -d \u0432\u044b\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043f\u0430\u043a\u0435\u0442\u043d\u044b\u0439 \u0444\u0438\u043b\u044c\u0442\u0440 pfctl -e \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043f\u0430\u043a\u0435\u0442\u043d\u044b\u0439 \u0444\u0438\u043b\u044c\u0442\u0440 &nbsp; pfctl -f \/etc\/pf.conf \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0433 \u0438\u0437 \/etc\/pf.conf pfctl -n -f \/etc\/pf.conf \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043d\u0430 \u043e\u0448\u0438\u0431\u043a\u0438 \/etc\/pf.conf, \u043d\u043e \u043d\u0435 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u0435\u0433\u043e pfctl -R -f \/etc\/pf.conf \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0444\u0438\u0442\u0440\u0430\u0446\u0438\u0438 \u0438\u0437 \/etc\/pf.conf pfctl -N -f \/etc\/pf.conf \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u0430 NAT \u0438\u0437 &hellip; <a href=\"https:\/\/blog.corvin.su\/?p=178\" class=\"more-link\">\u0427\u0438\u0442\u0430\u0442\u044c \u0434\u0430\u043b\u0435\u0435<span class=\"screen-reader-text\"> \u00ab\u041a\u043e\u043c\u0430\u043d\u0434\u044b \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0444\u0430\u0435\u0440\u0432\u043e\u043b\u043e\u043c pf\u00bb<\/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":[16,4,17],"tags":[],"class_list":["post-178","post","type-post","status-publish","format-standard","hentry","category-freebsd","category-nix","category-pf"],"_links":{"self":[{"href":"https:\/\/blog.corvin.su\/index.php?rest_route=\/wp\/v2\/posts\/178","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.corvin.su\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.corvin.su\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.corvin.su\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.corvin.su\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=178"}],"version-history":[{"count":1,"href":"https:\/\/blog.corvin.su\/index.php?rest_route=\/wp\/v2\/posts\/178\/revisions"}],"predecessor-version":[{"id":179,"href":"https:\/\/blog.corvin.su\/index.php?rest_route=\/wp\/v2\/posts\/178\/revisions\/179"}],"wp:attachment":[{"href":"https:\/\/blog.corvin.su\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=178"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.corvin.su\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=178"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.corvin.su\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=178"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}