`

Window作为VPN服务器,CentOS作为客户端上网配置

 
阅读更多

公司采用深X服网关,所有的上网设备都需要经过深X服过滤。在Windows下我们需要安装深X服的一个客户端,叫什么安全桌面之类的玩意,听说是用来监控QQ聊天记录的。但是我在内网有一台服务器CentOS6.3,不能安装他的客户端,因此上网就无从谈起。一开始使用yum代理可以下载安装程序,但是我用到python pip安装程序的时候无法走yum代理。因此用VPN全局代理想法就蹦出来了。开始实践:

搜索到一篇文章 :http://www.tuicool.com/articles/Una6RjJ 大致的方案如下:

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 ppp0
Connect: ppp0 <--> /dev/pts/3
CHAP authentication succeeded
LCP terminated by peer (MPPE required but peer refused)
Modem hangup

解决方法:

# vim /etc/ppp/peers/test  //test是上面创建的连接

文件尾部,加上以下内容

require-mppe-128

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

 

[root@localhost peers]# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
112.124.132.142 192.168.10.1    255.255.255.255 UGH   0      0        0 eth0
192.168.8.1     0.0.0.0         255.255.255.255 UH    0      0        0 ppp0
192.168.10.0    0.0.0.0         255.255.255.0   U     1      0        0 eth0
0.0.0.0         192.168.10.1    0.0.0.0         UG    0      0        0 eth0

但是我并没有看到有ppp0这个网关。于是我又搜索了一篇文章:https://my.oschina.net/fishman/blog/96227 大致不同的地方:

 

这样会生成一个名为test的vpn拨号账号,    然后编辑账号配置文件:

vi /etc/ppp/peers/test

 

# written by pptpsetup
pty "pptp xxx.xxx.xxx --nolaunchpppd"
lock
noauth
nobsdcomp
nodeflate
name vpnusername
remotename test
ipparam test

defaultroute #使用本连接作为默认路由
persist #当连接丢失时让pppd再次拨号
require-mppe-128 
refuse-pap 
refuse-chap 
refuse-eap 
refuse-mschap

我打开test文件 发现ipparaam test 后面都是空的,于是把缺的内容加上。

然后执行pon命令,发现pon命令不可用,于是又找回文章上面还有一部分需要拷贝的:

cp /usr/share/doc/ppp-2.4.5/scripts/pon /usr/sbin/
cp /usr/share/doc/ppp-2.4.5/scripts/poff /usr/sbin/
chmod 755 /usr/sbin/pon 
chmod 755 /usr/sbin/poff

 

开始拨号

pon test

ifconfig 可以看到 vpn连接ppp0出来了.  

于是就好了... bye bye

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics