{"id":138,"date":"2018-04-25T10:50:10","date_gmt":"2018-04-25T07:50:10","guid":{"rendered":"http:\/\/itbru.ru\/?p=138"},"modified":"2018-09-03T14:58:47","modified_gmt":"2018-09-03T11:58:47","slug":"iptables-forward-traff","status":"publish","type":"post","link":"https:\/\/itbru.ru\/index.php\/2018\/04\/25\/iptables-forward-traff\/","title":{"rendered":"iptables. Forward \u0442\u0440\u0430\u0444\u0438\u043a\u0430."},"content":{"rendered":"<p>\u0417\u0430\u0434\u0430\u0447\u0430 \u0432\u044b\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u044b \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0435\u0442\u0438 \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442 \u0447\u0435\u0440\u0435\u0437 \u0441\u0435\u0440\u0432\u0435\u0440 \u0441 Linux \u0438 \u0434\u0432\u0443\u043c\u044f \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430\u043c\u0438. Eth0 &#8212; \u0432\u043d\u0435\u0448\u043d\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441, Eth1 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0439.<\/p>\n<p>\u0420\u0430\u0437\u0440\u0435\u0448\u0430\u0435\u043c \u0444\u043e\u0440\u0432\u0430\u0440\u0434\u0438\u043d\u0433 \u0434\u043b\u044f \u0432\u0441\u0435\u0439 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0435\u0442\u0438. \u0412 \u044d\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 eth1. \u041f\u0435\u0440\u0432\u043e\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0440\u0430\u0437\u0440\u0435\u0448\u0430\u0435\u0442 \u0444\u043e\u0440\u0432\u0430\u0440\u0434 \u0432\u0445\u043e\u0434\u044f\u0449\u0435\u0433\u043e \u0442\u0440\u0430\u0444\u0438\u043a\u0430, \u0432\u0442\u043e\u0440\u043e\u0435 \u0438\u0441\u0445\u043e\u0434\u044f\u0449\u0435\u0433\u043e.<\/p>\n<pre class=\"lang:default decode:true \">iptables -A FORWARD -i eth1 -j ACCEPT\r\niptables -A FORWARD -o eth1 -j ACCEPT<\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u0434\u043d\u044f\u0442\u044c NAT. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0432 \u0440\u043e\u043b\u0438 \u0432\u043d\u0435\u0448\u043d\u0435\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u0432\u044b\u0441\u0442\u0443\u043f\u0430\u0435\u0442 eth0:<\/p>\n<pre class=\"lang:default decode:true \">iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE<\/pre>\n<p>\u041d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u0435\u043c \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0444\u043e\u0440\u0432\u0430\u0440\u0434\u0438\u043d\u0433 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0443\u0435\u043c \/etc\/sysctl.conf \u0438 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 net.ipv4.ip_forward = 0 \u043d\u0430 net.ipv4.ip_forward = 1<br \/>\n\u0412 \u0438\u0442\u043e\u0433\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0433\u0435\u0439\u0442\u0432\u0435\u044f \u0432\u043e \u0432\u043d\u0435\u0448\u043d\u044e\u044e \u0441\u0435\u0442\u044c.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0417\u0430\u0434\u0430\u0447\u0430 \u0432\u044b\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u044b \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0435\u0442\u0438 \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442 \u0447\u0435\u0440\u0435\u0437 \u0441\u0435\u0440\u0432\u0435\u0440 \u0441 Linux \u0438 \u0434\u0432\u0443\u043c\u044f \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430\u043c\u0438. Eth0 &#8212; \u0432\u043d\u0435\u0448\u043d\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441, Eth1 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0439. \u0420\u0430\u0437\u0440\u0435\u0448\u0430\u0435\u043c \u0444\u043e\u0440\u0432\u0430\u0440\u0434\u0438\u043d\u0433 \u0434\u043b\u044f \u0432\u0441\u0435\u0439 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439&hellip;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17],"tags":[],"class_list":["post-138","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/itbru.ru\/index.php\/wp-json\/wp\/v2\/posts\/138","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/itbru.ru\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/itbru.ru\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/itbru.ru\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/itbru.ru\/index.php\/wp-json\/wp\/v2\/comments?post=138"}],"version-history":[{"count":2,"href":"https:\/\/itbru.ru\/index.php\/wp-json\/wp\/v2\/posts\/138\/revisions"}],"predecessor-version":[{"id":221,"href":"https:\/\/itbru.ru\/index.php\/wp-json\/wp\/v2\/posts\/138\/revisions\/221"}],"wp:attachment":[{"href":"https:\/\/itbru.ru\/index.php\/wp-json\/wp\/v2\/media?parent=138"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itbru.ru\/index.php\/wp-json\/wp\/v2\/categories?post=138"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itbru.ru\/index.php\/wp-json\/wp\/v2\/tags?post=138"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}