Friday, August 21, 2020

How to SETUP PPTP CLIENT in LINUX

 How to Setup PPTP Client on CENTOS 7


VPN


The Point-to-Point Tunneling Protocol (PPTP) is a method for implementing virtual private networks. Since it is marked as non secure and vulnerable, I don’t recommend it as a “final” VPN solution. The main reason for its popularity is probably the native MS Windows support (since win 95). Also, it can be easily implemented with Mikrotik RouterOS (like I said, use it for internal VPNs only).

To set up your CentOS 7 as a PPTP clients you will need the pptp package.

 [root@linggeh /]#yum install -y pptp

Open /etc/ppp/chap-secrets and add the next line (at the end). Also, replace the UserName and password with the correct details:

 [root@linggeh /]# nano /etc/ppp/chap-secrets

userName     PPTP     password     *
linggeh         PPTP     123123      *

Create profile file

 [root@linggeh /]# nano /etc/ppp/peers/myVPN

and paste the next content (replace IP_OR_HOSTNAME with PPTP server IP or Hostname)

pty "pptp IP_OR_HOSTNAME --nolaunchpppd"
name userName
remotename PPTP
require-mppe-128
file /etc/ppp/options.pptp
ipparam myVPN

Save the file and test the connection with

 
[root@linggeh /]#pppd call myVPN


ifconfig should return something like

....
ppp0      Link encap:Point-to-Point Protocol  
          inet addr:10.16.18.252  P-t-P:10.16.18.251  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1436  Metric:1
          RX packets:14 errors:0 dropped:0 overruns:0 frame:0
          TX packets:15 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3 
          RX bytes:2192 (2.1 KiB)  TX bytes:631 (631.0 b)
...
If you check your routes, you’ll probably notice that ppp0 connection is not used by any route(s). This is default behavior and you can easily switch/add default route with:

route add default dev ppp0

In my case, I don’t want to route the complete traffic (this VPN is just for management) so I’ll add only one static route

route add -net 192.168.0.0/16 dev ppp0

To start this connection on boot, add “pppd call myVPN” in rc.local.

Thank for Reading *-*



Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna Veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.

0 comments:

Post a Comment

Start Work With Me

Contact Us
JOHN DOE
+123-456-789
Melbourne, Australia