PPTPVPN服务端一键安装脚本
Linux / 2015年04月3日

原创内容,转载请注明出处:https://www.myzhenai.com.cn/post/2007.html https://www.myzhenai.com/thread-17436-1-1.html
网络上有很多VPN一键安装脚本,好多功能也比这个脚本强大和简单,但这个是我练习Linux Shell编程自己写出来的脚本代码,说分享也好,记录也罢,发出来与大家共同学习探讨. 欢迎大家指教.谢谢.
目前脚本只适用于CenTos6,因为在识别系统版本上我还搞不懂,我的本意是自动识别系统版本,然后下载安装相应版本的epel源,但还有待学习.
其实安装PPTP真的是很简单,可以参考https://www.myzhenai.com.cn/post/871.html

Linux下的Pptpd和OpenVpn客户端端口转发教程
Linux / 2014年11月9日

连接过程
客户端从本地的1194或1723端口发起访问请求,或是从这两个端口接收VPN服务器返回的信息,但这个过程都需要经过中间的ISP网络服务器的,所以GFW可以在这里中止来自这两个端口的请求达到屏蔽效果.我的理解是这样的.所以我们需要做端口转发.让本地客户端使用其他端口来发起连接请求或接收返回信息.在做端口转发的同时,请在本地客户端连接里将你的VPN使用的DNS改成国外的或可以正常连接外部的.你使用ISP提供商提供的DNS也有可能会出现无法连接的问题.

CenTos下配置OpenVPN时无法导入用户私钥的解决方法
Linux / 2014年09月1日

前些天遇到一个问题,不知道为什么我配置的Pptpd和OpenVPN都无法连接了,不知道是不是BuyVM升级了OpenVZ补丁所至,反正是两种VPN方法都无法连接了,我重装了几遍始终解决不了,因些还与BuyVM的技术客服-jessie沟通了好几天,我把服务器上的CenTos5.8升级到了CenTos6.4,并且-jessie帮我重新布署了Pptp和OpenVPN,但是最后我配置本地的时候却还是发现无法连接,于是我又将服务器重装了,重装安装和配置了Pptpd和OpenVPN,最后我发现Pptpd无法连接是我本地客户端的问题,可能系统缓存了什么错误的密码或是其他东西,我重新配置后可以了,详情可以参考Centos下PPtpD本地无法连接的解决方法,最烦人的是OpenVPN的配置,在本地CenTos+NetworkManager-openvpn里却看不到用户私钥文件,但是这个文件我已经从服务器上下载到本地了,始终无法导入用户密钥文件,我以为是服务器上生成的key文件有问题,还在本地进行了生成,但还是无法解决,这个问题我问了好多社区,并且在一些Linux技术群里询问都得不到解决方法.搜索网络上也找不到相应的问题,所以只好自己折腾,经过两天的折腾,终于解决了,故障发生原因我不知道,可能是easy-rsa文件包里的openssl生成密钥文件的时候加密过程中发生了什么,所以无法正常导入.

Centos下PPtpD本地无法连接的解决方法
Linux / 2014年08月29日

原创内容,转载请注明出处:https://www.myzhenai.com.cn/post/1854.html
linux pptp客户端无法链接的解决方法: https://www.myzhenai.com.cn/post/891.html https://www.myzhenai.com/thread-15408-1-1.html
Centos6+GNOME+NetworkManager配置VPN客户端: https://www.myzhenai.com.cn/post/767.html https://www.myzhenai.com/thread-15104-1-3.html
Centos VPS安装Pptp和OpenVpn的方法与经验分享: https://www.myzhenai.com.cn/post/871.html https://www.myzhenai.com/thread-15394-1-1.html
本来配置得好好的pptpd突然出现无法连接的故障,我以为是服务端出现了问题,还因此重装了VPS服务器,重新安装配置了Pptpd.后来找了另外一台windwos7 的机子发现可以正常连接,就是Centos里使用NetworkManager无法连接,这个问题折腾了两天,也删除过pptpd的连接重新设置也不济事,最后还是重新创建pptpd的连接解决了问题.
在pptpd编辑那里取消 “对所有用户可用”\ 先不要填写pptpd的连接密码 \ 其他配置请参考 “linux pptp客户端无法链接的解决方法”
然后连接重新创建的pptpd连接,在弹出的 “认证VPN”窗口中输入pptpd连接密码,并勾选“在密钥环中保存密码”

linux pptp客户端无法链接的解决方法
Linux / 2013年01月23日

