Dec 25, 2012

Install VPN PPTP Client on CentOS release 6

This short article will just show you how to connect VPN Server from CentOS CLI through VPN client.

I will be using following variables:
Client OS: CentOS 6.3 64bit
VPN Server: 192.168.100.1
Username: client1
Password: cl!ent1$


1. Install PPTP using yum:
yum install pptp -y
 
2. Add the username and password inside /etc/ppp/chap-secrets:
client1     VPN-Server     cl!ent1$    *

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 client1
remotename VPN-Server
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

To disconnect the VPN, just kill the pppd process:
killall pppd

Post a Comment

 
TECH SUPPORT © 2012-2016