centos 6.8 命令行下可使用pptpsetup進行pptp撥號
1.先安裝ppp,pptp和pptp-setup三個包
yum install -y ppp pptp pptp-setup
2.使用pptpsetup進行連接
pptpsetup --create VPN名字 --server 服務器IP --username 用戶名 --password 密碼 --encrypt --start
[root@centos6-8-1 ~]# pptpsetup --create vpn --server 192.168.127.128 --username user --password passwd --encrypt --startUsing interface ppp0Connect: ppp0 <--> /dev/pts/2CHAP authentication succeededMPPE 128-bit stateless compression enabledlocal IP address 192.168.0.235remote IP address 192.168.0.1
使用ip addr可以看到多了一個接口ppp0:
[root@centos6-8-1 ~]# ip addr1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo inet6 ::1/128 scope host valid_lft forever preferred_lft forever2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000 link/ether 00:0c:29:27:eb:e7 brd ff:ff:ff:ff:ff:ff inet 192.168.127.129/24 brd 192.168.127.255 scope global eth0 inet6 fe80::20c:29ff:fe27:ebe7/64 scope link valid_lft forever preferred_lft forever4: ppp0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1496 qdisc pfifo_fast state UNKNOWN qlen 3 link/ppp inet 192.168.0.235 peer 192.168.0.1/32 scope global ppp0
3.添加默認路由
route add default dev ppp0
此時已經可以正常使用VPN。
如果想斷開pptp連接,那就直接結束pptp進程
pkill pptp
http://xxxxxx/Linuxjc/1184653.html TechArticle