Dial pptp under centos 6.8 command line
Pptpsetup can be used for pptp dialing under centos 6.8 command line
1. install three packages: ppp, pptp, and pptp-setup.
Yum install-y ppp pptp-setup
2. Use pptpsetup for connection
Pptpsetup -- create VPN name -- 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
Using ip addr, you can see an additional interface 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. Add a default route
Route add default dev ppp0
Now you can use VPN normally.
If you want to disconnect the pptp connection, end the pptp process directly.
Pkill pptp