{"id":61,"date":"2020-03-07T19:09:23","date_gmt":"2020-03-07T11:09:23","guid":{"rendered":""},"modified":"2024-03-19T21:58:57","modified_gmt":"2024-03-19T13:58:57","slug":"centos-6%e3%80%817%e4%b8%8bpptp-vpn%e4%b8%80%e9%94%ae%e5%ae%89%e8%a3%85%e8%84%9a%e6%9c%ac","status":"publish","type":"post","link":"https:\/\/www.fatesky.com\/?p=61","title":{"rendered":"CentOS 6\u30017\u4e0bpptp vpn\u4e00\u952e\u5b89\u88c5\u811a\u672c"},"content":{"rendered":"<p style=\"box-sizing: inherit; border: 0px; font-family: &quot;Microsoft YaHei&quot;, Helvetica, Arial, &quot;Lucida Grande&quot;, Tahoma, sans-serif; font-size: 16px; margin-top: 0px; margin-bottom: 12px; padding: 0px; vertical-align: baseline; overflow-wrap: break-word; text-indent: 2em; white-space: normal; background-color: rgb(255, 255, 255);\"><a href=\"https:\/\/linuxeye.com\/tag\/CentOS\" target=\"_blank\" style=\"box-sizing: inherit; border: 0px; font-family: inherit; font-style: inherit; margin: 0px; padding: 0px; vertical-align: baseline; color: rgb(54, 144, 207); text-decoration-line: none; -webkit-tap-highlight-color: rgba(255, 0, 0, 0);\" rel=\"noopener noreferrer\">CentOS<\/a>&nbsp;6\u30017\u4e0bpptp vpn\u4e00\u952e\u5b89\u88c5\u811a\u672c\uff0c\u5b89\u88c5\u5982\u4e0b\uff1a<\/p>\n<div class=\"dp-highlighter\" style=\"box-sizing: inherit; border: 1px dashed rgb(204, 204, 204); font-family: &quot;Microsoft YaHei&quot;, Helvetica, Arial, &quot;Lucida Grande&quot;, Tahoma, sans-serif; font-size: 1.5rem; margin: 10px auto; padding: 5px; vertical-align: baseline; background: rgb(255, 255, 255); width: 717.953px; word-break: break-all; white-space: normal; overflow: auto;\">\n<ol class=\"dp-py list-paddingleft-2\" start=\"1\" style=\"list-style-type: none;\">\n<li>\n<p>wget&nbsp;http:\/\/mirrors.linuxeye.com\/scripts\/vpn_centos.sh<\/p>\n<\/li>\n<li>\n<p>chmod&nbsp;+x&nbsp;.\/vpn_centos.sh<\/p>\n<\/li>\n<li>\n<p>.\/vpn_centos.sh<\/p>\n<\/li>\n<\/ol>\n<\/div>\n<div align=\"center\" style=\"box-sizing: inherit; border: 0px; font-family: &quot;Microsoft YaHei&quot;, Helvetica, Arial, &quot;Lucida Grande&quot;, Tahoma, sans-serif; font-size: 16px; margin: 0px; padding: 0px; vertical-align: baseline; white-space: normal; background-color: rgb(255, 255, 255);\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/www.fatesky.com\/wp-content\/uploads\/2020\/02\/202002201582199926219776.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" title=\"pptp_install.png\" data-original=\"https:\/\/www.fatesky.com\/wp-content\/uploads\/2020\/02\/202002201582199926219776.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"pptp_install.png\" style=\"box-sizing: inherit; border: 0px; font-family: inherit; font-style: inherit; margin: 0px; padding: 0px; vertical-align: middle; max-width: 100%; height: auto; display: block; border-radius: 2px;\"\/><\/div><\/div>\n<p style=\"box-sizing: inherit; border: 0px; font-family: &quot;Microsoft YaHei&quot;, Helvetica, Arial, &quot;Lucida Grande&quot;, Tahoma, sans-serif; font-size: 16px; margin-top: 0px; margin-bottom: 12px; padding: 0px; vertical-align: baseline; overflow-wrap: break-word; text-indent: 2em; white-space: normal; background-color: rgb(255, 255, 255);\">\u811a\u672c\u5185\u5bb9\u5982\u4e0b\uff08<a rel=\"external nofollow noopener noreferrer\" target=\"_blank\" href=\"https:\/\/linuxeye.com\/wp-content\/themes\/begin\/go.php?url=aHR0cDovL21pcnJvcnMubGludXhleWUuY29tL3NjcmlwdHMvdnBuX2NlbnRvcy5zaA==\" style=\"box-sizing: inherit; border: 0px; font-family: inherit; font-style: inherit; margin: 0px; padding: 0px; vertical-align: baseline; color: rgb(54, 144, 207); text-decoration-line: none; -webkit-tap-highlight-color: rgba(255, 0, 0, 0);\">vpn_centos.sh<\/a>\uff09\uff1a<\/p>\n<div class=\"dp-highlighter\" style=\"box-sizing: inherit; border: 1px dashed rgb(204, 204, 204); font-family: &quot;Microsoft YaHei&quot;, Helvetica, Arial, &quot;Lucida Grande&quot;, Tahoma, sans-serif; font-size: 1.5rem; margin: 10px auto; padding: 5px; vertical-align: baseline; background: rgb(255, 255, 255); width: 717.953px; word-break: break-all; white-space: normal; overflow: auto;\">\n<ol class=\"dp-xml list-paddingleft-2\" start=\"1\" style=\"list-style-type: none;\">\n<li>\n<p>#!\/bin\/bash<\/p>\n<\/li>\n<li>\n<p>#<\/p>\n<\/li>\n<li>\n<p>#&nbsp;Author:&nbsp;&nbsp;yeho&nbsp;<span class=\"tag\" style=\"box-sizing: inherit; border: 0px; font-family: inherit; font-style: inherit; margin: 0px; padding: 0px; vertical-align: baseline; color: blue; font-weight: bold;\">&lt;<\/span><span class=\"tag-name\" style=\"box-sizing: inherit; border: 0px; font-family: inherit; font-style: inherit; margin: 0px; padding: 0px; vertical-align: baseline; color: #7F0055; font-weight: bold;\">lj2007331<\/span>&nbsp;AT&nbsp;gmail.com<span class=\"tag\" style=\"box-sizing: inherit; border: 0px; font-family: inherit; font-style: inherit; margin: 0px; padding: 0px; vertical-align: baseline; color: blue; font-weight: bold;\">&gt;<\/span><\/p>\n<\/li>\n<li>\n<p>#&nbsp;Blog:&nbsp;&nbsp;\/\/linuxeye.com<\/p>\n<\/li>\n<li>\n<p>#<\/p>\n<\/li>\n<li>\n<p>#&nbsp;Installs&nbsp;a&nbsp;PPTP&nbsp;VPN-only&nbsp;system&nbsp;for&nbsp;CentOS<\/p>\n<\/li>\n<li>\n<p><\/p>\n<\/li>\n<li>\n<p>#&nbsp;Check&nbsp;if&nbsp;user&nbsp;is&nbsp;root<\/p>\n<\/li>\n<li>\n<p>[&nbsp;$(id&nbsp;-u)&nbsp;!=&nbsp;&quot;0&quot;&nbsp;]&nbsp;&amp;&amp;&nbsp;{&nbsp;echo&nbsp;-e&nbsp;&quot;\\033[31mError:&nbsp;You&nbsp;must&nbsp;be&nbsp;root&nbsp;to&nbsp;run&nbsp;this&nbsp;script\\033[0m&quot;;&nbsp;exit&nbsp;1;&nbsp;}<\/p>\n<\/li>\n<li>\n<p><\/p>\n<\/li>\n<li>\n<p>export&nbsp;<span class=\"attribute\" style=\"box-sizing: inherit; border: 0px; font-family: inherit; font-style: inherit; margin: 0px; padding: 0px; vertical-align: baseline; color: red;\">PATH<\/span>=\/usr\/local\/sbin:\/usr\/local\/bin:\/sbin:\/bin:\/usr\/sbin:\/usr\/bin<\/p>\n<\/li>\n<li>\n<p>clear<\/p>\n<\/li>\n<li>\n<p>printf&nbsp;&quot;<\/p>\n<\/li>\n<li>\n<p>#######################################################################<\/p>\n<\/li>\n<li>\n<p>#&nbsp;&nbsp;&nbsp;&nbsp;LNMP\/LAMP\/LANMP&nbsp;for&nbsp;CentOS\/RadHat&nbsp;5+&nbsp;Debian&nbsp;6+&nbsp;and&nbsp;Ubuntu&nbsp;12+&nbsp;&nbsp;&nbsp;&nbsp;#<\/p>\n<\/li>\n<li>\n<p>#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Installs&nbsp;a&nbsp;PPTP&nbsp;VPN-only&nbsp;system&nbsp;for&nbsp;CentOS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#<\/p>\n<\/li>\n<li>\n<p>#&nbsp;For&nbsp;more&nbsp;information&nbsp;please&nbsp;visit&nbsp;\/\/linuxeye.com\/31.html&nbsp;&nbsp;#<\/p>\n<\/li>\n<li>\n<p>#######################################################################<\/p>\n<\/li>\n<li>\n<p>&quot;<\/p>\n<\/li>\n<li>\n<p><\/p>\n<\/li>\n<li>\n<p>[&nbsp;!&nbsp;-e&nbsp;&#39;\/usr\/bin\/curl&#39;&nbsp;]&nbsp;&amp;&amp;&nbsp;yum&nbsp;-y&nbsp;install&nbsp;curl<\/p>\n<\/li>\n<li>\n<p><\/p>\n<\/li>\n<li>\n<p><span class=\"attribute\" style=\"box-sizing: inherit; border: 0px; font-family: inherit; font-style: inherit; margin: 0px; padding: 0px; vertical-align: baseline; color: red;\">VPN_IP<\/span>=`curl&nbsp;ipv4.icanhazip.com`<\/p>\n<\/li>\n<li>\n<p><\/p>\n<\/li>\n<li>\n<p><span class=\"attribute\" style=\"box-sizing: inherit; border: 0px; font-family: inherit; font-style: inherit; margin: 0px; padding: 0px; vertical-align: baseline; color: red;\">VPN_USER<\/span>=<span class=\"attribute-value\" style=\"box-sizing: inherit; border: 0px; font-family: inherit; font-style: inherit; margin: 0px; padding: 0px; vertical-align: baseline; color: blue;\">&quot;linuxeye&quot;<\/span><\/p>\n<\/li>\n<li>\n<p><span class=\"attribute\" style=\"box-sizing: inherit; border: 0px; font-family: inherit; font-style: inherit; margin: 0px; padding: 0px; vertical-align: baseline; color: red;\">VPN_PASS<\/span>=<span class=\"attribute-value\" style=\"box-sizing: inherit; border: 0px; font-family: inherit; font-style: inherit; margin: 0px; padding: 0px; vertical-align: baseline; color: blue;\">&quot;linuxeye&quot;<\/span><\/p>\n<\/li>\n<li>\n<p><\/p>\n<\/li>\n<li>\n<p><span class=\"attribute\" style=\"box-sizing: inherit; border: 0px; font-family: inherit; font-style: inherit; margin: 0px; padding: 0px; vertical-align: baseline; color: red;\">VPN_LOCAL<\/span>=<span class=\"attribute-value\" style=\"box-sizing: inherit; border: 0px; font-family: inherit; font-style: inherit; margin: 0px; padding: 0px; vertical-align: baseline; color: blue;\">&quot;192.168.0.150&quot;<\/span><\/p>\n<\/li>\n<li>\n<p><span class=\"attribute\" style=\"box-sizing: inherit; border: 0px; font-family: inherit; font-style: inherit; margin: 0px; padding: 0px; vertical-align: baseline; color: red;\">VPN_REMOTE<\/span>=<span class=\"attribute-value\" style=\"box-sizing: inherit; border: 0px; font-family: inherit; font-style: inherit; margin: 0px; padding: 0px; vertical-align: baseline; color: blue;\">&quot;192.168.0.151-200&quot;<\/span><\/p>\n<\/li>\n<li>\n<p><\/p>\n<\/li>\n<li>\n<p><\/p>\n<\/li>\n<li>\n<p>while&nbsp;:;&nbsp;do&nbsp;echo<\/p>\n<\/li>\n<li>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;read&nbsp;-p&nbsp;&quot;Please&nbsp;input&nbsp;username:&nbsp;&quot;&nbsp;VPN_USER<\/p>\n<\/li>\n<li>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;[&nbsp;-n&nbsp;&quot;$VPN_USER&quot;&nbsp;]&nbsp;&amp;&amp;&nbsp;break<\/p>\n<\/li>\n<li>\n<p>done<\/p>\n<\/li>\n<li>\n<p><\/p>\n<\/li>\n<li>\n<p>while&nbsp;:;&nbsp;do&nbsp;echo<\/p>\n<\/li>\n<li>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;read&nbsp;-p&nbsp;&quot;Please&nbsp;input&nbsp;password:&nbsp;&quot;&nbsp;VPN_PASS<\/p>\n<\/li>\n<li>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;[&nbsp;-n&nbsp;&quot;$VPN_PASS&quot;&nbsp;]&nbsp;&amp;&amp;&nbsp;break<\/p>\n<\/li>\n<li>\n<p>done<\/p>\n<\/li>\n<li>\n<p>clear<\/p>\n<\/li>\n<li>\n<p><\/p>\n<\/li>\n<li>\n<p><\/p>\n<\/li>\n<li>\n<p>if&nbsp;[&nbsp;-f&nbsp;\/etc\/redhat-release&nbsp;-a&nbsp;-n&nbsp;&quot;`grep&nbsp;&#39;&nbsp;7\\.&#39;&nbsp;\/etc\/redhat-release`&quot;&nbsp;];then<\/p>\n<\/li>\n<li>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;#<span class=\"attribute\" style=\"box-sizing: inherit; border: 0px; font-family: inherit; font-style: inherit; margin: 0px; padding: 0px; vertical-align: baseline; color: red;\">CentOS_REL<\/span>=<span class=\"attribute-value\" style=\"box-sizing: inherit; border: 0px; font-family: inherit; font-style: inherit; margin: 0px; padding: 0px; vertical-align: baseline; color: blue;\">7<\/span><\/p>\n<\/li>\n<li>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;[&nbsp;!&nbsp;-e&nbsp;\/etc\/yum.repos.d\/epel.repo&nbsp;];then<\/p>\n<\/li>\n<li>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cat&nbsp;<span class=\"tag\" style=\"box-sizing: inherit; border: 0px; font-family: inherit; font-style: inherit; margin: 0px; padding: 0px; vertical-align: baseline; color: blue; font-weight: bold;\">&gt;<\/span>&nbsp;\/etc\/yum.repos.d\/epel.repo&nbsp;<span class=\"tag\" style=\"box-sizing: inherit; border: 0px; font-family: inherit; font-style: inherit; margin: 0px; padding: 0px; vertical-align: baseline; color: blue; font-weight: bold;\">&lt;<\/span><span class=\"tag\" style=\"box-sizing: inherit; border: 0px; font-family: inherit; font-style: inherit; margin: 0px; padding: 0px; vertical-align: baseline; color: blue; font-weight: bold;\">&lt;<\/span>&nbsp;<span class=\"tag-name\" style=\"box-sizing: inherit; border: 0px; font-family: inherit; font-style: inherit; margin: 0px; padding: 0px; vertical-align: baseline; color: #7F0055; font-weight: bold;\">EOF<\/span><\/p>\n<\/li>\n<li>\n<p>[epel]<\/p>\n<\/li>\n<li>\n<p><span class=\"attribute\" style=\"box-sizing: inherit; border: 0px; font-family: inherit; font-style: inherit; margin: 0px; padding: 0px; vertical-align: baseline; color: red;\">name<\/span>=<span class=\"attribute-value\" style=\"box-sizing: inherit; border: 0px; font-family: inherit; font-style: inherit; margin: 0px; padding: 0px; vertical-align: baseline; color: blue;\">Extra<\/span>&nbsp;Packages&nbsp;for&nbsp;Enterprise&nbsp;Linux&nbsp;7&nbsp;&#8211;&nbsp;\\$basearch<\/p>\n<\/li>\n<li>\n<p>#<span class=\"attribute\" style=\"box-sizing: inherit; border: 0px; font-family: inherit; font-style: inherit; margin: 0px; padding: 0px; vertical-align: baseline; color: red;\">baseurl<\/span>=<span class=\"attribute-value\" style=\"box-sizing: inherit; border: 0px; font-family: inherit; font-style: inherit; margin: 0px; padding: 0px; vertical-align: baseline; color: blue;\">http<\/span>:\/\/download.fedoraproject.org\/pub\/epel\/7\/\\$basearch<\/p>\n<\/li>\n<li>\n<p><span class=\"attribute\" style=\"box-sizing: inherit; border: 0px; font-family: inherit; font-style: inherit; margin: 0px; padding: 0px; vertical-align: baseline; color: red;\">mirrorlist<\/span>=<span class=\"attribute-value\" style=\"box-sizing: inherit; border: 0px; font-family: inherit; font-style: inherit; margin: 0px; padding: 0px; vertical-align: baseline; color: blue;\">https<\/span>:\/\/mirrors.fedoraproject.org\/metalink?<span class=\"attribute\" style=\"box-sizing: inherit; border: 0px; font-family: inherit; font-style: inherit; margin: 0px; padding: 0px; vertical-align: baseline; color: red;\">repo<\/span>=<span class=\"attribute-value\" style=\"box-sizing: inherit; border: 0px; font-family: inherit; font-style: inherit; margin: 0px; padding: 0px; vertical-align: baseline; color: blue;\">epel<\/span>-7&amp;<span class=\"attribute\" style=\"box-sizing: inherit; border: 0px; font-family: inherit; font-style: inherit; margin: 0px; padding: 0px; vertical-align: baseline; color: red;\">arch<\/span>=\\$basearch<\/p>\n<\/li>\n<li>\n<p><span class=\"attribute\" style=\"box-sizing: inherit; border: 0px; font-family: inherit; font-style: inherit; margin: 0px; padding: 0px; vertical-align: baseline; color: red;\">failovermethod<\/span>=<span class=\"attribute-value\" style=\"box-sizing: inherit; border: 0px; font-family: inherit; font-style: inherit; margin: 0px; padding: 0px; vertical-align: baseline; color: blue;\">priority<\/span><\/p>\n<\/li>\n<li>\n<p><span class=\"attribute\" style=\"box-sizing: inherit; border: 0px; font-family: inherit; font-style: inherit; margin: 0px; padding: 0px; vertical-align: baseline; color: red;\">enabled<\/span>=<span class=\"attribute-value\" style=\"box-sizing: inherit; border: 0px; font-family: inherit; font-style: inherit; margin: 0px; padding: 0px; vertical-align: baseline; color: blue;\">1<\/span><\/p>\n<\/li>\n<li>\n<p><span class=\"attribute\" style=\"box-sizing: inherit; border: 0px; font-family: inherit; font-style: inherit; margin: 0px; padding: 0px; vertical-align: baseline; color: red;\">gpgcheck<\/span>=<span class=\"attribute-value\" style=\"box-sizing: inherit; border: 0px; font-family: inherit; font-style: inherit; margin: 0px; padding: 0px; vertical-align: baseline; color: blue;\">0<\/span><\/p>\n<\/li>\n<li>\n<p>EOF<\/p>\n<\/li>\n<li>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;fi<\/p>\n<\/li>\n<li>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;for&nbsp;Package&nbsp;in&nbsp;wget&nbsp;make&nbsp;openssl&nbsp;gcc-c++&nbsp;ppp&nbsp;pptpd&nbsp;iptables&nbsp;iptables-services<\/p>\n<\/li>\n<li>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;do<\/p>\n<\/li>\n<li>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;yum&nbsp;-y&nbsp;install&nbsp;$Package<\/p>\n<\/li>\n<li>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;done<\/p>\n<\/li>\n<li>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;&#39;<span class=\"attribute\" style=\"box-sizing: inherit; border: 0px; font-family: inherit; font-style: inherit; margin: 0px; padding: 0px; vertical-align: baseline; color: red;\">net.ipv4.ip_forward<\/span>&nbsp;=&nbsp;<span class=\"attribute-value\" style=\"box-sizing: inherit; border: 0px; font-family: inherit; font-style: inherit; margin: 0px; padding: 0px; vertical-align: baseline; color: blue;\">1<\/span>&#39;&nbsp;<span class=\"tag\" style=\"box-sizing: inherit; border: 0px; font-family: inherit; font-style: inherit; margin: 0px; padding: 0px; vertical-align: baseline; color: blue; font-weight: bold;\">&gt;<\/span><span class=\"tag\" style=\"box-sizing: inherit; border: 0px; font-family: inherit; font-style: inherit; margin: 0px; padding: 0px; vertical-align: baseline; color: blue; font-weight: bold;\">&gt;<\/span>&nbsp;\/etc\/sysctl.conf<\/p>\n<\/li>\n<li>\n<p>elif&nbsp;[&nbsp;-f&nbsp;\/etc\/redhat-release&nbsp;-a&nbsp;-n&nbsp;&quot;`grep&nbsp;&#39;&nbsp;6\\.&#39;&nbsp;\/etc\/redhat-release`&quot;&nbsp;];then<\/p>\n<\/li>\n<li>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;#<span class=\"attribute\" style=\"box-sizing: inherit; border: 0px; font-family: inherit; font-style: inherit; margin: 0px; padding: 0px; vertical-align: baseline; color: red;\">CentOS_REL<\/span>=<span class=\"attribute-value\" style=\"box-sizing: inherit; border: 0px; font-family: inherit; font-style: inherit; margin: 0px; padding: 0px; vertical-align: baseline; color: blue;\">6<\/span><\/p>\n<\/li>\n<li>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;for&nbsp;Package&nbsp;in&nbsp;wget&nbsp;make&nbsp;openssl&nbsp;gcc-c++&nbsp;iptables&nbsp;ppp<\/p>\n<\/li>\n<li>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;do<\/p>\n<\/li>\n<li>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;yum&nbsp;-y&nbsp;install&nbsp;$Package<\/p>\n<\/li>\n<li>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;done<\/p>\n<\/li>\n<li>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;sed&nbsp;-i&nbsp;&#39;s@net.ipv4.ip_forward.*@<span class=\"attribute\" style=\"box-sizing: inherit; border: 0px; font-family: inherit; font-style: inherit; margin: 0px; padding: 0px; vertical-align: baseline; color: red;\">net.ipv4.ip_forward<\/span>&nbsp;=&nbsp;<span class=\"attribute-value\" style=\"box-sizing: inherit; border: 0px; font-family: inherit; font-style: inherit; margin: 0px; padding: 0px; vertical-align: baseline; color: blue;\">1<\/span>@g&#39;&nbsp;\/etc\/sysctl.conf<\/p>\n<\/li>\n<li>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;rpm&nbsp;-Uvh&nbsp;http:\/\/poptop.sourceforge.net\/yum\/stable\/rhel6\/pptp-release-current.noarch.rpm<\/p>\n<\/li>\n<li>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;yum&nbsp;-y&nbsp;install&nbsp;pptpd<\/p>\n<\/li>\n<li>\n<p>else<\/p>\n<\/li>\n<li>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;-e&nbsp;&quot;\\033[31mDoes&nbsp;not&nbsp;support&nbsp;this&nbsp;OS,&nbsp;Please&nbsp;contact&nbsp;the&nbsp;author!&nbsp;\\033[0m&quot;<\/p>\n<\/li>\n<li>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;exit&nbsp;1<\/p>\n<\/li>\n<li>\n<p>fi<\/p>\n<\/li>\n<li>\n<p><\/p>\n<\/li>\n<li>\n<p>echo&nbsp;&quot;1&quot;&nbsp;<span class=\"tag\" style=\"box-sizing: inherit; border: 0px; font-family: inherit; font-style: inherit; margin: 0px; padding: 0px; vertical-align: baseline; color: blue; font-weight: bold;\">&gt;<\/span>&nbsp;\/proc\/sys\/net\/ipv4\/ip_forward<\/p>\n<\/li>\n<li>\n<p><\/p>\n<\/li>\n<li>\n<p>sysctl&nbsp;-p&nbsp;\/etc\/sysctl.conf<\/p>\n<\/li>\n<li>\n<p><\/p>\n<\/li>\n<li>\n<p>[&nbsp;-z&nbsp;&quot;`grep&nbsp;&#39;^localip&#39;&nbsp;\/etc\/pptpd.conf`&quot;&nbsp;]&nbsp;&amp;&amp;&nbsp;echo&nbsp;&quot;localip&nbsp;$VPN_LOCAL&quot;&nbsp;<span class=\"tag\" style=\"box-sizing: inherit; border: 0px; font-family: inherit; font-style: inherit; margin: 0px; padding: 0px; vertical-align: baseline; color: blue; font-weight: bold;\">&gt;<\/span><span class=\"tag\" style=\"box-sizing: inherit; border: 0px; font-family: inherit; font-style: inherit; margin: 0px; padding: 0px; vertical-align: baseline; color: blue; font-weight: bold;\">&gt;<\/span>&nbsp;\/etc\/pptpd.conf&nbsp;#&nbsp;Local&nbsp;IP&nbsp;address&nbsp;of&nbsp;your&nbsp;VPN&nbsp;server<\/p>\n<\/li>\n<li>\n<p>[&nbsp;-z&nbsp;&quot;`grep&nbsp;&#39;^remoteip&#39;&nbsp;\/etc\/pptpd.conf`&quot;&nbsp;]&nbsp;&amp;&amp;&nbsp;echo&nbsp;&quot;remoteip&nbsp;$VPN_REMOTE&quot;&nbsp;<span class=\"tag\" style=\"box-sizing: inherit; border: 0px; font-family: inherit; font-style: inherit; margin: 0px; padding: 0px; vertical-align: baseline; color: blue; font-weight: bold;\">&gt;<\/span><span class=\"tag\" style=\"box-sizing: inherit; border: 0px; font-family: inherit; font-style: inherit; margin: 0px; padding: 0px; vertical-align: baseline; color: blue; font-weight: bold;\">&gt;<\/span>&nbsp;\/etc\/pptpd.conf&nbsp;#&nbsp;Scope&nbsp;for&nbsp;your&nbsp;home&nbsp;network<\/p>\n<\/li>\n<li>\n<p><\/p>\n<\/li>\n<li>\n<p>if&nbsp;[&nbsp;-z&nbsp;&quot;`grep&nbsp;&#39;^ms-dns&#39;&nbsp;\/etc\/ppp\/options.pptpd`&quot;&nbsp;];then<\/p>\n<\/li>\n<li>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cat&nbsp;<span class=\"tag\" style=\"box-sizing: inherit; border: 0px; font-family: inherit; font-style: inherit; margin: 0px; padding: 0px; vertical-align: baseline; color: blue; font-weight: bold;\">&gt;<\/span><span class=\"tag\" style=\"box-sizing: inherit; border: 0px; font-family: inherit; font-style: inherit; margin: 0px; padding: 0px; vertical-align: baseline; color: blue; font-weight: bold;\">&gt;<\/span>&nbsp;\/etc\/ppp\/options.pptpd&nbsp;<span class=\"tag\" style=\"box-sizing: inherit; border: 0px; font-family: inherit; font-style: inherit; margin: 0px; padding: 0px; vertical-align: baseline; color: blue; font-weight: bold;\">&lt;<\/span><span class=\"tag\" style=\"box-sizing: inherit; border: 0px; font-family: inherit; font-style: inherit; margin: 0px; padding: 0px; vertical-align: baseline; color: blue; font-weight: bold;\">&lt;<\/span>&nbsp;<span class=\"tag-name\" style=\"box-sizing: inherit; border: 0px; font-family: inherit; font-style: inherit; margin: 0px; padding: 0px; vertical-align: baseline; color: #7F0055; font-weight: bold;\">EOF<\/span><\/p>\n<\/li>\n<li>\n<p>ms-dns&nbsp;223.5.5.5&nbsp;#&nbsp;Aliyun&nbsp;DNS&nbsp;Primary<\/p>\n<\/li>\n<li>\n<p>ms-dns&nbsp;114.114.114.114&nbsp;#&nbsp;114&nbsp;DNS&nbsp;Primary<\/p>\n<\/li>\n<li>\n<p>ms-dns&nbsp;8.8.8.8&nbsp;#&nbsp;Google&nbsp;DNS&nbsp;Primary<\/p>\n<\/li>\n<li>\n<p>ms-dns&nbsp;209.244.0.3&nbsp;#&nbsp;Level3&nbsp;Primary<\/p>\n<\/li>\n<li>\n<p>ms-dns&nbsp;208.67.222.222&nbsp;#&nbsp;OpenDNS&nbsp;Primary<\/p>\n<\/li>\n<li>\n<p>EOF<\/p>\n<\/li>\n<li>\n<p>fi<\/p>\n<\/li>\n<li>\n<p><\/p>\n<\/li>\n<li>\n<p>echo&nbsp;&quot;$VPN_USER&nbsp;pptpd&nbsp;$VPN_PASS&nbsp;*&quot;&nbsp;<span class=\"tag\" style=\"box-sizing: inherit; border: 0px; font-family: inherit; font-style: inherit; margin: 0px; padding: 0px; vertical-align: baseline; color: blue; font-weight: bold;\">&gt;<\/span><span class=\"tag\" style=\"box-sizing: inherit; border: 0px; font-family: inherit; font-style: inherit; margin: 0px; padding: 0px; vertical-align: baseline; color: blue; font-weight: bold;\">&gt;<\/span>&nbsp;\/etc\/ppp\/chap-secrets<\/p>\n<\/li>\n<li>\n<p><\/p>\n<\/li>\n<li>\n<p><span class=\"attribute\" style=\"box-sizing: inherit; border: 0px; font-family: inherit; font-style: inherit; margin: 0px; padding: 0px; vertical-align: baseline; color: red;\">ETH<\/span>=`route&nbsp;|&nbsp;grep&nbsp;default&nbsp;|&nbsp;awk&nbsp;&#39;{print&nbsp;$NF}&#39;`<\/p>\n<\/li>\n<li>\n<p>[&nbsp;-z&nbsp;&quot;`grep&nbsp;&#39;1723&nbsp;-j&nbsp;ACCEPT&#39;&nbsp;\/etc\/sysconfig\/iptables`&quot;&nbsp;]&nbsp;&amp;&amp;&nbsp;iptables&nbsp;-I&nbsp;INPUT&nbsp;4&nbsp;-p&nbsp;tcp&nbsp;-m&nbsp;state&nbsp;&#8211;state&nbsp;NEW&nbsp;-m&nbsp;tcp&nbsp;&#8211;dport&nbsp;1723&nbsp;-j&nbsp;ACCEPT<\/p>\n<\/li>\n<li>\n<p>[&nbsp;-z&nbsp;&quot;`grep&nbsp;&#39;gre&nbsp;-j&nbsp;ACCEPT&#39;&nbsp;\/etc\/sysconfig\/iptables`&quot;&nbsp;]&nbsp;&amp;&amp;&nbsp;iptables&nbsp;-I&nbsp;INPUT&nbsp;5&nbsp;-p&nbsp;gre&nbsp;-j&nbsp;ACCEPT<\/p>\n<\/li>\n<li>\n<p>iptables&nbsp;-t&nbsp;nat&nbsp;-A&nbsp;POSTROUTING&nbsp;-o&nbsp;$ETH&nbsp;-j&nbsp;MASQUERADE<\/p>\n<\/li>\n<li>\n<p>iptables&nbsp;-I&nbsp;FORWARD&nbsp;-p&nbsp;tcp&nbsp;&#8211;syn&nbsp;-i&nbsp;ppp+&nbsp;-j&nbsp;TCPMSS&nbsp;&#8211;set-mss&nbsp;1356<\/p>\n<\/li>\n<li>\n<p>service&nbsp;iptables&nbsp;save<\/p>\n<\/li>\n<li>\n<p>sed&nbsp;-i&nbsp;&#39;s@^-A&nbsp;INPUT&nbsp;-j&nbsp;REJECT&nbsp;&#8211;reject-with&nbsp;icmp-host-prohibited@#-A&nbsp;INPUT&nbsp;-j&nbsp;REJECT&nbsp;&#8211;reject-with&nbsp;icmp-host-prohibited@&#39;&nbsp;\/etc\/sysconfig\/iptables<\/p>\n<\/li>\n<li>\n<p>sed&nbsp;-i&nbsp;&#39;s@^-A&nbsp;FORWARD&nbsp;-j&nbsp;REJECT&nbsp;&#8211;reject-with&nbsp;icmp-host-prohibited@#-A&nbsp;FORWARD&nbsp;-j&nbsp;REJECT&nbsp;&#8211;reject-with&nbsp;icmp-host-prohibited@&#39;&nbsp;\/etc\/sysconfig\/iptables<\/p>\n<\/li>\n<li>\n<p>service&nbsp;iptables&nbsp;restart<\/p>\n<\/li>\n<li>\n<p>chkconfig&nbsp;iptables&nbsp;on<\/p>\n<\/li>\n<li>\n<p><\/p>\n<\/li>\n<li>\n<p>service&nbsp;pptpd&nbsp;restart<\/p>\n<\/li>\n<li>\n<p>chkconfig&nbsp;pptpd&nbsp;on<\/p>\n<\/li>\n<li>\n<p>clear<\/p>\n<\/li>\n<li>\n<p><\/p>\n<\/li>\n<li>\n<p>echo&nbsp;-e&nbsp;&quot;You&nbsp;can&nbsp;now&nbsp;connect&nbsp;to&nbsp;your&nbsp;VPN&nbsp;via&nbsp;your&nbsp;external&nbsp;IP&nbsp;\\033[32m${VPN_IP}\\033[0m&quot;<\/p>\n<\/li>\n<li>\n<p><\/p>\n<\/li>\n<li>\n<p>echo&nbsp;-e&nbsp;&quot;Username:&nbsp;\\033[32m${VPN_USER}\\033[0m&quot;<\/p>\n<\/li>\n<li>\n<p>echo&nbsp;-e&nbsp;&quot;Password:&nbsp;\\033[32m${VPN_PASS}\\033[0m&quot;<\/p>\n<\/li>\n<\/ol>\n<\/div>\n<p style=\"box-sizing: inherit; border: 0px; font-family: &quot;Microsoft YaHei&quot;, Helvetica, Arial, &quot;Lucida Grande&quot;, Tahoma, sans-serif; font-size: 16px; margin-top: 0px; margin-bottom: 12px; padding: 0px; vertical-align: baseline; overflow-wrap: break-word; text-indent: 2em; white-space: normal; background-color: rgb(255, 255, 255);\">\u5185\u5bb9\u8f6c\u81ea\uff1a https:\/\/linuxeye.com\/<\/p>\n<p style=\"box-sizing: inherit; border: 0px; font-family: &quot;Microsoft YaHei&quot;, Helvetica, Arial, &quot;Lucida Grande&quot;, Tahoma, sans-serif; font-size: 16px; margin-top: 0px; margin-bottom: 12px; padding: 0px; vertical-align: baseline; overflow-wrap: break-word; text-indent: 2em; white-space: normal; background-color: rgb(255, 255, 255);\">\u53c2\u8003\uff1ahttps:\/\/github.com\/drewsymo\/VPN<\/p>\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>CentOS&nbsp;6\u30017\u4e0bpptp vpn\u4e00\u952e\u5b89\u88c5\u811a\u672c\uff0c\u5b89\u88c5\u5982\u4e0b\uff1a wget&nbsp;http:\/\/m [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[57,420,421,376],"class_list":["post-61","post","type-post","status-publish","format-standard","hentry","category-2","tag-centos","tag-pptp","tag-vpn","tag-376"],"_links":{"self":[{"href":"https:\/\/www.fatesky.com\/index.php?rest_route=\/wp\/v2\/posts\/61","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.fatesky.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.fatesky.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.fatesky.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.fatesky.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=61"}],"version-history":[{"count":1,"href":"https:\/\/www.fatesky.com\/index.php?rest_route=\/wp\/v2\/posts\/61\/revisions"}],"predecessor-version":[{"id":3395,"href":"https:\/\/www.fatesky.com\/index.php?rest_route=\/wp\/v2\/posts\/61\/revisions\/3395"}],"wp:attachment":[{"href":"https:\/\/www.fatesky.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=61"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.fatesky.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=61"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.fatesky.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=61"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}