10002---Linux 配置客户端VPN

来源:互联网 发布:动易cms过时了吗 编辑:程序博客网 时间:2024/06/05 20:02

1,安装ppp pptp pptp-setup

<strong># yum install ppp pptp pptp-setup</strong>

2,创建VPN连接

<strong># pptpsetup --create test --server ip地址 --username test --password test</strong>
如果报以下错误:
<strong>FATAL: Module ppp_mppe not found./usr/sbin/pptpsetup: couldn't find MPPE support in kernel.</strong>
解决方法:

# modprobe ppp_mppe

【注】文件会出现在/etc/ppp/peers/下面, 文件名就是test, 也就是--create后面的参数.

3,连接VPN连接

# pppd call test  //这里的test是上面创建vpn连接
如果报以下错误:
Using interface ppp0Connect: ppp0 <--> /dev/pts/3CHAP authentication succeededLCP terminated by peer (MPPE required but peer refused)Modem hangup
【注】执行结果的消息可以在:/var/log/messages中看到
解决方法:

<span style="color:#000000;"># vim /etc/ppp/peers/test  //test是上面创建的连接文件尾部,加上以下内容require-mppe-128</span>

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

<span style="color:#000000;">[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</span>

4,添加默认路由

# route add -net 0.0.0.0 dev ppp0 //添加默认路由

到这儿VPN就设置好了


5,启动VPN的其他命令(pon,poff)

# 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 +x /usr/sbin/pon # chmod +x /usr/sbin/poff

<span style="font-size:14px;color:#000000;">【注】出现pon poff找不到的时候执行</span>

# pon test# poff test

6,删除VPN

# pptpsetup –delete <TUNNEL>

7,用户文件信息

#cat /etc/ppp/chap-secrets# client        server  secret                  IP addresses# added by pptpsetup for testuserId test "password" *










0 0
原创粉丝点击