configure pptp client on centos7 to connect vpn

  • install ppp pptp pptp-setup
    # yum install ppp pptp pptp-setup
  • create vpn connect
    # pptpsetup --create vpnName --server vpnServerIPOrDomain --username vpnUserName --password vpnUserPassword --start
  • if error like this:
1
2
FATAL: Module ppp_mppe not found.  
/usr/sbin/pptpsetup: couldn't find MPPE support in kernel.
  • solution:
    # modprobe ppp_mppe
  • connect to vpn server
    # pppd call vpnName
  • if error like this:
1
2
3
4
5
Using interface ppp0  
Connect: ppp0 <--> /dev/pts/3
CHAP authentication succeeded
LCP terminated by peer (MPPE required but peer refused)
Modem hangup
  • solution:
1
2
3
# vi /etc/ppp/peers/vpnName // vpnName is the connection above created
add following configuration at the end of this file:
require-mppe-128
  • recall vpn connect command
    # pppd call vpnName

if vpn connected successfully, we will get a virtual network interface named ppp0, like this:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# ifconfig -a
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.2 netmask 255.255.255.0 broadcast 10.161.63.255
ether 00:16:3e:02:2a:aa txqueuelen 1000 (Ethernet)
RX packets 4219 bytes 4656497 (4.4 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 2291 bytes 179470 (175.2 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

ppp0: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST> mtu 1496
inet 172.16.36.2 netmask 255.255.255.255 destination 172.16.36.1
ppp txqueuelen 3 (Point-to-Point Protocol)
RX packets 8 bytes 228 (228.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 8 bytes 234 (234.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
  • Disconnect from VPN PPTP
    pkill pppd