{"id":3139,"date":"2018-02-16T12:31:01","date_gmt":"2018-02-16T04:31:01","guid":{"rendered":"http:\/\/cn.hostease.com\/xueyuan\/?p=3139"},"modified":"2018-02-16T12:31:01","modified_gmt":"2018-02-16T04:31:01","slug":"centos-7-3%e6%90%ad%e5%bb%baxl2tp%e6%9c%8d%e5%8a%a1%e5%99%a8","status":"publish","type":"post","link":"https:\/\/cn.hostease.com\/xueyuan\/hemanual\/centos-7-3%e6%90%ad%e5%bb%baxl2tp%e6%9c%8d%e5%8a%a1%e5%99%a8\/","title":{"rendered":"CentOS 7.3\u642d\u5efaxl2tp\u670d\u52a1\u5668"},"content":{"rendered":"<p>1.\u4e0b\u8f7dxl2tpd.tar.gz\u6e90\u7801\u5305<\/p>\n<p>&#8220;`<br \/>\nwget https:\/\/pkgs.fedoraproject.org\/repo\/pkgs\/xl2tpd\/xl2tpd-1.3.8.tar.gz\/d244fdcd88f64601b64b7302870afca8\/xl2tpd-1.3.8.tar.gz<br \/>\n&#8220;`<\/p>\n<p>&nbsp;<\/p>\n<p>## 2.\u5b89\u88c5xl2tpd\u548clibreswan<\/p>\n<p>&#8220;`<br \/>\ntar -zxvf xl2tpd-1.3.8.tar.gz<br \/>\ncd xl2tpd-1.3.8<br \/>\nmake &amp;&amp; make install<br \/>\n\u5982\u679cmake\u8fc7\u7a0b\u4e2d\u51fa\u73b0&#8221;contrib\/pfc.c:14:23: \u81f4\u547d\u9519\u8bef:pcap-bpf.h:\u6ca1\u6709\u90a3\u4e2a\u6587\u4ef6\u6216\u76ee\u5f55&#8221;\u5219\u5b89\u88c5libpcap<br \/>\nyum -y install libpcap-devel<br \/>\n&#8220;`<\/p>\n<p>## 3.\u914d\u7f6exl2tpd.conf\u914d\u7f6e\u6587\u4ef6<\/p>\n<p>`vim \/etc\/xl2tpd\/xl2tpd.conf`<\/p>\n<p>\u4fee\u6539\u5185\u5bb9\u5982\u4e0b\uff1a<\/p>\n<p>&#8220;`<br \/>\n[global]<br \/>\n[lns default]<br \/>\nip range = 172.100.1.100-172.100.1.150<br \/>\nlocal ip = 172.100.1.1<br \/>\nrequire chap = yes<br \/>\nrefuse pap = yes<br \/>\nrequire authentication = yes<br \/>\nname = LinuxVPNserver<br \/>\nppp debug = yes<br \/>\npppoptfile = \/etc\/ppp\/options.xl2tpd<br \/>\nlength bit = yes<br \/>\n&#8220;`<\/p>\n<p>## 4.\u914d\u7f6epppd\u9009\u9879\u53c2\u6570<\/p>\n<p>`vim \/etc\/ppp\/options.xl2tpd`<\/p>\n<p>\u4fee\u6539\u5185\u5bb9\u5982\u4e0b\uff1a<\/p>\n<p>&#8220;`<br \/>\nipcp-accept-local<br \/>\nipcp-accept-remote<br \/>\nms-dns 8.8.8.8<br \/>\nms-dns 209.244.0.3<br \/>\nms-dns 208.67.222.222<br \/>\nname xl2tpd<br \/>\n#noccp<br \/>\nauth<br \/>\ncrtscts<br \/>\nidle 1800<br \/>\nmtu 1410 #\u7b2c\u4e00\u6b21\u914d\u7f6e\u4e0d\u5efa\u8bae\u8bbe\u7f6emtu\uff0cmru\uff0c\u5426\u5219\u53ef\u80fd789\u9519\u8bef(\u8d34\u914d\u7f6e\u65f6\u53bb\u6389\u6ce8\u91ca\u4fe1\u606f)<br \/>\nmru 1410<br \/>\nnodefaultroute<br \/>\ndebug<br \/>\nlock<br \/>\nproxyarp<br \/>\nconnect-delay 5000<br \/>\nrefuse-pap<br \/>\nrefuse-chap<br \/>\nrefuse-mschap<br \/>\nrequire-mschap-v2<br \/>\npersist<br \/>\nlogfile \/var\/log\/xl2tpd.log<br \/>\n&#8220;`<\/p>\n<p>## 5.\u8bbe\u7f6el2tp\u62e8\u53f7\u7528\u6237\u540d\u5bc6\u7801<\/p>\n<p>&#8220;`<br \/>\nvim \/etc\/ppp\/chap-secrets`<\/p>\n<p>\u4fee\u6539\u5185\u5bb9\uff1a<br \/>\nvpnuser * pass *<br \/>\n\u8bf4\u660e\uff1a\u7528\u6237\u540d[\u7a7a\u683c]service[\u7a7a\u683c]\u5bc6\u7801[\u7a7a\u683c]\u6307\u5b9aIP<br \/>\n&#8220;`<\/p>\n<p>## 6.\u542f\u52a8xl2tpd<\/p>\n<p>&#8220;`<br \/>\n\/sbin\/chkconfig xl2tpd on<br \/>\nsystemctl enable xl2tpd<br \/>\nsystemctl restart xl2tpd<br \/>\n&#8220;`<\/p>\n<p>## 7.\u4f7f\u7528win7\u5ba2\u6237\u7aef\u8fdb\u884c\u62e8\u53f7<\/p>\n<p>[Win7\u62e8\u53f7\u62a5\u9519] (https:\/\/shipengliang.com\/software-exp\/win7-l2tpipsec-%E8%AE%BF%E9%97%AE%E7%BD%91%E7%AB%99%E8%BF%9E%E6%8E%A5%E8%A2%AB%E9%87%8D%E7%BD%AE%E7%9A%84%E8%A7%A3%E5%86%B3%E5%8A%9E%E6%B3%95.html)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1.\u4e0b\u8f7dxl2tpd.tar.gz\u6e90\u7801\u5305 &#8220;` wget https:\/\/pkgs.fedorap &#8230; <a title=\"CentOS 7.3\u642d\u5efaxl2tp\u670d\u52a1\u5668\" class=\"read-more\" href=\"https:\/\/cn.hostease.com\/xueyuan\/hemanual\/centos-7-3%e6%90%ad%e5%bb%baxl2tp%e6%9c%8d%e5%8a%a1%e5%99%a8\/\" aria-label=\"\u9605\u8bfb CentOS 7.3\u642d\u5efaxl2tp\u670d\u52a1\u5668\">\u9605\u8bfb\u66f4\u591a<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[3,49,5],"tags":[823],"class_list":["post-3139","post","type-post","status-publish","format-standard","hentry","category-hemanual","category-linux","category-jishu","tag-centos-7-3xl2tp"],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack-related-posts":[],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/posts\/3139","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/comments?post=3139"}],"version-history":[{"count":1,"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/posts\/3139\/revisions"}],"predecessor-version":[{"id":3140,"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/posts\/3139\/revisions\/3140"}],"wp:attachment":[{"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/media?parent=3139"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/categories?post=3139"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/tags?post=3139"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}