{"id":1216,"date":"2011-06-24T16:13:13","date_gmt":"2011-06-24T13:13:13","guid":{"rendered":"http:\/\/avz.org.ua\/wp\/?p=1216"},"modified":"2025-12-18T10:41:31","modified_gmt":"2025-12-18T08:41:31","slug":"policy-routing","status":"publish","type":"post","link":"https:\/\/avz.org.ua\/wp\/2011\/06\/24\/policy-routing\/","title":{"rendered":"\u0420\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u0435 \u0442\u0440\u0430\u0444\u0438\u043a\u0430 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 policy routing"},"content":{"rendered":"<p>\u041f\u0440\u0435\u0434\u0441\u0442\u0430\u043b\u0430 \u043a\u043e\u0433\u0434\u0430-\u0442\u043e \u0437\u0430\u0434\u0430\u0447\u0430 - \u0432\u044b\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0438\u0437 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0435\u0442\u0438 \u0442\u0440\u0430\u0444\u0438\u043a \u043e\u0434\u043d\u043e\u0433\u043e \u0434\u0435\u0432\u0430\u0439\u0441\u0430 (\u0441\u043c\u0430\u0440\u0442\u0444\u043e\u043d\u0430) \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u0432 \u043b\u043e\u0433\u0430\u0445 \u0441\u0430\u0439\u0442\u043e\u0432, \u043a\u0443\u0434\u0430 \u0431\u0443\u0434\u0435\u0442 \u0441\u0435\u0439 \u0434\u0435\u0432\u0430\u0439\u0441 \u0445\u043e\u0434\u0438\u0442\u044c, \u0441\u0432\u0435\u0442\u0438\u043b\u0441\u044f IP-\u0430\u0434\u0440\u0435\u0441 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0437\u0430\u043c\u043e\u0440\u0441\u043a\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0433\u043e \u0432 \u0410\u0432\u0441\u0442\u0440\u0430\u043b\u0438\u0438. \u0421\u043c\u0430\u0440\u0442\u0444\u043e\u043d \u044d\u0442\u043e\u0442 \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u0441\u0440\u0435\u0434\u0441\u0442\u0432 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 VPN-\u043e\u0432 \u043d\u0435 \u0438\u043c\u0435\u043b \u0438 \u0434\u0430\u0436\u0435 \u0431\u044b\u043b \u043d\u0435\u0441\u043f\u043e\u0441\u043e\u0431\u0435\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 \u043f\u0440\u043e\u043a\u0441\u0438, \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442 \u0445\u043e\u0434\u0438\u043b \u0447\u0435\u0440\u0435\u0437 Wi-Fi. \u041b\u043e\u043a\u0430\u043b\u044c\u043d\u0430\u044f \u0441\u0435\u0442\u044c \u0441 Wi-Fi \u0438 \u0441\u043c\u0430\u0440\u0442\u0444\u043e\u043d\u043e\u043c \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0430 \u0432 \u041a\u0438\u0435\u0432\u0435, \u0432 \u0418\u043d\u0442\u0435\u0440\u043d\u0435\u0442 \u0445\u043e\u0434\u0438\u0442 \u0447\u0435\u0440\u0435\u0437 <a href=\"\/wp\/2009\/01\/09\/linux-nat\">NAT<\/a>.<br \/>\n<a href=\"https:\/\/avz.org.ua\/wp\/2011\/06\/24\/policy-routing\/policy_routing-2\/\" rel=\"attachment wp-att-1219\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/avz.org.ua\/wp\/wp-content\/uploads\/2011\/06\/policy_routing1.png\" alt=\"\u0441\u0445\u0435\u043c\u0430 \u0441\u0435\u0442\u0438\" title=\"policy_routing\" width=\"525\" height=\"328\" class=\"aligncenter size-full wp-image-1219\" srcset=\"https:\/\/avz.org.ua\/wp\/wp-content\/uploads\/2011\/06\/policy_routing1.png 525w, https:\/\/avz.org.ua\/wp\/wp-content\/uploads\/2011\/06\/policy_routing1-300x187.png 300w\" sizes=\"auto, (max-width: 525px) 100vw, 525px\" \/><\/a><\/p>\n<ol>\n<li>\u041d\u0430 \u0430\u0432\u0441\u0442\u0440\u0430\u043b\u0438\u0439\u0441\u043a\u043e\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0435 c \u0438\u043c\u0435\u043d\u0435\u043c remote.server.au <a href=\"\/wp\/2009\/07\/18\/pptpd-vpn-server\/\">\u0441\u0442\u0440\u043e\u0438\u043c VPN-\u0441\u0435\u0440\u0432\u0435\u0440, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 pptpd<\/a><\/li>\n<li>\u041d\u0430 \u043e\u0444\u0438\u0441\u043d\u043e\u043c \u0440\u043e\u0443\u0442\u0435\u0440\u0435 R \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c VPN-\u043a\u043b\u0438\u0435\u043d\u0442, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 pptp, \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u0441\u044f \u043a VPN-\u0441\u0435\u0440\u0432\u0435\u0440\u0443, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0442\u0430\u043a:\n<pre lang=\"bash\">\r\npppd pty 'pptp remote.server.au --nolaunchpppd' call sidney debug dump logfd 2 nodetach\r\n<\/pre>\n<p>\u0438\u043c\u044f \u0441\u0435\u0430\u043d\u0441\u0430 sidney (\u043f\u043e\u0441\u043b\u0435 call) \u0434\u043e\u043b\u0436\u043d\u043e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u043c\u0443 \u0432 \u0444\u0430\u0439\u043b\u0435 \/etc\/ppp\/chap-secrets, nodetach --- \u043d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u044f \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0434\u043b\u044f \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430.<\/li>\n<li>\u041c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 IP-\u0430\u0434\u0440\u0435\u0441\u0430 \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f (destination IP-address), \u0442\u043e \u0435\u0441\u0442\u044c \u0434\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0447\u0435\u0440\u0435\u0437 \u043a\u0430\u043a\u043e\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043f\u0430\u043a\u0435\u0442 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u044d\u0442\u043e\u0442 \u0430\u0434\u0440\u0435\u0441. \u0410 \u0432 \u043d\u0430\u0448\u0435\u0439 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0435 --- \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 \u0421\u0438\u0434\u043d\u0435\u0439 \u0442\u0440\u0430\u0444\u0438\u043a \u043e\u0434\u043d\u043e\u0433\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u043c\u0430\u0440\u0442\u0444\u043e\u043d\u0430 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0435\u0433\u043e IP-\u0430\u0434\u0440\u0435\u0441\u0430, \u0430 \u0432\u0441\u0435\u0445 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0435\u0442\u0438 \u043d\u0435 \u0442\u0440\u043e\u0433\u0430\u0442\u044c. \u042d\u0442\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0441\u0442\u0438\u0447\u044c \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u043e\u0434\u043d\u043e\u043c\u0443 \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u043c\u0443 \u0443\u043c\u0435\u043d\u0438\u044e linux, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <strong>policy routing<\/strong>. \u0421\u043e\u0437\u0434\u0430\u0451\u043c \u0435\u0449\u0435 \u043e\u0434\u043d\u0443 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0441 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u044b\u043c \u0438\u043c\u0435\u043d\u0435\u043c (\u044f \u0432\u044b\u0431\u0440\u0430\u043b avztable) \u0434\u043b\u044f \u043f\u0440\u0430\u0432\u0438\u043b \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 IP-\u0430\u0434\u0440\u0435\u0441\u0430 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u0435\u043b\u044f. \u042d\u0442\u0430 \u043d\u043e\u0432\u0430\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0431\u0443\u0434\u0435\u0442 \u0436\u0438\u0442\u044c \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e \u0438 \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e \u043e\u0442 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u0441 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c main. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432 \/etc\/iproute2\/rt_tables, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u0442\u0440\u043e\u0447\u043a\u0443\n<pre lang=\"none\">\r\n252 avztable\r\n<\/pre>\n<\/li>\n<li>\u0421\u043e\u0437\u0434\u0430\u0451\u043c \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0434\u043b\u044f \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u043e source-\u0430\u0434\u0440\u0435\u0441\u0443:\n<pre lang=\"bash\">\r\nip rule add from 192.168.1.55 lookup avztable\r\n<\/pre>\n<\/li>\n<li>\u0420\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0442\u0440\u0430\u0444\u0438\u043a \u0441\u043c\u0430\u0440\u0442\u0444\u043e\u043d\u0430 \u0432 \u0442\u0443\u043d\u043d\u0435\u043b\u044c \u043f\u0443\u0442\u0451\u043c \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0430 \u043f\u043e-\u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 avztable:\n<pre lang=\"bash\">\r\nip r a default via 192.168.0.1 table avztable\r\n<\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c 192.168.0.1 --- \u0430\u0434\u0440\u0435\u0441 VPN-\u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u043c \u043f\u043e\u0441\u043b\u0435 \u043f\u043e\u0434\u043d\u044f\u0442\u0438\u044f \u0442\u0443\u043d\u043d\u0435\u043b\u044f, \u0437\u0430\u0434\u0430\u0451\u0442\u0441\u044f \u0432 \/etc\/pptpd.conf \u0432 \u0421\u0438\u0434\u043d\u0435\u0435.\n<\/li>\n<li>\u0412 \u0421\u0438\u0434\u043d\u0435\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0434\u043b\u044f \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u0432\u0445\u043e\u0434\u044f\u0449\u0435\u0433\u043e \u043a \u0441\u043c\u0430\u0440\u0442\u0444\u043e\u043d\u0443 \u0442\u0440\u0430\u0444\u0438\u043a\u0430. \u042f \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u0432\u0430\u044f\u043b \u0442\u0430\u043a\u043e\u0439 \u043f\u0440\u043e\u0441\u0442\u0435\u043d\u044c\u043a\u0438\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 \u0438 \u0437\u0430\u0441\u0443\u043d\u0443\u043b \u0435\u0433\u043e \u0432 cron:\n<pre lang=\"bash\">\r\nnet='192.168.1.0\/24'\r\n\/sbin\/ip r s | grep \"$net\" > \/dev\/null || {\r\n  gw=`\/sbin\/ip a s | grep -E \"ppp[0-9]\" | grep inet | sed -r \"s\/.*peer[[:space:]]([^\/]+)\\\/.*\/\\1\/\"`\r\n    if [ ! -z $gw ]; then\r\n      echo \"setting route to net $net via $gw\"\r\n      \/sbin\/ip r a $net via $gw\r\n    fi\r\n}\r\n<\/pre>\n<p>\u0412\u043e 2-\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0430 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u0438, \u0435\u0441\u043b\u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u043d\u0435\u0442, \u0438\u0434\u0451\u043c \u0434\u0430\u043b\u044c\u0448\u0435. \u0412 3-\u0435\u0439 \u0441\u0442\u0440\u043e\u0447\u043a\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u043c IP-\u0430\u0434\u0440\u0435\u0441 VPN-\u043a\u043b\u0438\u0435\u043d\u0442\u0430 (\u043e\u0444\u0438\u0441\u043d\u043e\u0433\u043e \u0440\u043e\u0443\u0442\u0435\u0440\u0430), \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043b\u0441\u044f \u0438\u0437 \u041a\u0438\u0435\u0432\u0430. \u0412 6-\u043e\u0439 \u0441\u0442\u0440\u043e\u0447\u043a\u0435 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043c\u0430\u0440\u0448\u0440\u0443\u0442. \u041f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u0430\u0432\u0441\u0442\u0440\u0430\u043b\u0438\u0439\u0441\u043a\u0438\u0439 \u0441\u0435\u0440\u0432\u0435\u0440 \u0431\u0443\u0434\u0435\u0442 \u0437\u043d\u0430\u0442\u044c, \u0447\u0442\u043e \u0442\u0440\u0430\u0444\u0438\u043a \u0441 \u0430\u0434\u0440\u0435\u0441\u0430\u043c\u0438 \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438\u0437 \u0441\u0435\u0442\u0438 192.168.1.0\/24 (\u043a\u0443\u0434\u0430 \u0432\u0445\u043e\u0434\u0438\u0442 \u043d\u0430\u0448 \u0441\u043c\u0430\u0440\u0442\u0444\u043e\u043d), \u043d\u0443\u0436\u043d\u043e \u0441\u043b\u0430\u0442\u044c \u0432 \u0442\u0443\u043d\u043d\u0435\u043b\u044c, \u0430 \u043d\u0435 \u0441\u0432\u043e\u0435\u043c\u0443 default gateway. \u041f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u0435\u0435 \u0431\u044b\u043b\u043e \u0431\u044b, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u0441\u043a\u0440\u0438\u043f\u0442 \u043d\u0435 \u0438\u0437 cron, \u0430 \u043e\u0434\u0438\u043d \u0440\u0430\u0437 \u0441\u0440\u0430\u0437\u0443 \u043f\u043e\u0441\u043b\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0442\u0443\u043d\u043d\u0435\u043b\u044f. \u041d\u043e \u043c\u043d\u0435 \u0431\u044b\u043b\u043e \u043b\u0435\u043d\u0438\u0432\u043e \u0438\u0441\u043a\u0430\u0442\u044c \u043a\u0430\u043a \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438.\n<\/li>\n<li>\u0412 \u0421\u0438\u0434\u043d\u0435\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c firewall, \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u0442\u0430\u043a\u043e\u0435:\n<pre lang=\"bash\">\r\nIPT=\/sbin\/iptables\r\n$IPT -A INPUT -p 47 -j ACCEPT\r\n$IPT -A INPUT -p tcp --dport 1723 -j ACCEPT\r\n$IPT -A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT\r\n$IPT -A FORWARD -s 192.168.1.55 -m comment --comment \"phone\" -j ACCEPT\r\n$IPT -t nat -A POSTROUTING -s 192.168.1.0\/24 -o eth0 -j MASQUERADE\r\n<\/pre>\n<p>2-\u0430\u044f \u0438 3-\u044f\u044f \u0441\u0442\u0440\u043e\u0447\u043a\u0438 \u043d\u0443\u0436\u043d\u044b \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f \u043a VPN-\u0441\u0435\u0440\u0432\u0435\u0440\u0443. \u0412 4-\u043e\u0439 \u0438 5-\u043e\u0439 \u0440\u0430\u0437\u0440\u0435\u0448\u0430\u0435\u043c \u0442\u0440\u0430\u043d\u0437\u0438\u0442\u043d\u044b\u0439 \u0442\u0440\u0430\u0444\u0438\u043a \u043e\u0442 \u0438 \u043a \u0441\u043c\u0430\u0440\u0442\u0444\u043e\u043d\u0443. \u0412 6-\u043e\u0439 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u043c <a href=\"\/wp\/2009\/01\/09\/linux-nat\">NAT<\/a>, \u0442\u0430\u043a \u0447\u0442\u043e\u0431\u044b \u0441\u0435\u0440\u044b\u0439 \u0430\u0434\u0440\u0435\u0441 \u0441\u043c\u0430\u0440\u0442\u0444\u043e\u043d\u0430 \u0442\u0440\u0430\u043d\u0441\u043b\u0438\u0440\u043e\u0432\u0430\u043b\u0441\u044f \u0432 \u0432 \u0447\u0435\u0441\u0442\u043d\u044b\u0439 \u0430\u0434\u0440\u0435\u0441 \u0430\u0432\u0441\u0442\u0440\u0430\u043b\u0438\u0439\u0441\u043a\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430 (eth0 - \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0432 \u0441\u0442\u043e\u0440\u043e\u043d\u0443 \u0418\u043d\u0442\u0435\u0440\u043d\u0435\u0442).<\/li>\n<li>\u0412\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0444\u043e\u0440\u0444\u0430\u0440\u0434\u0438\u043d\u0433 \u043c\u0435\u0436\u0434\u0443 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430\u043c\u0438 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0432 \u0421\u0438\u0434\u043d\u0435\u0435:\n<pre lang=\"bash\">\r\nsysctl -w net.ipv4.ip_forward = 1\r\n<\/pre>\n<\/li>\n<\/ol>\n<p>\u0418\u0434\u0451\u043c \u0431\u0440\u043e\u0443\u0437\u0435\u0440\u043e\u043c \u0441\u043e \u0441\u043c\u0430\u0440\u0442\u0444\u043e\u043d\u0430 \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043d\u0430 \u043a\u0430\u043a\u043e\u0439-\u043d\u0438\u0431\u0443\u0434\u044c looking-glass \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0451\u043c, \u0447\u0442\u043e \u043e\u043d \u043d\u0430\u043c \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 IP-\u0430\u0434\u0440\u0435\u0441 \u0430\u0432\u0441\u0442\u0440\u0430\u043b\u0438\u0439\u0441\u043a\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430.<\/p>\n<p>Addition from 2025-12-18: the same things can be done via NetworkManager (see man 5 nm-settings-nmcli for details - search for \"ipv4.routing-rules\").<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u041f\u0440\u0435\u0434\u0441\u0442\u0430\u043b\u0430 \u043a\u043e\u0433\u0434\u0430-\u0442\u043e \u0437\u0430\u0434\u0430\u0447\u0430 - \u0432\u044b\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0438\u0437 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0435\u0442\u0438 \u0442\u0440\u0430\u0444\u0438\u043a \u043e\u0434\u043d\u043e\u0433\u043e \u0434\u0435\u0432\u0430\u0439\u0441\u0430 (\u0441\u043c\u0430\u0440\u0442\u0444\u043e\u043d\u0430) \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u0432 \u043b\u043e\u0433\u0430\u0445 \u0441\u0430\u0439\u0442\u043e\u0432, \u043a\u0443\u0434\u0430 \u0431\u0443\u0434\u0435\u0442 \u0441\u0435\u0439 \u0434\u0435\u0432\u0430\u0439\u0441 \u0445\u043e\u0434\u0438\u0442\u044c, \u0441\u0432\u0435\u0442\u0438\u043b\u0441\u044f IP-\u0430\u0434\u0440\u0435\u0441 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0437\u0430\u043c\u043e\u0440\u0441\u043a\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0433\u043e \u0432 \u0410\u0432\u0441\u0442\u0440\u0430\u043b\u0438\u0438. \u0421\u043c\u0430\u0440\u0442\u0444\u043e\u043d \u044d\u0442\u043e\u0442 \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u0441\u0440\u0435\u0434\u0441\u0442\u0432 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 VPN-\u043e\u0432 \u043d\u0435 \u0438\u043c\u0435\u043b \u0438 \u0434\u0430\u0436\u0435 \u0431\u044b\u043b \u043d\u0435\u0441\u043f\u043e\u0441\u043e\u0431\u0435\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 \u043f\u0440\u043e\u043a\u0441\u0438, \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442 \u0445\u043e\u0434\u0438\u043b \u0447\u0435\u0440\u0435\u0437 Wi-Fi. \u041b\u043e\u043a\u0430\u043b\u044c\u043d\u0430\u044f \u0441\u0435\u0442\u044c \u0441 Wi-Fi \u0438 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,21],"tags":[197],"class_list":["post-1216","post","type-post","status-publish","format-standard","hentry","category-nix","category-tips-and-tricks","tag-routing"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/avz.org.ua\/wp\/wp-json\/wp\/v2\/posts\/1216","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/avz.org.ua\/wp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/avz.org.ua\/wp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/avz.org.ua\/wp\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/avz.org.ua\/wp\/wp-json\/wp\/v2\/comments?post=1216"}],"version-history":[{"count":0,"href":"https:\/\/avz.org.ua\/wp\/wp-json\/wp\/v2\/posts\/1216\/revisions"}],"wp:attachment":[{"href":"https:\/\/avz.org.ua\/wp\/wp-json\/wp\/v2\/media?parent=1216"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/avz.org.ua\/wp\/wp-json\/wp\/v2\/categories?post=1216"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/avz.org.ua\/wp\/wp-json\/wp\/v2\/tags?post=1216"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}