Configuracion PPTP Client Linux
Configuracion PPTP Client Linux
connection on CENTOS/RHEL 7
Linux
22 August 2018 by Admin
This guide will discuss a procedure on how to connect/establish a VPN
connection using PPTP protocol on CentOS 7 or Redhat 7 Linux the
non-GUI way. Below you can find connection details which will be
used as an example. Replace the bellow PPTP VPN information to
align with your PPTP VPN server settings:
In the next step we will load a connection tracking support for PPTP
module which is required in order to correctly establish PPTP VPN
connection:
# modprobe nf_conntrack_pptp
name admin
remotename PPTP
require-mppe-128
file /etc/ppp/options.pptp
ipparam linuxconfig
# ip a s
...
link/ppp
# pkill pppd
Troubleshooting
If you receive a below error message when following
a /var/log/messages log:
# modprobe nf_conntrack_pptp
3 (679 votes)
Recently i faced the problem of connecting two LANs using PPTP and an
intermediate PPTP server. I had to use this approach because the network setup
was such that none of the LAN routers (DD-WRT) could contact the other but both
could contact an intermediate server.
In order to achieve this PPTP clients must be always assigned the same IP and
when connected, routes to each LAN must be added to the routing table of the
intermediate server.
Network setup
LAN 1 172.16.3.64/26
LAN 2 172.16.3.128/26
PPTP Clients and server
This way each client (router) gets always the same IP. Make sure that these static
IPs are not in the PPTP client IP range.
Then setup DD-WRT PPTP clients to connect to the intermediate server:
intermediate.example.com
Remote Subnet
172.16.4.0
255.255.255.0
MPPE Encryption
mppe required,no40,no56,stateless
The final step is to add a route to each router's LAN when it connects.
There is a file for running commands when PPP goes up or down. On CentOS it is
located at /etc/ppp/ip-up.local or /etc/ppp/ip-up
Adding the following lines does the trick:
#!/bin/bash
case "$5" in
172.16.4.200)
/sbin/route add -net 172.16.3.64/26 gw 172.16.4.200
;;
172.16.4.201)
/sbin/route add -net 172.16.3.128/26 gw 172.16.4.201
;;
*)
esac
Argument Description
cat >/etc/firewalld/services/pptp.xml<<EOF
<service>
</service>
EOF
firewall-cmd --reload