This short article will just show you how to connect VPN Server from CentOS CLI through VPN client.
I will be using following variables:
1. Install PPTP using yum:
2. Add the username and password inside /etc/ppp/chap-secrets:
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:
And add following line:
4. Register the ppp_mppe kernel module:
5. Make sure under /etc/ppp/options.pptp, following options are not commented:
6. Connect to the VPN by executing following command:
Done! You should connected to the VPN server now. Lets check our VPN interface status:
If you face any problem, kindly look into /var/log/message for any error regards to pppd service:
To disconnect the VPN, just kill the pppd process:
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
|
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
No comments: