{"id":328784,"date":"2022-01-30T03:00:16","date_gmt":"2022-01-30T03:00:16","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=328784"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=328784","title":{"rendered":"<span>Tinc \u2014 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 VPN \u0432 Ubuntu<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body_version-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">Tinc \u2014 \u044d\u0442\u043e \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 \u0441\u0435\u0442\u0435\u0432\u043e\u0439 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b \u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0430\u044f \u0434\u043b\u044f \u0441\u0436\u0430\u0442\u044b\u0445 \u0438 \u0437\u0430\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u0447\u0430\u0441\u0442\u043d\u044b\u0445 \u0441\u0435\u0442\u0435\u0439. \u042d\u0442\u043e \u043f\u0440\u043e\u0435\u043a\u0442 \u0431\u044b\u043b \u043d\u0430\u0447\u0430\u0442 \u0432 1998 \u0433\u043e\u0434\u0443 \u0413\u0443\u0441\u043e\u043c \u0421\u043b\u0438\u043f\u0435\u043d\u043e\u043c, \u0418\u0432\u043e \u0422\u0438\u043c\u043c\u0435\u0440\u043c\u0430\u043d\u0441\u043e\u043c \u0438 \u0412\u0435\u0441\u0441\u0435\u043b\u0435\u043c \u0414\u0430\u043d\u043a\u0435\u0440\u0441\u043e\u043c \u043f\u043e\u0434 \u043b\u0438\u0446\u0435\u043d\u0437\u0438\u0435\u0439 GPL.<\/p>\n<p>  \u041a \u0435\u0433\u043e \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u043c \u0434\u043e\u0441\u0442\u043e\u0438\u043d\u0441\u0442\u0432\u0430\u043c \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f:<br \/>  1) \u0420\u0435\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u0430\u044f \u0442\u043e\u043f\u043e\u043b\u043e\u0433\u0438\u044f (\u043d\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0432 \u043c\u043e\u0449\u043d\u043e\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0435 VPN).<br \/>  2) \u0420\u0430\u0431\u043e\u0442\u0435\u0442 \u043f\u043e\u0432\u0435\u0440\u0445 \u0441\u0435\u0442\u0435\u0439 \u043b\u044e\u0431\u043e\u0439 \u0442\u043e\u043f\u043e\u043b\u043e\u0433\u0438\u0438, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0437\u0430 NAT \u0438 \u043f\u043e\u0432\u0435\u0440\u0445 \u0434\u0440\u0443\u0433\u0438\u0445 VPN.<br \/>  3) \u041f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0434\u0430\u0436\u0435 \u043f\u043e\u0441\u043b\u0435 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0441\u0435\u0442\u0438 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0441 wi-fi \u043d\u0430 4g) \u0438\u043b\u0438 \u043f\u0440\u0438 \u0432\u0445\u043e\u0434\u0435 \u0438 \u0432\u044b\u0445\u043e\u0434\u0435 \u0438\u0437 \u0434\u0440\u0443\u0433\u0438\u0445 VPN.<br \/>  4) \u0420\u0430\u0431\u043e\u0442\u0435\u0442 \u0432 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 Windows XP.<\/p>\n<p>  \u041a \u044d\u0442\u043e\u043c\u0443 \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c, \u0447\u0442\u043e tinc \u0432\u0445\u043e\u0434\u0438\u0442 \u0432\u043e \u0432\u0441\u0435 \u0434\u0438\u0441\u0442\u0438\u0440\u0431\u0443\u0442\u0438\u0432\u044b Linux, \u0442\u043e \u0435\u0441\u0442\u044c \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0438 \u0441\u0440\u0430\u0437\u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f.<\/p>\n<p>  \u041f\u0440\u0438 \u044d\u0442\u043e\u043c tinc \u0443 \u0448\u0438\u0440\u043e\u043a\u043e\u0439 \u043f\u0443\u0431\u043b\u0438\u043a\u0438 \u043d\u0435 \u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u043e\u0441\u0442\u044c\u044e. \u041e\u0434\u043d\u0430 \u0438\u0437 \u043f\u0440\u0438\u0447\u0438\u043d \u2014 \u043e\u0447\u0435\u043d\u044c \u043b\u0430\u043a\u043e\u043d\u0438\u0447\u043d\u0430\u044f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u043b\u0430\u0441\u044c \u0432 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0438\u0442\u0435\u0442\u0441\u043a\u043e\u0439 \u0441\u0440\u0435\u0434\u0435, \u0438 \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043a\u043e\u0440\u0435\u0435 \u0430\u043a\u0430\u0434\u0435\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0439, \u0447\u0435\u043c \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0439 \u0434\u043b\u044f \u0431\u044b\u0441\u0442\u0440\u043e\u0433\u043e \u043f\u0440\u043e\u0447\u0442\u0435\u043d\u0438\u044f.<\/p>\n<p>  \u0412 \u044d\u0442\u043e\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0438 \u044f \u043e\u043f\u0438\u0448\u0443 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e tinc VPN \u0432 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0438\u0441\u0442\u0435\u043c\u0435 Ubuntu.<br \/>  <a name=\"habracut\"><\/a><br \/>  \u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u043f\u0430\u043a\u0435\u0442 sudo apt-get install tinc.<\/p>\n<p>  \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0441\u0435\u0442\u044c \u0438\u043c\u0435\u0435\u0442 \u044f\u0447\u0435\u0438\u0441\u0442\u0443\u044e \u0442\u043e\u043f\u043e\u043b\u043e\u0433\u0438\u044e \u2014 \u043d\u0435\u0442 \u0441\u0435\u0440\u0435\u0432\u0435\u0440\u043d\u043e\u0433\u043e \u0438\u043b\u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u043e\u0433\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0433\u043e \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u044f. <\/p>\n<p>  \u0412 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0431\u0443\u0434\u0435\u0442 \u0434\u0432\u0435 \u043c\u0430\u0448\u0438\u043d\u044b. \u041f\u0435\u0440\u0432\u0443\u044e \u0443\u0441\u043b\u043e\u0432\u043d\u043e \u043d\u0430\u0437\u043e\u0432\u0435\u043c \u00ab\u0441\u0435\u0440\u0432\u0435\u0440\u00bb \u2014 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043a\u0440\u044b\u0442\u0430 \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u0438\u0437 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442 \u043f\u043e \u0438\u043c\u0435\u043d\u0438 alpha.example.com (\u0438\u043b\u0438 \u043f\u043e ip \u0430\u0434\u0440\u0435\u0441\u0443). \u0412\u0442\u043e\u0440\u0430\u044f \u043c\u0430\u0448\u0438\u043d\u0430 \u0431\u0443\u0434\u0435\u0442 \u0432 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0441\u0435\u0442\u0438 \u043d\u0435 \u0438\u043c\u0435\u044f \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u0433\u043e \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442 ip \u0430\u0434\u0440\u0435\u0441\u0430 (4g, wi-fi, \u0443\u0441\u043b\u043e\u0432\u043d\u043e \u043d\u0430\u0437\u043e\u0432\u0435\u043c \u0435\u0435 \u00ab\u0434\u043e\u043c\u0430\u0448\u043d\u0438\u0439 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u00bb)<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0438\u043c\u044f \u0434\u043b\u044f \u0441\u0435\u0442\u0438. \u0412 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 alpha.<\/p>\n<p>  \u0421\u043d\u0430\u0447\u043b\u0430 \u0440\u0430\u0431\u043e\u0442\u0435\u043c \u043d\u0430 \u00ab\u0441\u0435\u0440\u0432\u0435\u0440\u0435\u00bb \u0441 \u0430\u0434\u0440\u0435\u0441\u043e\u043c alpha.example.com. \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u043e\u0432 \u0434\u043b\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u043e\u0432 sudo mkdir -p \/etc\/tinc\/alpha\/hosts.<\/p>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043a\u043e\u043d\u0444\u0438\u0433 \u0441\u0435\u0442\u0438 alpha \/etc\/tinc\/alpha\/tinc.conf:<\/p>\n<pre><code class=\"bash\">Name = server_01 AddressFamily = ipv4 Interface = tun0 <\/code><\/pre>\n<p>  \u0412 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 \/etc\/tinc\/alpha\/hosts \u0431\u0443\u0434\u0443\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c\u0441\u044f \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0435 \u043a\u043b\u044e\u0447\u0438 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u043c\u0430\u0448\u0438\u043d\u044b \u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u0432 \u0441\u0435\u0442\u0438 alpha \u043c\u0430\u0448\u0438\u043d. \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0444\u0430\u0439\u043b \/etc\/tinc\/alpha\/hosts\/server_01:<\/p>\n<pre><code class=\"bash\">Address = alpha.example.com Subnet = 10.0.0.1\/32 Subnet = 0.0.0.0\/0 <\/code><\/pre>\n<p>  Address \u0437\u0430\u0434\u0430\u0435\u0442\u0441\u044f \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0435\u0441\u043b\u0438 \u0443 \u043c\u0430\u0448\u0438\u043d\u044b \u0435\u0441\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0439 \u0430\u0434\u0440\u0435\u0441 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0439 \u0430\u0434\u0440\u0435\u0441 \u0432 \u0441\u0435\u0442\u0438 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442) \u0438\u043b\u0438 \u0434\u043e\u043c\u0435\u043d\u043d\u043e\u0435 \u0438\u043c\u044f.<br \/>  Subnet = 10.0.0.1\/32 \u0437\u0430\u0434\u0430\u0435\u0442 \u0430\u0434\u0440\u0435\u0441 \u043c\u0430\u0448\u0438\u043d\u044b \u0432 \u0441\u0435\u0442\u0438 alpha.<br \/>  Subnet = 0.0.0.0\/0 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u043a\u043e\u0433\u0434\u0430 \u043d\u0435\u043e\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u0435\u0441\u044c \u0442\u0440\u0430\u0444\u0438\u043a \u043e\u0442 \u0434\u0440\u0443\u0433\u0438\u0445 \u043c\u0430\u0448\u0438\u043d \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442 \u043d\u0430\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0447\u0435\u0440\u0435\u0437 \u0442\u0435\u043a\u0443\u0449\u0443\u044e \u043c\u0430\u0448\u0438\u043d\u0443 (\u044d\u0442\u043e \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e).<\/p>\n<p>  \u0421\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 \u0438 \u0437\u0430\u043a\u0440\u044b\u0442\u044b\u0439 \u043a\u043b\u044e\u0447 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 sudo tincd -n alpha -K 4096.<\/p>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0444\u0430\u0439\u043b\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u043f\u0440\u0438 \u0441\u0442\u0430\u0440\u0442\u0435 \u0438 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 \u0441\u0435\u0442\u0438<br \/>  \/etc\/tinc\/alpha\/tinc-up:<\/p>\n<pre><code class=\"bash\">#!\/bin\/sh ip link set $INTERFACE up ip addr add 10.0.0.1\/32 dev $INTERFACE ip route add 10.0.0.0\/24 dev $INTERFACE <\/code><\/pre>\n<p>  \/etc\/tinc\/alpha\/tinc-down:<\/p>\n<pre><code class=\"bash\">#!\/bin\/sh ip route del 10.0.0.0\/24 dev $INTERFACE ip addr del 10.0.0.1\/32 dev $INTERFACE ip link set $INTERFACE down <\/code><\/pre>\n<p>  \u0421\u0434\u0435\u043b\u0430\u0435\u043c \u044d\u0442\u0438 \u0444\u0430\u0439\u043b\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u043c\u0438 sudo chmod 755 \/etc\/tinc\/alpha\/tinc-*<\/p>\n<p>  \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u0441\u0435\u0442\u044c alpha \u043d\u0430 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u043c\u0430\u0448\u0438\u043d\u0435 sudo tincd -n alpha -D -d5<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043d\u0430 \u00ab\u0434\u043e\u043c\u0430\u0448\u043d\u0438\u0439 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u00bb \u0438 \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u043c \u0432\u0441\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f (\u0441 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u043c\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u043c\u0438):<\/p>\n<p>  sudo apt-get install tinc<\/p>\n<p>  sudo mkdir -p \/etc\/tinc\/alpha\/hosts<\/p>\n<p>  \/etc\/tinc\/alpha\/tinc.conf:<\/p>\n<pre><code class=\"bash\">Name = client_01 AddressFamily = ipv4 Interface = tun0 ConnectTo = server_01 <\/code><\/pre>\n<p>  \/etc\/tinc\/alpha\/hosts\/client_01:<\/p>\n<pre><code class=\"bash\">Subnet = 10.0.0.2\/32 <\/code><\/pre>\n<p>  sudo tincd -n alpha -K 4096.<\/p>\n<p>  \/etc\/tinc\/alpha\/tinc-up:<\/p>\n<pre><code class=\"bash\">#!\/bin\/sh ip link set $INTERFACE up ip addr add 10.0.0.2\/32 dev $INTERFACE ip route add 10.0.0.0\/24 dev $INTERFACE <\/code><\/pre>\n<p>  \/etc\/tinc\/alpha\/tinc-down:<\/p>\n<pre><code class=\"bash\">#!\/bin\/sh ip route del 10.0.0.0\/24 dev $INTERFACE ip addr del 10.0.0.2\/32 dev $INTERFACE ip link set $INTERFACE down <\/code><\/pre>\n<p>  sudo chmod 755 \/etc\/tinc\/alpha\/tinc-*<\/p>\n<p>  sudo tincd -n alpha -D -d5<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0435\u043e\u0431\u043e\u0434\u0438\u043c\u043e \u043e\u0431\u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u043c\u0438 \u043a\u043b\u044e\u0447\u0430\u043c\u0438 \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430\u0445 \/etc\/tinc\/alpha\/hosts, \u0447\u0442\u043e\u0431\u044b \u0438\u0445 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u043d\u0430 \u043e\u0431\u043e\u0435\u0438\u0445 \u043c\u0430\u0448\u0438\u043d\u0430\u0445 \u0431\u044b\u043b\u043e \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e\u0435.<\/p>\n<p>  \u0418\u0442\u0430\u043a, \u0441\u0435\u0442\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u0430. \u0421 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430 10.0.0.1 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440 10.0.0.2 \u0438 \u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442.<\/p>\n<p>  \u0418\u043d\u043e\u0433\u0434\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e, \u0447\u0442\u043e\u0431\u044b \u0432\u0435\u0441\u0442 \u0442\u0440\u0430\u0444\u0438\u043a \u0441 \u00ab\u0434\u043e\u043c\u0430\u0448\u043d\u0435\u043e \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430\u00bb \u0448\u0435\u043b \u0447\u0435\u0440\u0435\u0437 \u00ab\u0441\u0435\u0440\u0432\u0435\u0440\u00bb (\u0442\u043e \u0434\u043b\u044f \u0447\u0435\u0433\u043e \u0441\u0435\u0439\u0447\u0430\u0441 VPN \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0447\u0430\u0441\u0442\u043e).<\/p>\n<p>  \u041d\u0430\u043f\u043e\u043c\u043d\u044e, \u0447\u0442\u043e \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043c\u044b \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 Subnet = 0.0.0.0\/0<\/p>\n<p>  \u041a\u0440\u043e\u043c\u0435 \u044d\u0442\u043e\u0433\u043e, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0435\u0442\u0438 \u043d\u0430 \u00ab\u0434\u043e\u043c\u0430\u0448\u043d\u0435\u043c \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0435:<\/p>\n<p>  \/etc\/tinc\/alpha\/tinc-up:<\/p>\n<pre><code class=\"bash\">#!\/bin\/sh REMOTEADDRESS=X.X.X.X VPN_GATEWAY=10.0.0.1 ORIGINAL_GATEWAY=`ip route show | grep ^default | cut -d ' ' -f 2-5`  ip link set $INTERFACE up ip addr add 10.0.0.2\/32 dev $INTERFACE ip route add 10.0.0.0\/24 dev $INTERFACE ip route add $REMOTEADDRESS $ORIGINAL_GATEWAY ip route add $VPN_GATEWAY dev $INTERFACE ip route add 0.0.0.0\/1 via $VPN_GATEWAY dev $INTERFACE ip route add 128.0.0.0\/1 via $VPN_GATEWAY dev $INTERFACE <\/code><\/pre>\n<p>  \/etc\/tinc\/alpha\/tinc-down<\/p>\n<pre><code class=\"bash\">#!\/bin\/sh REMOTEADDRESS=X.X.X.X VPN_GATEWAY=10.0.0.1 ORIGINAL_GATEWAY=`ip route show | grep ^default | cut -d ' ' -f 2-5`  ip route del $REMOTEADDRESS $ORIGINAL_GATEWAY ip route del $VPN_GATEWAY dev $INTERFACE ip route del 0.0.0.0\/1 dev $INTERFACE ip route del 128.0.0.0\/1 dev $INTERFACE ip route del 10.0.0.0\/24 dev $INTERFACE ip addr del 10.0.0.1\/32 dev $INTERFACE ip link set $INTERFACE down <\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0432\u0435\u0441\u044c \u0412\u0430\u0448 \u0442\u0440\u0430\u0444\u0438\u043a \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d \u043d\u0430 \u201e\u0441\u0435\u0440\u0432\u0435\u0440\u201c. \u041d\u043e \u044d\u0442\u043e \u0435\u0449\u0435 \u043d\u0435 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u0447\u0442\u043e \u0441\u0435\u0440\u0432\u0435\u0440 \u0431\u0443\u0434\u0435\u0442 \u0435\u0433\u043e \u043f\u0435\u0440\u0435\u0441\u044b\u043b\u0430\u0442\u044c \u043d\u0430 \u0434\u0440\u0443\u0433\u0438\u0435 \u0430\u0434\u0440\u0435\u0441\u0430. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u0435\u0449\u0435 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0441\u0435\u0442\u044c \u043d\u0430 \u201e\u0441\u0435\u0440\u0432\u0435\u0440\u0435\u201c. \u0414\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0438\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0431\u0443\u0434\u0443\u0442 \u0441\u0438\u043b\u044c\u043d\u043e \u0437\u0430\u0432\u0438\u0441\u0435\u0442\u044c \u043e\u0442 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0441\u0435\u0442\u0438. \u0412 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u043e\u043c\u043e\u0433\u0443\u0442 \u043a\u043e\u043c\u0430\u043d\u0434\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0435\u0441\u043b\u0438 \u0412\u044b \u0437\u043d\u0430\u0435\u0442\u0435 \u0447\u0442\u043e \u043e\u043d\u0438 \u0434\u0435\u043b\u0430\u044e\u0442:<\/p>\n<pre><code class=\"bash\">###   \u042d\u0442\u043e\u0442 \u043a\u043e\u0434 \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u043d\u0435\u0441\u0442\u0438 \u0432\u0440\u0435\u0434 \u0412\u0430\u0448\u0435\u043c\u0443 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0443   ###  sudo iptables -P FORWARD DROP sudo iptables -I FORWARD -i tun0 -o enp35s0 -j ACCEPT sudo iptables -I FORWARD -o tun0 -i enp35s0 -j ACCEPT sudo iptables -t nat -I POSTROUTING -o enp35s0 -j MASQUERADE <\/code><\/pre>\n<p>  \u041f\u043e\u043b\u0435\u0437\u043d\u044b\u0435 \u0441\u0441\u044b\u043b\u043a\u0438<\/p>\n<p>  1. <a href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-install-tinc-and-set-up-a-basic-vpn-on-ubuntu-18-04-ru\" rel=\"nofollow noopener noreferrer\">www.digitalocean.com\/community\/tutorials\/how-to-install-tinc-and-set-up-a-basic-vpn-on-ubuntu-18-04-ru<\/a><br \/>  2. <a href=\"https:\/\/www.tinc-vpn.org\/examples\/windows-install\/\" rel=\"nofollow noopener noreferrer\">www.tinc-vpn.org\/examples\/windows-install<\/a><br \/>  3. <a href=\"https:\/\/www.tinc-vpn.org\/examples\/redirect-gateway\/\" rel=\"nofollow noopener noreferrer\">www.tinc-vpn.org\/examples\/redirect-gateway<\/a><\/p>\n<p>  apapacy@gmail.com<br \/>  30 \u044f\u043d\u0432\u0430\u0440\u044f 2022 \u0433\u043e\u0434\u0430<\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/470243\/\"> https:\/\/habr.com\/ru\/post\/470243\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body_version-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">Tinc \u2014 \u044d\u0442\u043e \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 \u0441\u0435\u0442\u0435\u0432\u043e\u0439 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b \u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0430\u044f \u0434\u043b\u044f \u0441\u0436\u0430\u0442\u044b\u0445 \u0438 \u0437\u0430\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u0447\u0430\u0441\u0442\u043d\u044b\u0445 \u0441\u0435\u0442\u0435\u0439. \u042d\u0442\u043e \u043f\u0440\u043e\u0435\u043a\u0442 \u0431\u044b\u043b \u043d\u0430\u0447\u0430\u0442 \u0432 1998 \u0433\u043e\u0434\u0443 \u0413\u0443\u0441\u043e\u043c \u0421\u043b\u0438\u043f\u0435\u043d\u043e\u043c, \u0418\u0432\u043e \u0422\u0438\u043c\u043c\u0435\u0440\u043c\u0430\u043d\u0441\u043e\u043c \u0438 \u0412\u0435\u0441\u0441\u0435\u043b\u0435\u043c \u0414\u0430\u043d\u043a\u0435\u0440\u0441\u043e\u043c \u043f\u043e\u0434 \u043b\u0438\u0446\u0435\u043d\u0437\u0438\u0435\u0439 GPL.<\/p>\n<p>  \u041a \u0435\u0433\u043e \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u043c \u0434\u043e\u0441\u0442\u043e\u0438\u043d\u0441\u0442\u0432\u0430\u043c \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f:<br \/>  1) \u0420\u0435\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u0430\u044f \u0442\u043e\u043f\u043e\u043b\u043e\u0433\u0438\u044f (\u043d\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0432 \u043c\u043e\u0449\u043d\u043e\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0435 VPN).<br \/>  2) \u0420\u0430\u0431\u043e\u0442\u0435\u0442 \u043f\u043e\u0432\u0435\u0440\u0445 \u0441\u0435\u0442\u0435\u0439 \u043b\u044e\u0431\u043e\u0439 \u0442\u043e\u043f\u043e\u043b\u043e\u0433\u0438\u0438, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0437\u0430 NAT \u0438 \u043f\u043e\u0432\u0435\u0440\u0445 \u0434\u0440\u0443\u0433\u0438\u0445 VPN.<br \/>  3) \u041f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0434\u0430\u0436\u0435 \u043f\u043e\u0441\u043b\u0435 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0441\u0435\u0442\u0438 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0441 wi-fi \u043d\u0430 4g) \u0438\u043b\u0438 \u043f\u0440\u0438 \u0432\u0445\u043e\u0434\u0435 \u0438 \u0432\u044b\u0445\u043e\u0434\u0435 \u0438\u0437 \u0434\u0440\u0443\u0433\u0438\u0445 VPN.<br \/>  4) \u0420\u0430\u0431\u043e\u0442\u0435\u0442 \u0432 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 Windows XP.<\/p>\n<p>  \u041a \u044d\u0442\u043e\u043c\u0443 \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c, \u0447\u0442\u043e tinc \u0432\u0445\u043e\u0434\u0438\u0442 \u0432\u043e \u0432\u0441\u0435 \u0434\u0438\u0441\u0442\u0438\u0440\u0431\u0443\u0442\u0438\u0432\u044b Linux, \u0442\u043e \u0435\u0441\u0442\u044c \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0438 \u0441\u0440\u0430\u0437\u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f.<\/p>\n<p>  \u041f\u0440\u0438 \u044d\u0442\u043e\u043c tinc \u0443 \u0448\u0438\u0440\u043e\u043a\u043e\u0439 \u043f\u0443\u0431\u043b\u0438\u043a\u0438 \u043d\u0435 \u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u043e\u0441\u0442\u044c\u044e. \u041e\u0434\u043d\u0430 \u0438\u0437 \u043f\u0440\u0438\u0447\u0438\u043d \u2014 \u043e\u0447\u0435\u043d\u044c \u043b\u0430\u043a\u043e\u043d\u0438\u0447\u043d\u0430\u044f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u043b\u0430\u0441\u044c \u0432 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0438\u0442\u0435\u0442\u0441\u043a\u043e\u0439 \u0441\u0440\u0435\u0434\u0435, \u0438 \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043a\u043e\u0440\u0435\u0435 \u0430\u043a\u0430\u0434\u0435\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0439, \u0447\u0435\u043c \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0439 \u0434\u043b\u044f \u0431\u044b\u0441\u0442\u0440\u043e\u0433\u043e \u043f\u0440\u043e\u0447\u0442\u0435\u043d\u0438\u044f.<\/p>\n<p>  \u0412 \u044d\u0442\u043e\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0438 \u044f \u043e\u043f\u0438\u0448\u0443 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e tinc VPN \u0432 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0438\u0441\u0442\u0435\u043c\u0435 Ubuntu.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-328784","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/328784","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=328784"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/328784\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=328784"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=328784"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=328784"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}