CentOS 6: Install VPN PPTP Client – The Simple Way

I have a PPTP server which run on Mikrotik Routerboard and I need to connect one of my CentOS 6.3 box to this VPN to retrieve some information from internal server. The VPN account already created in PPTP server and this post will just show on how to connect from CentOS CLI box.

I will be using following variables:

Client OS: CentOS 6.3 64bit
PPTP Server: 192.168.100.1
Username: myvega
Password: CgK888ar$

1. Install PPTP using yum:

$ yum install pptp -y

2. Add the username and password inside /etc/ppp/chap-secrets:

myvega     PPTPserver     CgK888ar$    *

The format will be: [username][space][server name][space][password][space][ip address allowed]

3. Create a configuration files under /etc/ppp/peers directory called vpn.myserver.org using text editor:

$ vim /etc/ppp/peers/vpn.myserver.org

And add following line:

pty "pptp 192.168.100.1 --nolaunchpppd"
name myvega
remotename PPTPserver
require-mppe-128
file /etc/ppp/options.pptp
ipparam vpn.myserver.org

4. Register the ppp_mppe kernel module:

$ modprobe ppp_mppe

5. Make sure under /etc/ppp/options.pptp, following options are not commented:

lock
noauth
refuse-pap
refuse-eap
refuse-chap
nobsdcomp
nodeflate
require-mppe-128

6. Connect to the VPN by executing following command:

$ pppd call vpn.myserver.org

Done! You should connected to the VPN server now. Lets check our VPN interface status:

$ ip a | grep ppp
3: ppp0:  mtu 1456 qdisc pfifo_fast state UNKNOWN qlen 3
link/ppp
inet 192.168.100.10 peer 192.168.100.1/32 scope global ppp0

If you face any problem, kindly look into /var/log/message for any error regards to pppd service:

