{"id":1658,"date":"2011-01-12T09:12:00","date_gmt":"2011-01-12T01:12:00","guid":{"rendered":"https:\/\/www.zuola.com\/weblog\/?p=1658"},"modified":"2011-01-12T05:18:36","modified_gmt":"2011-01-11T21:18:36","slug":"pptp-l2tp-vpn-setup","status":"publish","type":"post","link":"https:\/\/www.zuola.com\/weblog\/2011\/01\/1658.htm","title":{"rendered":"\u5982\u4f55\u5728 Debian \/ Ubuntu \u670d\u52a1\u5668\u4e0a\u67b6\u8bbePPTP \/ L2TP \/ IPSec VPN"},"content":{"rendered":"<p><b><big>\u7b2c\u4e00\u90e8\u5206\uff1a\u5982\u4f55\u7528 Debian \/ Ubuntu \u670d\u52a1\u5668\u4e0a\u67b6\u8bbe PPTP VPN\u670d\u52a1\u5668<\/big><\/b><\/p>\n<p>\u5982\u679c\u4f60\u6709\u4e00\u53f0linux\u4e3b\u673a\uff0c\u901a\u8fc7<a href=\"http:\/\/www.chiark.greenend.org.uk\/%7Esgtatham\/putty\/download.html\">putty.exe<\/a> \u6216\u82f9\u679c\u7535\u8111\u7684teminal\u7528SSH\u767b\u5f55\u5230\u4e3b\u673a\u540e\u8981\u7528\u6587\u672c\u7f16\u8f91\u5668\uff0c\u82e5\u662f\u4e0a\u4f20\u4e0b\u8f7d\u7f16\u8f91\u597d\u7684\u914d\u7f6e\u6587\u4ef6\u5c31\u592a\u9ebb\u70e6\u4e86\u3002 \u6211\u5148\u7b80\u5355\u4ecb\u7ecd\u4e00\u4e0bVI\u7f16\u8f91\u5668\u7684\u7528\u6cd5\uff0c\u5b66\u4f1aVI\u4e86\u5c31\u4e0d\u4e14\u4e0a\u4f20\u4e0b\u8f7d\u7f16\u8f91\u597d\u7684\u914d\u7f6e\u6587\u4ef6\u4e86\uff1a<\/p>\n<blockquote><p><font color=\"#009900\">vi \/etc\/ilovezola.conf<\/font>  \u8fd9\u662f\u8fdb\u5165\u7f16\u8f91ilovezola.conf\u7684\u6a21\u5f0f\uff0c\u7136\u540ehjkl\u56db\u4e2a\u952e\u662f\u65b9\u5411\u952e\uff0c\u5206\u522b\u662f\u5de6\u4e0b\u4e0a\u53f3\uff0c\u6309\u5b57\u6bcdx\u53ef\u5220\u9664\u4e00\u4e2a\u5b57\u7b26\u3002\u6309a\u8fdb\u5165\u63d2\u5165\u6a21\u5f0f\uff0chjkl\u5c31\u4e0d\u80fd\u5f53\u65b9\u5411\u952e\u7528\u4e86\u3002\u9000\u51fa\u63d2\u5165\u6a21\u5f0f\u6309ESC\u952e\uff0c\u4fdd\u5b58\u6587\u4ef6\u8f93\u5165\u547d\u4ee4\u5192\u53f7\u52a0\u5b57\u6bcd:w  \u9000\u51fa\u8f93\u5165\u547d\u4ee4:q \u9000\u51fa\u5e76\u4fdd\u5b58\u5c31\u662f :wq<\/p><\/blockquote>\n<p>\u6709\u4e86\u8fd9\u4e9b\u57fa\u7840\u5c31\u53ef\u4ee5\u5b89\u88c5PPTP VPN\u670d\u52a1\u5668\u4e86\u3002\u4e0b\u9762<font color=\"#009900\">\u7eff\u8272\u7684\u5b57\u5c31<\/font>\u662f\u53ef\u4ee5\u590d\u5236\u5230\u547d\u4ee4\u884c\u91cc\u6267\u884c\u7684\uff0c<font color=\"#3333ff\">\u84dd\u8272\u7684\u5b57\u662f\u9700\u8981\u4f60\u5bf9\u6bd4\u6216\u590d\u5236\u5230\u6587\u4ef6\u4e2d\u7684<\/font>\uff0c\u61d2\u4eba\u529e\u4e8b\u6548\u7387\u9ad8\uff0c\u590d\u5236\u5427\uff0c\u4e0d\u4f1a\u9519\u7684\u3002<br \/>\u5148\u767b\u5f55\u4f60\u7684\u4e3b\u673a\uff1a<br \/><font color=\"#33cc00\">ssh root@fuckgfw.zuola.com<\/font><br \/><font color=\"#666666\"><\/font><font color=\"#009900\">vi \/etc\/apt\/sources.list<\/font><br \/>\u7136\u540e\u5220\u9664\u6240\u6709deb\u524d\u9762\u7684\uff03\u53f7 \uff0c\u4f60\u6309\u7167<a href=\"http:\/\/blog.cuoluo.net\/2009\/12\/install-pptp-vpn-in-linode-vps\/\">\u8fd9\u91cc<\/a>\u64cd\u4f5c\u5c31\u884c\uff0c\u6211\u76f4\u63a5\u5f15\u7528\uff0c\u8fd9\u4e0d\u7b97\u6284\u88ad\uff1a<\/p>\n<blockquote><p>\u63a5\u7740\u7528\u4e0b\u9762\u7684\u547d\u4ee4\u66f4\u65b0\u4f60\u7684\u8f6f\u4ef6\u5305\u6570\u636e\u5e93<br \/><font color=\"#009900\">apt-get update<\/font><br \/>\u73b0\u5728\u6211\u4eec\u53ef\u4ee5\u6b63\u5f0f\u5b89\u88c5VPN server\u4e86\u3002\u8fd9\u91cc\u6211\u4eec\u9009\u62e9pptp(vpn \u534f\u8bae\u7684\u4e00\u79cd),\u56e0\u4e3a\u7b80\u5355\uff0c\u4e00\u6761\u547d\u4ee4\u641e\u5b9a\u3002\u5269\u4e0b\u7684\u65e0\u975e\u662f\u4e00\u4e9b\u914d\u7f6e\u3002<br \/><font color=\"#006600\">apt-get install pptpd<\/font><br \/>pptpd\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u7f16\u8f91\u8fd9\u4e2a\u6587\u4ef6\uff0c<br \/><font color=\"#009900\">vi \/etc\/pptpd.conf<\/font><br \/>\u53bb\u6389\u4e0b\u9762\u4e24\u884c\u7684\u6ce8\u91ca\u6216\u8005\u76f4\u63a5\u6dfb\u52a0\u8fd9\u4e24\u884c(\u5728\u6587\u4ef6\u7684\u6700\u540e).\u8fd9\u4e00\u6b65\u662f\u914d\u7f6eip\u5730\u5740\u7684\u8303\u56f4\u3002<br \/><font color=\"#3333ff\">localip 192.168.0.1<br \/>remoteip 192.168.0.234-238,192.168.0.245<\/font><br \/>\u7136\u540e\u5728\u7f16\u8f91\u8fd9\u4e2a\u6587\u4ef6\uff0c<br \/><font color=\"#009900\">vi \/etc\/ppp\/chap-secrets<\/font><br \/>\u5728\u8fd9\u4e2a\u6587\u4ef6\u4e2d\u6dfb\u52a0vpn\u7528\u6237\uff0c\u6309\u7167\u4e0b\u9762\u7684\u683c\u5f0f,\u6bcf\u4e2a\u7528\u6237\u4e00\u884c\u3002<br \/><font color=\"#3333ff\">username pptpd password *<br \/>fuck * gfw *<br \/>zhoushuguang pptpd fuckgfw *<\/font><br \/>\u4e3a\u4e86\u8ba9\u4f60\u7684\u7528\u6237\u8fde\u4e0aVPN\u540e\u80fd\u591f\u6b63\u5e38\u5730\u89e3\u6790\u57df\u540d\uff0c\u6211\u4eec\u9700\u8981\u624b\u52a8\u8bbe\u7f6eDNS. <font color=\"#009900\">vi \/etc\/ppp\/options<\/font>\uff0c\u627e\u5230ms-dns\u8fd9\u4e00\u9879\uff0c\u8bbe\u7f6e\u4f60\u7684DNS.\u8fd9\u91cc\u6211\u63a8\u8350\u7684\u662fGoogle \u6700\u8fd1\u53d1\u5e03\u7684Public DNS,\u539f\u56e0\u662f\u56e0\u4e3a\u597d\u8bb0\u3002<br \/><font color=\"#3333ff\">ms-dns 8.8.8.8<br \/>ms-dns 8.8.4.4<\/font><br \/>vi \/etc\/sysctl.conf\u6587\u4ef6\uff0c\u627e\u5230&#8221;net.ipv4.ip_forward=1&#8243;\u8fd9\u4e00\u884c\uff0c\u53bb\u6389\u524d\u9762\u7684\u6ce8\u91ca\u3002<br \/><font color=\"#3333ff\">net.ipv4.ip_forward=1<\/font><br \/>\u8fd0\u884c\u4e0b\u9762\u7684\u547d\u4ee4\u8ba9\u914d\u7f6e\u751f\u6548\u3002<br \/><font color=\"#009900\">sysctl -p<\/font><br \/>\u91cd\u542fpptpd\u670d\u52a1<br \/><font color=\"#009900\">\/etc\/init.d\/pptpd restart<\/font><br \/>\u6700\u540e\u5f00\u542fiptables\u8f6c\u53d1<br \/><font color=\"#009900\">\/sbin\/iptables -t nat -A POSTROUTING -s 192.168.0.0\/24 -o eth0 -j MASQUERADE<\/font><br \/>ok,\u5b89\u88c5\u5b8c\u6bd5\u3002<\/p><\/blockquote>\n<p>\u9644\uff1a\u4f7f\u7528PPTP VPN\u7684\u65b9\u6cd5\uff1a<\/p>\n<ol>\n<li>\u5982\u4f55\u5728 Windows XP \u4e2d\u914d\u7f6e\u865a\u62df\u4e13\u7528\u7f51\u7edc (VPN) \u8fde\u63a5 <a href=\"http:\/\/support.microsoft.com\/kb\/314076\/zh-cn\">http:\/\/support.microsoft.com\/kb\/314076\/zh-cn<\/a><\/li>\n<li>How to configure a connection to a virtual private network (VPN) in Windows XP <a href=\"http:\/\/support.microsoft.com\/kb\/314076\/en\">http:\/\/support.microsoft.com\/kb\/314076\/en<\/a><\/li>\n<li>iOS\uff1a\u8bbe\u7f6e VPN <a href=\"http:\/\/support.apple.com\/kb\/HT1424?viewlocale=zh_CN\">http:\/\/support.apple.com\/kb\/HT1424?viewlocale=zh_CN<\/a><\/li>\n<li>iOS: Setting up VPN <a href=\"http:\/\/support.apple.com\/kb\/HT1424?viewlocale=en_US\">http:\/\/support.apple.com\/kb\/HT1424?viewlocale=en_US<\/a><\/li>\n<li>Mac OS X 10.6 Help \u5efa\u7acb\u4e00\u4e2a\u5230\u865a\u62df\u4e13\u7528\u7f51\u7edc\u7684\u8fde\u63a5<a href=\"http:\/\/docs.info.apple.com\/article.html?path=Mac\/10.6\/zh\/9010.html\">http:\/\/docs.info.apple.com\/article.html?path=Mac\/10.6\/zh\/9010.html<\/a><\/li>\n<li>\u8bbe\u5b9a\u9ad8\u7ea7 VPN \u9009\u9879 <a href=\"http:\/\/docs.info.apple.com\/article.html?path=Mac\/10.6\/zh\/11941.html\">http:\/\/docs.info.apple.com\/article.html?path=Mac\/10.6\/zh\/11941.html<\/a><\/li>\n<li>Ubuntu\u4e0b\u4f7f\u7528VPN <a href=\"http:\/\/wiki.ubuntu.org.cn\/%C3%A5%C2%A6%C2%82%C3%A4%C2%BD%C2%95%C3%A4%C2%BD%C2%BF%C3%A7%C2%94%C2%A8UbuntuVPN\">http:\/\/wiki.ubuntu.org.cn\/\u5982\u4f55\u4f7f\u7528UbuntuVPN<\/a><\/li>\n<li>Installing personalVPN-PPTP on Android Mobile Phone <a href=\"http:\/\/wiki.witopia.net\/wiki\/Installing_personalVPN-PPTP_on_Android_Mobile_Phone\">http:\/\/wiki.witopia.net\/wiki\/Installing_personalVPN-PPTP_on_Android_Mobile_Phone<\/a><\/li>\n<\/ol>\n<p><big><b>\u7b2c\u4e8c\u90e8\u5206\uff1a\u5982\u4f55\u7528 Debian \/ Ubuntu \u670d\u52a1\u5668\u5b89\u88c5\u6210L2TP \/ IPSec VPN \u670d\u52a1\u5668<\/b><\/big><\/p>\n<p>Ubuntu 10.04 LTS\uff08Lucid\uff09\u81ea\u5e26\u7684OpenSwan\u6709NAT\u7684BUG\u300210.10 openswan\u65e0\u6b64\u95ee\u9898\uff08\u4f46\u662f10.10\u7684xl2tpd\u6709\u95ee\u9898,\u4e0d\u5206\u914dIP,\u9700\u8981\u624b\u52a8\u6307\u5b9a,\u89e3\u51b3\u65b9\u6848\u89c1\u4e0b\u6587,\u672c\u6587\u90fd\u662f\u6307\u4f7f\u7528Ubuntu 10.04 LTS\uff09\u53ef\u4ee5\u4eceOpenSWAN\u4e0b\u8f7d\u6700\u65b0\u7248\u672c\uff082.6.24+\uff09\u624d\u53ef\u4ee5\u3002\u4e5f\u53ef\u4ee5\u4f7f\u7528\u975e\u5b98\u65b9PPA\u6e90<br \/><font color=\"#009900\">sudo apt-get install python-software-properties<br \/>sudo add-apt-repository ppa:openswan\/ppa<br \/>sudo apt-get update<\/font><br \/>\u7136\u540e\u67e5\u67e5\u770b\u662f\u5426\u662f\u5df2\u7ecf\u8ddf\u66f4\u65b0\u5230\u6700\u65b0<br \/><font color=\"#009900\">apt-cache policy openswan<\/font><br \/><font color=\"#3366ff\">openswan:<br \/>&nbsp; Installed: 1:2.6.23+dfsg-1ubuntu1<br \/>&nbsp; Candidate: 1:2.6.31-1xelerance1<br \/>&nbsp; Version table:<br \/>&nbsp;&nbsp;&nbsp;&nbsp; 1:2.6.31-1xelerance1 0<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 500 http:\/\/ppa.launchpad.net\/openswan\/ppa\/ubuntu\/ lucid\/main Packages<br \/>&nbsp;*** 1:2.6.23+dfsg-1ubuntu1 0<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 500 http:\/\/us.archive.ubuntu.com\/ubuntu\/ lucid\/universe Packages<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 100 \/var\/lib\/dpkg\/status<\/font><br \/>\u53ef\u89c1\u6e90\u91cc\u9762\u5df2\u7ecf\u83b7\u5f972.6.31+\u7684\u7248\u672c<br \/><font color=\"#009900\">apt-get install openswan<\/font>\u5c31\u53ef\u4ee5\u53ef\u4ee5\u5f00\u59cb\u914d\u7f6e\u4e86<br \/>\u5b89\u88c5\u7684\u65f6\u5019\u4e00\u5f8b\u56de\u8f66\u5373\u53ef<br \/>&nbsp;<font color=\"#009900\">vi \/etc\/ipsec.conf<\/font>\uff0c\u6539\u6210\u8fd9\u6837\uff1a<br \/><font color=\"#3333ff\">version 2.0<br \/>config setup<br \/>&nbsp;&nbsp;&nbsp; nat_traversal=yes<br \/>&nbsp;&nbsp;&nbsp; virtual_private=%v4:10.0.0.0\/8,%v4:192.168.0.0\/16,%v4:172.16.0.0\/12<br \/>&nbsp;&nbsp;&nbsp; oe=off<br \/>&nbsp;&nbsp;&nbsp; protostack=netkey<\/p>\n<p>conn L2TP-PSK-NAT<br \/>&nbsp;&nbsp;&nbsp; rightsubnet=vhost:%priv<br \/>&nbsp;&nbsp;&nbsp; also=L2TP-PSK-noNAT<\/p>\n<p>conn L2TP-PSK-noNAT<br \/>&nbsp;&nbsp;&nbsp; authby=secret<br \/>&nbsp;&nbsp;&nbsp; pfs=no<br \/>&nbsp;&nbsp;&nbsp; auto=add<br \/>&nbsp;&nbsp;&nbsp; keyingtries=3<br \/>&nbsp;&nbsp;&nbsp; rekey=no<br \/>&nbsp;&nbsp;&nbsp; ikelifetime=8h<br \/>&nbsp;&nbsp;&nbsp; keylife=1h<br \/>&nbsp;&nbsp;&nbsp; type=transport<br \/>&nbsp;&nbsp;&nbsp; left=<font color=\"#ff0000\">YOUR.SERVER.IP.ADDRESS<\/font><br \/>&nbsp;&nbsp;&nbsp; leftprotoport=17\/1701<br \/>&nbsp;&nbsp;&nbsp; right=%any<br \/>&nbsp;&nbsp;&nbsp; rightprotoport=17\/%any<\/font><br \/><font color=\"#009900\">vi \/etc\/ipsec.secrets<\/font>\uff0c\u6539\u6210\u8fd9\u6837\uff1a<br \/><font color=\"#3333ff\"><font color=\"#ff0000\">YOUR.SERVER.IP.ADDRESS<\/font>&nbsp;&nbsp; %any:&nbsp; PSK &#8220;zhimakaimen&#8221;<\/font><br \/>\uff08\u522b\u5fd8\u4e86\u628a\u7ea2\u8272\u7684\u300c<font color=\"#ff0000\">YOUR.SERVER.IP.ADDRESS<\/font>\u300d\u8fd9\u90e8\u5206\u6362\u6210\u4f60\u7684\u670d\u52a1\u5668\u7684 IP \u5730\u5740\uff0c\u628a\u300czhimakaimen\u300d\u90e8\u5206\u6362\u6210\u968f\u4fbf\u4e00\u4e2a\u5b57\u4e32\uff0c\u4f8b\u5982\u4f60\u559c\u6b22\u7684\u4e00\u53e5\u8bdd\u5982 ilovemoney\uff0c\u7b49\u7b49\u3002\uff09<\/p>\n<p>\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4,\u8fd9\u4e0b\u6709\u70b9\u590d\u6742\u4e86\uff0c\u524d\u9762\u7684\u77e5\u8bc6\u4e0d\u591f\u7528\u4e86\uff0c\u7ee7\u7eed\u8865\u8bfe\uff0c\u5148<br \/><font color=\"#009900\">vi run.sh<\/font><br \/>\u7136\u540e\u590d\u5236\u4e0b\u9762\u7684\u5185\u5bb9\u5230run.sh\u5e76\u4fdd\u5b58<br \/><font color=\"#3333ff\">for each in \/proc\/sys\/net\/ipv4\/conf\/*<br \/>do<br \/>&nbsp;&nbsp;&nbsp; echo 0 &gt; $each\/accept_redirects<br \/>&nbsp;&nbsp;&nbsp; echo 0 &gt; $each\/send_redirects<br \/>done<\/font><br \/>\u7136\u540e<br \/><font color=\"#009900\">.\/run.sh<\/font> \u8fd9\u6837\u5c31\u6267\u884c\u4e0a\u9762\u7684\u5faa\u73af\u547d\u4ee4\u4e86\u3002<br \/>\u68c0\u67e5\u4e00\u4e0b IPSec \u80fd\u5426\u6b63\u5e38\u5de5\u4f5c\uff1a<br \/><font color=\"#009900\">sudo ipsec verify<\/font><br \/>\u5982\u679c\u5728\u7ed3\u679c\u4e2d\u770b\u5230\u300cOpportunistic Encryption Support\u300d\u88ab\u7981\u7528\uff08disable\uff09\u4e86\uff0c\u6ca1\u5173\u7cfb\uff0c\u5176\u4ed6\u9879 OK \u5373\u53ef\u3002<\/p>\n<p>\u91cd\u542f openswan:<br \/><font color=\"#009900\">sudo \/etc\/init.d\/ipsec restart<\/font><br \/>\u5b89\u88c5 L2TP\u3002\u5e38\u7528\u7684 L2TP \u540e\u53f0\u8f6f\u4ef6\u5305\u662f xl2tpd\uff0c\u5b83\u548c openswan \u662f\u540c\u4e00\u5e2e\u4eba\u5199\u7684\u3002<br \/>\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<br \/><font color=\"#009900\">sudo aptitude install xl2tpd<\/font><br \/><font color=\"#009900\">vi \/etc\/xl2tpd\/xl2tpd.conf<\/font>\uff0c\u6539\u6210\u4e0b\u9762\u8fd9\u6837,\u6216\u590d\u5236\u8fdb\u53bb\u5c31\u597d\u4e86<br \/><font color=\"#3333ff\">[global]<br \/>ipsec saref = yes<\/p>\n<p>[lns default]<br \/>ip range = 10.1.2.2-10.1.2.255<br \/>local ip = 10.1.2.1<br \/>;require chap = yes<br \/>refuse chap = yes<br \/>refuse pap = yes<br \/>require authentication = yes<br \/>ppp debug = yes<br \/>pppoptfile = \/etc\/ppp\/options.xl2tpd<br \/>length bit = yes<\/font><br \/>\u8fd9\u91cc\u8981\u6ce8\u610f\u7684\u662f ip range \u4e00\u9879\u91cc\u7684 IP \u5730\u5740\u4e0d\u80fd\u548c\u4f60\u6b63\u5728\u7528\u7684 IP \u5730\u5740\u91cd\u5408\uff0c\u4e5f\u4e0d\u53ef\u4e0e\u7f51\u7edc\u4e0a\u7684\u5176\u4ed6 IP \u5730\u5740\u51b2\u7a81\u3002\u4f60\u7167\u6284\u5c31\u4e0d\u4f1a\u9519\u4e86\u3002<\/p>\n<p>\u5b89\u88c5 ppp\u3002\u8fd9\u662f\u7528\u6765\u7ba1\u7406 VPN \u7528\u6237\u7684\u3002<br \/><font color=\"#009900\">sudo aptitude install ppp<\/font><br \/>\u68c0\u67e5\u4e00\u4e0b \/etc\/ppp \u76ee\u5f55\u91cc\u6709\u6ca1\u6709 options.xl2tpd \u8fd9\u4e2a\u6587\u4ef6\uff0c\u6ca1\u6709\u7684\u8bdd\u5c31\u5efa\u4e00\u4e2a<br \/><font color=\"#009900\">vi <\/font><font color=\"#009900\">\/etc\/ppp\/options.xl2tpd<\/font><br \/>\u6587\u4ef6\u5185\u5bb9\u5982\u4e0b,\u628a\u4e0b\u9762\u7684\u5185\u5bb9\u590d\u5236\u8fdb\u6765 \uff1a<br \/><font color=\"#3333ff\">require-mschap-v2<br \/>ms-dns 208.67.222.222<br \/>ms-dns 208.67.220.220<br \/>asyncmap 0<br \/>auth<br \/>crtscts<br \/>lock<br \/>hide-password<br \/>modem<br \/>debug<br \/>name l2tpd<br \/>proxyarp<br \/>lcp-echo-interval 30<br \/>lcp-echo-failure 4<\/font><br \/>\u6ce8\u610f ms-dns \u4e24\u884c\u6211\u586b\u7684\u662f OpenDNS\u3002\u5982\u679c\u4f60\u60f3\u7528\u5176\u4ed6\u7684 DNS \u670d\u52a1\u5668\uff08\u4f8b\u5982\u8c37\u6b4c\u7684\u516c\u5171 DNS &nbsp;8.8.8.8 &nbsp; 8.8.4.4 &nbsp;\uff09\uff0c\u8bf7\u81ea\u884c\u66f4\u6362\u3002<br \/>\u73b0\u5728\u53ef\u4ee5\u6dfb\u52a0\u4e00\u4e2a VPN \u7528\u6237\u4e86\u3002\u7528\u6587\u5b57\u7f16\u8f91\u5668\u6253\u5f00chap-secrets \u6587\u4ef6<br \/><font color=\"#009900\">vi \/etc\/ppp\/chap-secrets<\/font><br \/><font color=\"#3333ff\"># user&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; server&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; password&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ip<br \/>test&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; l2tpd&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; testpassword&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *<br \/><\/font><font color=\"#3333ff\">fuck * gfw *<\/font><br \/>\u5982\u679c\u4f60\u4e4b\u524d\u8bbe\u7f6e\u8fc7 PPTP VPN\uff0cchap-secrets \u6587\u4ef6\u91cc\u53ef\u80fd\u5df2\u7ecf\u6709\u4e86\u5176\u4ed6\u7528\u6237\u7684\u5217\u8868\uff0c\u5982\u4e0a\u9762\u90a3\u4e2a\u5bc6\u7801\u4e3a<font color=\"#3333ff\">gfw<\/font>\u7684<font color=\"#3333ff\">fuck<\/font>\u7528\u6237\uff0c\u5c31\u65e2\u53ef\u767b\u5f55PPTP VPN,\u4e5f\u53ef\u4ee5\u767b\u5f55l2tp\u7684VPN\uff0c\u56e0\u4e3a\u4ed6\u7684server\u6ca1\u6709\u6307\u5b9a\u4e3al2tp\uff0c\u800c\u662f\u7528\u661f\u53f7\u4ee3\u66ff\u4e86\u3002\u4f60\u53ea\u8981\u628a&nbsp;&nbsp;&nbsp; test l2tpd testpassword * \u8fd9\u6837\u52a0\u5230\u540e\u9762\u5373\u53ef\u3002\u8bb0\u5f97\u8981\u6709\u7a7a\u683c\u3002<\/p>\n<p>\u91cd\u542f xl2tpd<br \/><font color=\"#009900\">sudo \/etc\/init.d\/xl2tpd restart<\/font><br \/>\u8bbe\u7f6e iptables \u7684\u6570\u636e\u5305\u8f6c\u53d1\uff0c\u4e0b\u9762\u662f\u4e24\u884c\u547d\u4ee4\u54e6\uff1a<br \/><font color=\"#009900\">iptables &#8211;table nat &#8211;append POSTROUTING &#8211;jump MASQUERADE<\/font><br \/><font color=\"#009900\">echo 1 &gt; \/proc\/sys\/net\/ipv4\/ip_forward<\/font><br \/>\u56e0\u4e3a\u67d0\u79cd\u539f\u56e0\uff0copenswan \u5728\u670d\u52a1\u5668\u91cd\u542f\u540e\u65e0\u6cd5\u6b63\u5e38\u81ea\u52a8\uff0c\u6240\u4ee5\u6211\u4eec\u53ef\u4ee5\u5728 \/etc\/rc.local \u6587\u4ef6\u91cc\u5199\u5165\u5982\u4e0b\u8bed\u53e5\uff1a<br \/><font color=\"#009900\">vi \/etc\/rc.local<\/font><br \/><font color=\"#3333ff\">iptables &#8211;table nat &#8211;append POSTROUTING &#8211;jump MASQUERADE<br \/>echo 1 &gt; \/proc\/sys\/net\/ipv4\/ip_forward<br \/>for each in \/proc\/sys\/net\/ipv4\/conf\/*<br \/>do<br \/>&nbsp;&nbsp;&nbsp; echo 0 &gt; $each\/accept_redirects<br \/>&nbsp;&nbsp;&nbsp; echo 0 &gt; $each\/send_redirects<br \/>done<br \/>\/etc\/init.d\/ipsec restart<\/font><br \/>\u5230\u8fd9\u91cc\uff0c\u8bbe\u7f6e\u5de5\u4f5c\u5df2\u7ecf\u57fa\u672c\u5b8c\u6210\u3002\u4f60\u53ef\u4ee5\u7528 iPhone \u6216 iPad \u8bd5\u7740\u8fde\u4e00\u4e0b\u3002\u8bb0\u5f97\u5728\u300cSecret\u300d\u4e2d\u586b\u5165\u4f60\u5728\u4e0a\u8ff0\u7b2c\u4e09\u6b65\u91cc\u586b\u7684 <font color=\"#3333ff\">zhimakaimen<\/font>\u3002<\/p>\n<p>\u5982\u679c\u8fde\u63a5\u6210\u529f\uff0c\u4e0a\u7f51\u4e5f\u6ca1\u95ee\u9898\u7684\u8bdd\uff0c\u606d\u559c\u4f60\uff0c\u5927\u529f\u544a\u6210\u3002\u6211\u5c31\u662f\u8fd9\u4e48\u5728linode\u7684Ubuntu 10.04 LTS\u4e0a\u641e\u5b9aVPN\u7684\uff0c\u6211\u4e4b\u524d\u8d70\u4e86\u4e9b\u5f2f\u8def\u662f\u56e0\u4e3a<font color=\"#3366ff\">openswan<\/font>\u6ca1\u5b89\u88c5\u5230\u6700\u65b0\u7248\uff0cApple4.us\u7684\u6587\u7ae0\u63d0\u4f9b\u7684\u5b89\u88c5\u65b9\u6cd5\u5931\u8d25\uff0c\u8fd8\u597d\u6709<a href=\"http:\/\/ihipop.info\/2010\/12\/1906.html\">\u53e6\u4e00\u7bc7\u6587\u7ae0<\/a>\u63d0\u4f9b\u4e86\u5b89\u88c5<font color=\"#3366ff\">openswan<\/font>\u5230\u6700\u65b0\u7248\u7684\u65b9\u6cd5\u3002\u6240\u4ee5\u5408\u5e76\u7ecf\u9a8c\uff0c\u8ba9\u5176\u4ed6\u4eba\u5c11\u8d70\u5f2f\u8def\uff0c\u53ef\u4ee5\u8282\u7ea6\u5b66\u4e60\u7684\u65f6\u95f4\u54e6\u3002<\/p>\n<p>L2TP\u7684VPN\u7684\u4f7f\u7528\u65b9\u6cd5\uff1a<\/p>\n<ol>\n<li>\u82f9\u679c\u7535\u8111\u4e0a\u4f7f\u7528l2tp VPN <a href=\"http:\/\/support.apple.com\/kb\/HT1288?viewlocale=zh_CN\">http:\/\/support.apple.com\/kb\/HT1288?viewlocale=zh_CN<\/a><\/li>\n<\/ol>\n<p>\u6211\u53c2\u8003\u4e86\u4ee5\u4e0b\u6587\u732e\uff0c\u7efc\u5408\u4e86\u4e00\u4e0b\uff0c\u5199\u51fa\u4ee5\u4e0a\u4fee\u6b63\u7248\uff0c\u7531\u4e8e Apple4.us \u4fdd\u7559\u4e00\u5207\u6743\u5229\uff0c\u6240\u4ee5\u6211\u7b49\u4ed6\u4eec\u901a\u77e5\u6211\u5220\u9664\u8fd9\u7bc7\u6d3e\u751f\u7684\u6587\u7ae0\u5427\uff0c\u56e0\u4e3a\u4ed6\u4eec\u4ecd\u7136\u4fdd\u7559\u8ba9\u6211\u6d3e\u751f\u7684\u6743\u5229\uff0c\u4e5f\u4fdd\u7559\u4e0d\u8ba9\u6211\u57fa\u4e8e\u4ed6\u4eec\u7684\u6587\u7ae0\u6d3e\u751f\u4f5c\u54c1\u7684\u6743\u5229\u3002<\/p>\n<ol>\n<li>\u5728Linode VPS\u4e0a\u5b89\u88c5pptp VPN<a href=\"http:\/\/blog.cuoluo.net\/2009\/12\/install-pptp-vpn-in-linode-vps\/\"><br \/>http:\/\/blog.cuoluo.net\/2009\/12\/install-pptp-vpn-in-linode-vps\/<\/a><\/li>\n<li>\u5982\u4f55\u5728 Debian \/ Ubuntu \u670d\u52a1\u5668\u4e0a\u67b6\u8bbe L2TP \/ IPSec VPN<a href=\"https:\/\/apple4.us\/2010\/05\/setting-up-l2tp-vpn-on-debian-ubuntu.html\"><br \/>https:\/\/apple4.us\/2010\/05\/setting-up-l2tp-vpn-on-debian-ubuntu.html<\/a><\/li>\n<li>L2TP Over IPSec On Ubuntu(Debian,CentOS) With OpenSwan<a href=\"http:\/\/ihipop.info\/wap\/index-wap2.php?p=1906\"><br \/><\/a><a href=\"http:\/\/ihipop.info\/2010\/12\/1906.html\">http:\/\/ihipop.info\/2010\/12\/1906.html<\/a><\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>\u7b2c\u4e00\u90e8\u5206\uff1a\u5982\u4f55\u7528 Debian \/ Ubuntu \u670d\u52a1\u5668\u4e0a\u67b6\u8bbe PPTP VPN <span class=\"readmore\"><a href=\"https:\/\/www.zuola.com\/weblog\/2011\/01\/1658.htm\">Continue Reading &#8230;<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-1658","post","type-post","status-publish","format-standard","hentry","category-review"],"views":17722,"_links":{"self":[{"href":"https:\/\/www.zuola.com\/weblog\/wp-json\/wp\/v2\/posts\/1658","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.zuola.com\/weblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.zuola.com\/weblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.zuola.com\/weblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.zuola.com\/weblog\/wp-json\/wp\/v2\/comments?post=1658"}],"version-history":[{"count":0,"href":"https:\/\/www.zuola.com\/weblog\/wp-json\/wp\/v2\/posts\/1658\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.zuola.com\/weblog\/wp-json\/wp\/v2\/media?parent=1658"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.zuola.com\/weblog\/wp-json\/wp\/v2\/categories?post=1658"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.zuola.com\/weblog\/wp-json\/wp\/v2\/tags?post=1658"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}