{"id":216,"date":"2008-11-29T21:44:05","date_gmt":"2008-11-29T18:44:05","guid":{"rendered":"http:\/\/ps.sportcomitet.org\/blog\/?p=216"},"modified":"2011-05-11T22:34:52","modified_gmt":"2011-05-11T19:34:52","slug":"vpn-v-linux-iz-konsoli-obshhaga","status":"publish","type":"post","link":"https:\/\/seriyps.com\/blog\/2008\/11\/29\/vpn-v-linux-iz-konsoli-obshhaga\/","title":{"rendered":"VPN \u0432 Linux \u0438\u0437 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 (\u043e\u0431\u0449\u0430\u0433\u0430)"},"content":{"rendered":"<p>\u0411\u044b\u0441\u0442\u0440\u0435\u043d\u044c\u043a\u043e \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c VPN \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0432 \u043e\u0431\u0449\u0430\u0433\u0435 \u0420\u0425\u0422\u0423 \u0432 Ubuntu<br \/>\n\u0417\u0430\u043c\u0435\u0442\u043a\u0430 \u0431\u043e\u043b\u044c\u0448\u0435 \u0434\u043b\u044f \u0441\u0435\u0431\u044f, \u0447\u0442\u043e\u0431 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0447\u0435\u0433\u043e \u0431\u044b\u0441\u0442\u0440\u043e \u0432\u0441\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c, \u043d\u0435 \u0437\u043d\u0430\u044e \u043a\u0430\u043a \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f \u0434\u0440\u0443\u0433\u0438\u0445 \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432\u043e\u0432 \u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u043e\u0432.. \u0423 \u043d\u0430\u0441 \u0432 \u043e\u0431\u0449\u0430\u0433\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u043e\u0440\u043c<\/p>\n<p><!--more-->&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br \/>\n(\u0447\u0442\u043e <em><strong>\u0436\u0438\u0440\u043d\u044b\u043c \u0448\u0440\u0438\u0444\u0442\u043e\u043c<\/strong><\/em> &#8211; \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u043c \u043d\u0430 \u0441\u0432\u043e\u0435)<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/p>\n<p>1) \u0441\u0442\u0430\u0432\u0438\u043c \u043f\u0430\u043a\u0435\u0442 pptp-linux<\/p>\n<p>[codesyntax lang=&#8221;bash&#8221;]sudo apt-get install pptp-linux[\/codesyntax]<\/p>\n<p>2) \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0444\u0430\u0439\u043b \/etc\/ppp\/pap-secrets<br \/>\n\u0432\u043b\u0430\u0434\u0435\u043b\u0435\u0446 \u0444\u0430\u0439\u043b\u0430 root, \u0433\u0440\u0443\u043f\u043f\u0430 root, \u043f\u0440\u0430\u0432\u0430 rw&#8212;&#8212;-<br \/>\n\u0432 \u043d\u0435\u0433\u043e \u0432\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c<\/p>\n<blockquote><p>&#8220;<em><strong>\u043b\u043e\u0433\u0438\u043d \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430<\/strong><\/em>&#8221; * &#8220;<strong><em>\u043f\u0430\u0440\u043e\u043b\u044c \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430<\/em><\/strong>&#8220;<\/p><\/blockquote>\n<p>2) \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0444\u0430\u0439\u043b \/etc\/ppp\/chap-secrets<br \/>\n\u0432\u043b\u0430\u0434\u0435\u043b\u0435\u0446 \u0444\u0430\u0439\u043b\u0430 root, \u0433\u0440\u0443\u043f\u043f\u0430 root, \u043f\u0440\u0430\u0432\u0430 rw&#8212;&#8212;-<br \/>\n\u0432 \u043d\u0435\u0433\u043e \u0432\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c<\/p>\n<blockquote><p>&#8220;<em><strong>\u043b\u043e\u0433\u0438\u043d \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430<\/strong><\/em>&#8221; aprikonax &#8220;<em><strong>\u043f\u0430\u0440\u043e\u043b\u044c \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430<\/strong><\/em>&#8221; *<\/p><\/blockquote>\n<p>3) \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0444\u0430\u0439\u043b \/etc\/ppp\/peers\/aprikonax<br \/>\n\u0432\u043b\u0430\u0434\u0435\u043b\u0435\u0446 \u0444\u0430\u0439\u043b\u0430 root, \u0433\u0440\u0443\u043f\u043f\u0430 dip, \u043f\u0440\u0430\u0432\u0430 rw-r&#8211;r&#8211;<br \/>\n\u0432 \u043d\u0435\u0433\u043e \u043f\u0438\u0448\u0435\u043c<\/p>\n<blockquote><p># name of tunnel, used to select lines in secrets files<br \/>\nremotename aprikonax<\/p>\n<p># name of tunnel, used to name \/var\/run pid file<br \/>\nlinkname aprikonax<\/p>\n<p># name of tunnel, passed to ip-up scripts<br \/>\nipparam aprikonax<\/p>\n<p># data stream for pppd to use<br \/>\npty &#8220;\/usr\/sbin\/pptp &#8211;loglevel 1 <span style=\"color: #ff0000;\">vpn.skynet<\/span> &#8211;nolaunchpppd&#8221;<\/p>\n<p># domain and username, used to select lines in secrets files<br \/>\nname &#8220;<em><strong>\u043b\u043e\u0433\u0438\u043d \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430<\/strong><\/em>&#8221;<\/p>\n<p># disable MPPE encryption<br \/>\nnomppe<\/p>\n<p># we do not require the peer to authenticate itself<br \/>\nnoauth<\/p>\n<p># we want to see what happen<br \/>\nnodetach<\/p>\n<p># lock the device<br \/>\nlock<\/p>\n<p># Dont use BSD compression<br \/>\nnobsdcomp<\/p>\n<p># Use deflate method<br \/>\ndeflate 9,15<\/p>\n<p># set defaultroute<br \/>\ndefaultroute<br \/>\nreplacedefaultroute<\/p>\n<p># disable Microsoft Point-to-Point Compression (MPPC) (i.e. for compatibility with watchguard firebox)<br \/>\nnopcomp<\/p><\/blockquote>\n<p>4) \u043f\u043e\u0445\u043e\u0434\u0443, \u043d\u0443\u0436\u043d\u043e \u0441\u0432\u043e\u0435\u0433\u043e \u044e\u0437\u0435\u0440\u0430 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u0433\u0440\u0443\u043f\u043f\u0443 dip \u043d\u043e \u043d\u0435 \u0443\u0432\u0435\u0440\u0435\u043d \u0442\u043e\u0447\u043d\u043e<\/p>\n<p>5) \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u044b.<br \/>\n\u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0444\u0430\u0439\u043b \/etc\/ppp\/ip-up \u0438 \u0432 \u043a\u043e\u043d\u0435\u0446 \u044d\u0442\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 \u0434\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440<\/p>\n<p>[codesyntax lang=&#8221;bash&#8221;]#\u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u044b&#8230;<br \/>\niface=`ifconfig |grep eth |awk &#8216;BEGIN {FS=&quot;[ ]&quot;} {print $1}&#8217;`<br \/>\nnet=`ifconfig $iface|grep inet|awk &#8216;BEGIN {FS=&quot;[.]&quot;} {print $3}&#8217;`<br \/>\nhost=`ifconfig $iface|grep inet|awk &#8216;BEGIN {FS=&quot;[.]&quot;}{print $4}&#8217;|awk &#8216;BEGIN {FS=&quot;[ ]&quot;}{print $1}&#8217;`<br \/>\nif [ $host -lt 129 ]; then<br \/>\ngway=1; else<br \/>\ngway=129<br \/>\nfi<br \/>\nsudo route add -net 192.168.0.0 netmask 255.255.0.0 gw 192.168.$net.$gway<br \/>\nsudo route add -net 172.16.15.0 netmask 255.255.255.0 gw 192.168.$net.$gway<br \/>\nsudo route add -net 172.30.4.0 &lt;strong&gt;netmask 255.255.248.0&lt;\/strong&gt; gw 192.168.$net.$gway[\/codesyntax]<\/p>\n<p>5) \u0441\u0442\u0430\u0440\u0442\u0443\u0435\u043c \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439<\/p>\n<p>[codesyntax lang=&#8221;bash&#8221;]sudo pon aprikonax[\/codesyntax]<\/p>\n<p>\u0432\u044b\u0432\u043e\u0434 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a\u0438\u043c:<\/p>\n<blockquote><p>$ sudo pon aprikonax<br \/>\nUsing interface ppp0<br \/>\nConnect: ppp0 &lt;&#8211;&gt; \/dev\/pts\/2<br \/>\nCHAP authentication succeeded<br \/>\nCCP terminated by peer<br \/>\nCompression disabled by peer.<br \/>\nreplacing old default route to eth0 [192.168.35.1]<br \/>\nCannot determine ethernet address for proxy ARP<br \/>\nlocal\u00a0 IP address 10.12.7.206<br \/>\nremote IP address 10.12.254.101<\/p><\/blockquote>\n<p>\u0442.\u0435. \u0433\u043b\u0430\u0432\u043d\u043e\u0435 &#8211; \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u0441\u0442\u0440\u043e\u0447\u043a\u0430 remote IP address 10.12.254.101 \u0438\u043b\u0438 \u043f\u043e\u0445\u043e\u0436\u0430\u044f. \u0415\u0441\u043b\u0438 \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u0437\u0430\u043a\u044b\u0442\u044c &#8211; \u0443\u043f\u0430\u0434\u0435\u0442 \u0438 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435. \u0427\u0442\u043e\u0431\u044b \u044d\u0442\u043e\u0433\u043e \u043d\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u043b\u043e, \u043d\u0443\u0436\u043d\u043e \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0432\u0430\u0442\u044c \u0432\u043c\u0435\u0441\u0442\u043e pon aprikonax \u0442\u0430\u043a:<\/p>\n<p>[codesyntax lang=&#8221;bash&#8221;]pon aprikonax &amp;amp;[\/codesyntax]<\/p>\n<p>6) \u0447\u0442\u043e\u0431\u044b \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442 \u043a\u043e\u043c\u0430\u043d\u0434\u0443\u0435\u0448\u044c<\/p>\n<p>[codesyntax lang=&#8221;bash&#8221;]poff aprikonax[\/codesyntax]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0411\u044b\u0441\u0442\u0440\u0435\u043d\u044c\u043a\u043e \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c VPN \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0432 \u043e\u0431\u0449\u0430\u0433\u0435 \u0420\u0425\u0422\u0423 \u0432 Ubuntu \u0417\u0430\u043c\u0435\u0442\u043a\u0430 \u0431\u043e\u043b\u044c\u0448\u0435 \u0434\u043b\u044f \u0441\u0435\u0431\u044f, \u0447\u0442\u043e\u0431 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0447\u0435\u0433\u043e \u0431\u044b\u0441\u0442\u0440\u043e \u0432\u0441\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c, \u043d\u0435 \u0437\u043d\u0430\u044e \u043a\u0430\u043a \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f \u0434\u0440\u0443\u0433\u0438\u0445 \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432\u043e\u0432 \u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u043e\u0432.. \u0423 \u043d\u0430\u0441 \u0432 \u043e\u0431\u0449\u0430\u0433\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u043e\u0440\u043c<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[181],"tags":[246,6,94],"class_list":["post-216","post","type-post","status-publish","format-standard","hentry","category-linux-desktop","tag-linux","tag-ubuntu","tag-vpn"],"_links":{"self":[{"href":"https:\/\/seriyps.com\/blog\/wp-json\/wp\/v2\/posts\/216","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/seriyps.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/seriyps.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/seriyps.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/seriyps.com\/blog\/wp-json\/wp\/v2\/comments?post=216"}],"version-history":[{"count":9,"href":"https:\/\/seriyps.com\/blog\/wp-json\/wp\/v2\/posts\/216\/revisions"}],"predecessor-version":[{"id":218,"href":"https:\/\/seriyps.com\/blog\/wp-json\/wp\/v2\/posts\/216\/revisions\/218"}],"wp:attachment":[{"href":"https:\/\/seriyps.com\/blog\/wp-json\/wp\/v2\/media?parent=216"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/seriyps.com\/blog\/wp-json\/wp\/v2\/categories?post=216"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/seriyps.com\/blog\/wp-json\/wp\/v2\/tags?post=216"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}