$ tail -f /var/log/message | grep ppp
Dec 4 04:56:48 localhost pppd[1413]: pppd 2.4.5 started by root, uid 0
Dec 4 04:56:48 localhost pptp[1414]: anon log[main:pptp.c:314]: The synchronous pptp option is NOT activated
Dec 4 04:56:48 localhost pptp[1420]: anon log[ctrlp_rep:pptp_ctrl.c:251]: Sent control packet type is 1 'Start-Control-Connection-Request'
Dec 4 04:56:48 localhost pppd[1413]: Using interface ppp0
Dec 4 04:56:48 localhost pppd[1413]: Connect: ppp0  /dev/pts/1
Dec 4 04:56:48 localhost pptp[1420]: anon log[ctrlp_disp:pptp_ctrl.c:739]: Received Start Control Connection Reply
Dec 4 04:56:48 localhost pptp[1420]: anon log[ctrlp_disp:pptp_ctrl.c:773]: Client connection established.
Dec 4 04:56:49 localhost pptp[1420]: anon log[ctrlp_rep:pptp_ctrl.c:251]: Sent control packet type is 7 'Outgoing-Call-Request'
Dec 4 04:56:49 localhost pptp[1420]: anon log[ctrlp_disp:pptp_ctrl.c:858]: Received Outgoing Call Reply.
Dec 4 04:56:49 localhost pptp[1420]: anon log[ctrlp_disp:pptp_ctrl.c:897]: Outgoing call established (call ID 0, peer's call ID 137).
Dec 4 04:56:49 localhost pppd[1413]: CHAP authentication succeeded
Dec 4 04:56:49 localhost pppd[1413]: MPPE 128-bit stateless compression enabled
Dec 4 04:56:50 localhost pppd[1413]: local IP address 192.168.100.10
Dec 4 04:56:50 localhost pppd[1413]: remote IP address 192.168.100.1

To disconnect the VPN, just kill the pppd process:

$ killall pppd

10 thoughts on “CentOS 6: Install VPN PPTP Client – The Simple Way

  1. 可以连接上 就是我的ip 并没有发生变化 还是原来的

    Reply

    1. I am sorry as I do not understand this. From Google translate it seems like you are having problem on connecting to PPTP server?

      Reply

  2. Thanks for the great tut, But when I want to connect, I get :
    $ pppd call vpn.myserver.org

    I get this :

    Couldn't open the /dev/ppp device: Permission denied
    pppd: Sorry - this system lacks PPP kernel support

    What Can I do?

    I have Centos 6.

    Reply

    1. What is your kernel version? Is it a virtual machine? if yes, what type of virtual machine is it?

      Reply

  3. I also had to add the line below to the routing table, otherwise I could not access anything through the VPN.
    # route -A inet add -net 192.168.###.### netmask 255.255.###.### dev ppp0

    Thanks for this quick guide, worked well in 6.5

    Reply

  4. Nice! good post!

    I’m using CentOS 6. Not quite sure what’s the usage on “4. Register the ppp_mppe kernel module:” It shows me “FAIAL: Module ppp_mppe not found.”

    beer545 is right, can’t connect without route add.

    And how to make it auto-connect when bootup?

    Thanks!

    Reply

  5. I got these errors:
    Jan 5 09:24:25 hostname pppd[3644]: pppd 2.4.5 started by root, uid 0
    Jan 5 09:24:25 hostname pppd[3644]: Using interface ppp0
    Jan 5 09:24:25 hostname pppd[3644]: Connect: ppp0 /dev/pts/2
    Jan 5 09:24:25 hostname pptp[3645]: anon log[main:pptp.c:314]: The synchronous pptp option is NOT activated
    Jan 5 09:24:25 hostname pptp[3653]: anon log[ctrlp_rep:pptp_ctrl.c:251]: Sent control packet type is 1 ‘Start-Control-Connection-Request’
    Jan 5 09:24:25 hostname pptp[3653]: anon log[ctrlp_disp:pptp_ctrl.c:739]: Received Start Control Connection Reply
    Jan 5 09:24:25 hostname pptp[3653]: anon log[ctrlp_disp:pptp_ctrl.c:773]: Client connection established.
    Jan 5 09:24:26 hostname pptp[3653]: anon log[ctrlp_rep:pptp_ctrl.c:251]: Sent control packet type is 7 ‘Outgoing-Call-Request’
    Jan 5 09:24:26 hostname pptp[3653]: anon log[ctrlp_disp:pptp_ctrl.c:858]: Received Outgoing Call Reply.
    Jan 5 09:24:26 hostname pptp[3653]: anon log[ctrlp_disp:pptp_ctrl.c:897]: Outgoing call established (call ID 0, peer’s call ID 128).
    Jan 5 09:24:27 hostname pppd[3644]: MS-CHAP authentication failed:
    Jan 5 09:24:27 hostname pppd[3644]: CHAP authentication failed
    Jan 5 09:24:27 hostname pppd[3644]: Connection terminated.
    Jan 5 09:24:27 hostname pptp[3645]: anon warn[decaps_hdlc:pptp_gre.c:204]: short read (-1): Input/output error
    Jan 5 09:24:27 hostname pptp[3645]: anon warn[decaps_hdlc:pptp_gre.c:216]: pppd may have shutdown, see pppd log
    Jan 5 09:24:27 hostname pptp[3653]: anon log[callmgr_main:pptp_callmgr.c:234]: Closing connection (unhandled)
    Jan 5 09:24:27 hostname pptp[3653]: anon log[ctrlp_rep:pptp_ctrl.c:251]: Sent control packet type is 12 ‘Call-Clear-Request’
    Jan 5 09:24:27 hostname pptp[3653]: anon log[call_callback:pptp_callmgr.c:79]: Closing connection (call state)
    Jan 5 09:24:27 hostname pppd[3644]: Exit.

    and I am sure that my username and password is correct.

    Reply

  6. Another time ,I got these:
    Jan 5 09:31:39 hostname pppd[3687]: pppd 2.4.5 started by root, uid 0
    Jan 5 09:31:39 hostname pppd[3687]: Using interface ppp0
    Jan 5 09:31:39 hostname pppd[3687]: Connect: ppp0 /dev/pts/2
    Jan 5 09:31:39 hostname pptp[3688]: anon log[main:pptp.c:314]: The synchronous pptp option is NOT activated
    Jan 5 09:31:39 hostname pptp[3691]: anon warn[open_inetsock:pptp_callmgr.c:329]: connect: Connection refused
    Jan 5 09:31:39 hostname pptp[3691]: anon fatal[callmgr_main:pptp_callmgr.c:127]: Could not open control connection to 192.168.1.101
    Jan 5 09:31:39 hostname pptp[3688]: anon fatal[open_callmgr:pptp.c:479]: Call manager exited with error 256
    Jan 5 09:31:39 hostname pppd[3687]: Modem hangup
    Jan 5 09:31:39 hostname pppd[3687]: Connection terminated.
    Jan 5 09:31:39 hostname pppd[3687]: Exit.

    and ping IP 192.168.1.101, seems all normal
    64 bytes from 192.168.1.101: icmp_seq=1 ttl=50 time=216 ms
    64 bytes from 192.168.1.101: icmp_seq=2 ttl=50 time=207 ms

    Reply

  7. I do it.But I cann’t connect the VPN,my wireless IP is 192.168.8.2.In the route ,I have four Ifra wlan0,lo,ppp0,wlan0.The win7 and android can connect it.I don’t know how to connect ,please help!Thanks!

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *