centos pptp 客户端 连接vpn

windows下是可以连接vpn的,上网啊都没什么问题。想以centos为客户端,连接远程的VPN,发现不是那么容易,找了半天资料,找到了方法。

1,安装ppp pptp pptp-setup

# yum install ppp pptp pptp-setup

2,创建VPN连接

# pptpsetup --create test --server ip地址 \--username test --password test --start

如果报以下错误:

FATAL: Module ppp_mppe not found./usr/sbin/pptpsetup: couldn't find MPPE support in kernel.

解决方法:

# modprobe ppp_mppe

3,连接VPN连接

[root@localhost peers]# pppd call test  //这里的test是上面创建vpn连接

如果报以下错误:

Using interface ppp0Connect: ppp0 <--> /dev/pts/3CHAP authentication succeededLCP terminated by peer (MPPE required but peer refused)Modem hangup

解决方法:

# vim /etc/ppp/peers/test? //test是上面创建的连接文件尾部,加上以下内容require-mppe-128

成功后会多出一个虚拟网口ppp0

[root@localhost peers]# route -nKernel IP routing tableDestination???? Gateway???????? Genmask???????? Flags Metric Ref??? Use Iface112.124.132.142 192.168.10.1??? 255.255.255.255 UGH?? 0????? 0??????? 0 eth0192.168.8.1???? 0.0.0.0???????? 255.255.255.255 UH??? 0????? 0??????? 0 ppp0192.168.10.0??? 0.0.0.0???????? 255.255.255.0?? U???? 1????? 0??????? 0 eth00.0.0.0???????? 192.168.10.1??? 0.0.0.0???????? UG??? 0????? 0??????? 0 eth0

并且用ifconfig也可以看到

centos 作为客户端连接 vpn

4,添加默认路由

[root@localhost peers]# route add -net 0.0.0.0 dev ppp0 //添加默认路由[root@localhost peers]# route -nKernel IP routing tableDestination???? Gateway???????? Genmask???????? Flags Metric Ref??? Use Iface112.124.132.142 192.168.10.1??? 255.255.255.255 UGH?? 0????? 0??????? 0 eth0192.168.8.1???? 0.0.0.0???????? 255.255.255.255 UH??? 0????? 0??????? 0 ppp0192.168.10.0??? 0.0.0.0???????? 255.255.255.0?? U???? 1????? 0??????? 0 eth00.0.0.0???????? 0.0.0.0???????? 0.0.0.0???????? U???? 0????? 0??????? 0 ppp00.0.0.0???????? 192.168.10.1??? 0.0.0.0???????? UG??? 0????? 0??????? 0 eth0

到这儿VPN就设置好了,根WINDOWS下一样的。你可以通过IP查询工具查一下。

5,断开vpn连接,只需要把网络重启就行了。

[root@localhost peers]# /etc/init.d/network restart

windows下是可以连接vpn的,上网啊都没什么问题。想以centos为客户端,连接远程的VPN,发现不是那么容易,找了半天资料,找到了方法。1,安装ppp pptp pptp-setup# yum install ppp pptp pptp-setup2,创建VPN连接# pptpsetup –create test –server ip地址 \–username test –password test –start如果报以下错误:FATAL: Module ppp_mppe not found./usr/sbin/pptpsetup: couldn’t find MPPE support in kernel.解决方法:# modprobe ppp_mppe3,连接VPN连接[root@localhost peers]# pppd call test //这里的test是上面创建vpn连接如果报以下错误:Using interface ppp0Connect: ppp0 <–> /dev/pts/3CHAP authentication succeededLCP terminated by peer (MPPE required but peer refused)Modem hangup 解决方法:# vim /etc/ppp/peers/test? […] 最有效的资本是我们的信誉,它24小时不停为我们工作。

centos pptp 客户端 连接vpn

相关文章:

你感兴趣的文章:

标签云: