centos pptp客户端 连接服务端
centos 7 命令行下可使用pptpsetup进行pptp拨号,首先安装ppp,pptp和pptp-setup三个包,使用pptpsetup进行连接。
1. 安装ppp,pptp,pptp-setup
# yum install ppp pptp pptp-setup -y
2. 使用pptpsetup进行连接
pptpsetup --createVPN名字 --server VPNip --username username --password password --encrypt --start
# pptpsetup --create vpn --server xxxx --username xxxx --password xxxx --encrypt --start
Connect: ppp0 <--> /dev/pts/1
CHAP authentication succeeded
MPPE 128-bit stateless compression enabled
local IP address 192.168.160.13
remote IP address 192.168.160.10
3. 查看是否创建成功
使用ifconfig
命令,可以看到会多了一个ppp0
网口
# ifconfig
ppp0: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST> mtu 1396
inet 192.168.160.13 netmask 255.255.255.255 destination 192.168.160.10
ppp txqueuelen 3 (Point-to-Point Protocol)
RX packets 18 bytes 792 (792.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 9 bytes 90 (90.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
4. 添加默认路由
# route add default dev ppp0
5. 测试是否连上服务端
# ping xx.xx.xx.xx
6. 断开连接
# pkill pptp
7. 遇到的问题
# pptpsetup --create vpn --server xxxx --username xxxx --password xxxx --encrypt --start
Using interface ppp0
Connect: ppp0 <--> /dev/pts/1
EAP: unknown authentication type 26; Naking
EAP: peer reports authentication failure
Connection terminated.
解决方法:
# vim /etc/ppp/options
refuse-pap
refuse-eap
refuse-chap
refuse-mschap
require-mppe