Jan 22 19:09:40 localhost nautilus: [N-A] Nautilus-Actions Menu Extender 2.30.3 initializing…
Jan 22 19:09:45 localhost NetworkManager[2007]: (eth0): device state change: 8 -> 3 (reason 0)
Jan 22 19:09:45 localhost NetworkManager[2007]:
(eth0): deactivating device (reason: 0).
Jan 22 19:09:45 localhost pppd[2023]: Terminating on signal 15
Jan 22 19:09:45 localhost pppd[2023]: Connect time 0.5 minutes.
Jan 22 19:09:45 localhost pppd[2023]: Sent 2408 bytes, received 4087 bytes.
Jan 22 19:09:45 localhost NetworkManager[2007]:
Activation (eth0) starting connection ‘ADSL’
Jan 22 19:09:45 localhost NetworkManager[2007]:
(eth0): device state change: 3 -> 4 (reason 0)
Jan 22 19:09:45 localhost NetworkManager[2007]:
Activation (eth0) Stage 1 of 5 (Device Prepare) scheduled…
Jan 22 19:09:45 localhost NetworkManager[2007]:
Activation (eth0) Stage 1 of 5 (Device Prepare) started…
Jan 22 19:09:45 localhost NetworkManager[2007]:
Activation (eth0) Stage 2 of 5 (Device Configure) scheduled…
Jan 22 19:09:45 localhost NetworkManager[2007]:
Activation (eth0) Stage 1 of 5 (Device Prepare) complete.
Jan 22 19:09:45 localhost NetworkManager[2007]:
Activation (eth0) Stage 2 of 5 (Device Configure) starting…
Jan 22 19:09:45 localhost NetworkManager[2007]:
(eth0): device state change: 4 -> 5 (reason 0)
Jan 22 19:09:45 localhost NetworkManager[2007]:
Activation (eth0) Stage 2 of 5 (Device Configure) successful.
Jan 22 19:09:45 localhost NetworkManager[2007]:
Activation (eth0) Stage 3 of 5 (IP Configure Start) scheduled.
Jan 22 19:09:45 localhost NetworkManager[2007]:
Activation (eth0) Stage 2 of 5 (Device Configure) complete.
Jan 22 19:09:45 localhost NetworkManager[2007]:
Activation (eth0) Stage 3 of 5 (IP Configure Start) started…
Jan 22 19:09:45 localhost NetworkManager[2007]:
(eth0): device state change: 5 -> 7 (reason 0)
Jan 22 19:09:45 localhost NetworkManager[2007]:
starting PPP connection
Jan 22 19:09:45 localhost dbus: [system] Rejected send message, 2 matched rules; type=”error”, sender=”:1.1″ (uid=0 pid=2007 comm=”NetworkManager) interface=”(unset)” member=”(unset)” error name=”org.freedesktop.DBus.Error.UnknownMethod” requested_reply=0 destination=”:1.6″ (uid=0 pid=2023 comm=”/usr/sbin/pppd))
Jan 22 19:09:45 localhost dbus: [system] Rejected send message, 2 matched rules; type=”error”, sender=”:1.1″ (uid=0 pid=2007 comm=”NetworkManager) interface=”(unset)” member=”(unset)” error name=”org.freedesktop.DBus.Error.UnknownMethod” requested_reply=0 destination=”:1.6″ (uid=0 pid=2023 comm=”/usr/sbin/pppd))
Jan 22 19:09:45 localhost pppd[3126]: Warning: can’t open options file /root/.ppprc: Permission denied
Jan 22 19:09:45 localhost pppd[3126]: Plugin rp-pppoe.so loaded.
Jan 22 19:09:45 localhost pppd[3126]: RP-PPPoE plugin version 3.8p compiled against pppd 2.4.5
Jan 22 19:09:45 localhost NetworkManager[2007]:
pppd started with pid 3126
Jan 22 19:09:45 localhost NetworkManager[2007]:
Activation (eth0) Stage 3 of 5 (IP Configure Start) complete.
Jan 22 19:09:45 localhost pppd[3126]: Plugin /usr/lib/pppd/2.4.5/nm-pppd-plugin.so loaded.
Jan 22 19:09:45 localhost dbus: [system] Rejected send message, 2 matched rules; type=”error”, sender=”:1.1″ (uid=0 pid=2007 comm=”NetworkManager) interface=”(unset)” member=”(unset)” error name=”org.freedesktop.DBus.Error.UnknownMethod” requested_reply=0 destination=”:1.6″ (uid=0 pid=2023 comm=”/usr/sbin/pppd))
Jan 22 19:09:45 localhost pppd[2023]: Connection terminated.
Jan 22 19:09:45 localhost dbus: [system] Rejected send message, 2 matched rules; type=”error”, sender=”:1.1″ (uid=0 pid=2007 comm=”NetworkManager) interface=”(unset)” member=”(unset)” error name=”org.freedesktop.DBus.Error.UnknownMethod” requested_reply=0 destination=”:1.6″ (uid=0 pid=2023 comm=”/usr/sbin/pppd))
Jan 22 19:09:45 localhost pppd[3126]: pppd 2.4.5 started by root, uid 0
Jan 22 19:09:45 localhost dbus: [system] Rejected send message, 2 matched rules; type=”error”, sender=”:1.1″ (uid=0 pid=2007 comm=”NetworkManager) interface=”(unset)” member=”(unset)” error name=”org.freedesktop.DBus.Error.UnknownMethod” requested_reply=0 destination=”:1.6″ (uid=0 pid=2023 comm=”/usr/sbin/pppd))
Jan 22 19:09:45 localhost pppd[3126]: PPP session is 9892
Jan 22 19:09:45 localhost pppd[3126]: Connected to 00:46:4b:ad:da:b6 via interface eth0
Jan 22 19:09:45 localhost pppd[3126]: Using interface ppp0
Jan 22 19:09:45 localhost pppd[3126]: Connect: ppp0 < --> eth0
Jan 22 19:09:45 localhost pppd[2023]: Exit.
Jan 22 19:09:45 localhost pppd[3126]: Remote message: Authentication success,Welcome!
Jan 22 19:09:45 localhost pppd[3126]: PAP authentication succeeded
Jan 22 19:09:45 localhost pppd[3126]: peer from calling number 00:46:4B:AD:DA:B6 authorized
Jan 22 19:09:45 localhost pppd[3126]: local IP address 112.66.50.113
Jan 22 19:09:45 localhost pppd[3126]: remote IP address 112.66.50.1
Jan 22 19:09:45 localhost pppd[3126]: primary DNS address 202.100.199.8
Jan 22 19:09:45 localhost pppd[3126]: secondary DNS address 202.100.192.68
Jan 22 19:09:45 localhost NetworkManager[2007]:
PPP manager(IP Config Get) reply received.
Jan 22 19:09:45 localhost NetworkManager[2007]:
Activation (eth0) Stage 4 of 5 (IP4 Configure Get) scheduled…
Jan 22 19:09:45 localhost NetworkManager[2007]:
Activation (eth0) Stage 4 of 5 (IP4 Configure Get) started…
Jan 22 19:09:45 localhost NetworkManager[2007]:
Activation (eth0) Stage 5 of 5 (IP Configure Commit) scheduled…
Jan 22 19:09:45 localhost NetworkManager[2007]:
Activation (eth0) Stage 4 of 5 (IP4 Configure Get) complete.
Jan 22 19:09:45 localhost NetworkManager[2007]:
Activation (eth0) Stage 5 of 5 (IP Configure Commit) started…
Jan 22 19:09:46 localhost NetworkManager[2007]:
(eth0): device state change: 7 -> 8 (reason 0)
Jan 22 19:09:46 localhost NetworkManager[2007]:
Policy set ‘ADSL’ (ppp0) as default for IPv4 routing and DNS.
Jan 22 19:09:46 localhost NetworkManager[2007]:
Activation (eth0) successful, device activated.
Jan 22 19:09:46 localhost NetworkManager[2007]:
Activation (eth0) Stage 5 of 5 (IP Configure Commit) complete.
Jan 22 19:09:47 localhost tpvmlpd2[3198]: device type not supported
Jan 22 19:09:50 localhost NetworkManager[2007]:
Starting VPN service ‘org.freedesktop.NetworkManager.pptp’…
Jan 22 19:09:50 localhost NetworkManager[2007]:
VPN service ‘org.freedesktop.NetworkManager.pptp’ started (org.freedesktop.NetworkManager.pptp), PID 3200
Jan 22 19:09:50 localhost NetworkManager[2007]:
VPN service ‘org.freedesktop.NetworkManager.pptp’ appeared, activating connections
Jan 22 19:09:50 localhost NetworkManager[2007]:
VPN plugin state changed: 1
Jan 22 19:09:50 localhost NetworkManager[2007]:
VPN plugin state changed: 3
Jan 22 19:09:50 localhost NetworkManager[2007]:
VPN connection ‘PPTP’ (Connect) reply received.
Jan 22 19:09:50 localhost NetworkManager[2007]: VPN connection ‘PPTP’ failed to connect: ‘No VPN secrets!’.
Jan 22 19:09:50 localhost NetworkManager[2007]:
error disconnecting VPN: Could not process the request because no VPN connection was active.
Jan 22 19:09:50 localhost NetworkManager[2007]: Policy set ‘ADSL’ (ppp0) as default for IPv4 routing and DNS.
Jan 22 19:10:02 localhost tpvmlpd2[3223]: device type not supported
Jan 22 19:10:17 localhost tpvmlpd2[3227]: device type not supported
Jan 22 19:10:32 localhost tpvmlpd2[3231]: device type not supported
Jan 22 19:10:47 localhost tpvmlpd2[3235]: device type not supported