Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 12-29-2009, 03:22 AM   #1
Farrukh Fida
Registered: Jun 2006
Location: Dubai
Distribution: Cent OS
Posts: 34

Rep: Reputation: 15
PPTP VPN client


I need to connect my Linux machine to PPTP VPN server(windows 2003 based).
So I need to setup PPTP-client which I've download from
according to it I've configured following

vi /etc/ppp/chap-secrets

# Secrets for authentication using CHAP
# client server secret IP addresses

username pptp password *

vi /etc/ppp/peers/mycreated-file

pty "pptp myVPNserverIP --nolaunchpppd"
name username
remotename pptp
file /etc/ppp/options.pptp
ipparam mycreated-file

vi /etc/ppp/options.pptp

lock noauth nodeflate nobsdcomp

but when I called
pppd call my-connection-name

it shows following error.

Using interface ppp0
Dec 29 11:59:36 pppd[5718]: Connect: ppp0 <--> /dev/pts/4
Dec 29 11:59:36 pppd[5718]: Modem hangup
Dec 29 11:59:36 pppd[5718]: Connection terminated.
Dec 29 11:59:36 pppd[5718]: Exit.

I'm using following configuration for windows client and it is successfully connected.
Click image for larger version

Name:	1.jpg
Views:	32
Size:	80.3 KB
ID:	2357
Old 12-29-2009, 07:25 AM   #2
Registered: May 2006
Location: BE
Distribution: Debian/Gentoo
Posts: 412

Rep: Reputation: 48
This might be a better documentation for you:

They have a very good troubleshooting section.

Last edited by eco; 12-29-2009 at 07:27 AM. Reason: more info
Old 12-29-2009, 09:20 AM   #3
Farrukh Fida
Registered: Jun 2006
Location: Dubai
Distribution: Cent OS
Posts: 34

Original Poster
Rep: Reputation: 15
Thanks for reply.
I've also installed PPTP client in webmin. And I can create vpn connection
But I don't know what options should I choose in webmin which is same as Microsoft's typical(recommended setting).

Click image for larger version

Name:	security.JPG
Views:	46
Size:	29.5 KB
ID:	2359

How I set same option (as in above picture)in webmin?

Please help
Old 01-01-2010, 08:15 AM   #4
Registered: May 2006
Location: BE
Distribution: Debian/Gentoo
Posts: 412

Rep: Reputation: 48
Sorry for the slow reply, I have no internet at home thanks to Belgium's useless providers.

Here is a copy paste of my Wiki notes. I had these settings working for A Linux server and windows and unix clients.

Hope this helps.


From Ed's wiki
Jump to: navigation, search

* 1 Intro
* 2 Kernel Setup
* 3 Install programs
* 4 Server
o 4.1 Specs
o 4.2 Firewall rules
* 5 Client
o 5.1 Linux config
+ 5.1.1 Routing
+ 5.1.2 debug
o 5.2 Wintendo Config
* 6 source

[edit] Intro

We are lucky 'cause it seems the kernel just integrated PPTP and we won't have to patch nor wait for a patch to upgrade the kernel.

I'd like to thank the developers for their great effort.

All of the following information is taken directly from the Homepage of PPTPClient.
[edit] Kernel Setup

* Install a kernel 2.6.15 or above. Taht way you won't have to patch it with MPPE and pppd won't have to have the flag enabled either.

Code: Install kernel sources

# emerge -av sys-kernel/gentoo-sources

Time to make sure you kernel supports PPPTP Template:Box Kernel

Then you can add the following modules to /etc/modules.autoload.d/kernel-2.6


[edit] Install programs

* Install pppd and pptpd

PPPd comes with MPPE now so there is no need for the mppe-mppc flag any more. To make sure, you can always try the following.
Code: Check support for MPPE support

# strings `which pppd`|grep -i mppe|wc --lines

Code: Install PPP and PPTP

# emerge -av net-dialup/ppp net-dialup/pptpd

[edit] Server
[edit] Specs

Kernel 2.6.16-gentoo-r9 with pptpd-1.2.3-r1 and ppp-2.4.2-r15

* configure the kernel as done bellow

Then you can add the following modules to /etc/modules.autoload.d/kernel-2.6


edit /etc/pptpd.conf
File: /etc/pptpd.conf

option /etc/ppp/options.pptpd

Secure /etc/ppp
Code: Secure the directory ppp

chmod 700 /etc/ppp

Setup /etc/ppp/options.pptpd
File: /etc/ppp/options.pptpd

name bkupvpn

Setup /etc/ppp/chap-secrets
File: /etc/ppp/chap-secrets

ecosta01 bkupvpn ecosta
sandro01 bkupvpn sandro
tsaka01 bkupvpn tsaka

Start the service
Code: Start PPTP

# /etc/init.d/pptpd start

[edit] Firewall rules

If you have iptables running, we'll need to add statements for that.
Code: Firewall rules

iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
iptables -A FORWARD -i eth1 -o ppp0 -s -m state --state NEW -j ACCEPT

[edit] Client
[edit] Linux config

Setup the file which will hold the password
File: /etc/ppp/chap-secrets

ecosta01 bkupvpn ecosta *

Now setup the file with all the details you will need to connect
File: /etc/ppp/peers/vpn

pty "pptp mytux --nolaunchpppd"
name ecosta01
remotename bkupvpn
file /etc/ppp/options.pptp
ipparam vpn

Code: connect to the VPN Server, then disconnect

# pon mytux
# poff mytux

[edit] Routing

We need to add a route for things to work properly.
Code: create a route for the new ip range

# route add -net dev ppp0

Add this to ip-up also.
Code: automate route command on connection

# echo 'route add -net dev ppp0' >> /etc/ppp/ip-up

[edit] debug

If you can't ping the other side, you can start pppd with logging to see what's going on.

pppd call my_peer logfd 2 nodetach debug dump

[edit] Wintendo Config

Go to your Windows client (XP Pro in my case) and open "Network Connections."

* Start the "New Connection Wizard." Choose "connect to the network at my workplace" ->
* Choose "Virtual Private Network connection" ->
* Enter a name for your connection ->
* Enter the hostname of the VPN server ->
* Click finish.

* Go to the properties of this new connection. Click on the "Networking" tab ->
* Double click on "Internet Protocol (TCP/IP)" ->
* Click on "Advanced..." ->
* Untick "Use default gateway on remote network."

This will prevent all your Internet traffic from running through the VPN server (not necessary to do this, but I do). Now for the real moment of truth. Trying to connect...
[edit] source

* PPTPClient
* Gentoo Forum
* PHP Architecture

1 members found this post helpful.
Old 01-17-2010, 01:53 AM   #5
Farrukh Fida
Registered: Jun 2006
Location: Dubai
Distribution: Cent OS
Posts: 34

Original Poster
Rep: Reputation: 15
Hi thanks for the help.

I've successfully connected to my PPTP server (windows 2003)using Linux.
Now problem is my VPN connection disconnect after some time, I read on some where that I should put 'persist' in /etc/ppp/options.pptp

mtu 1000
mru 1000
lcp-echo-failure 10
lcp-echo-interval 10

So I put persist. Now it is connected successfully and each and everything working fine until disconnect, once it is disconnect it shows PPTP is connected but nothing is working. I check ifconfig but it doesn't shows any PPP interface.

I try to disconnect PPTP tunnel but no success except I comment persist option.

Is there any way it redials once disconnected.

Thank you.
Old 01-17-2010, 08:32 AM   #6
Registered: Sep 2009
Location: Russia
Distribution: Gentoo, LFS
Posts: 399
Blog Entries: 71

Rep: Reputation: 65

++ same problem here...
i use this ugly hack(i know...) on my router:
if [ -x "/proc/`cat /var/run/`" ]; then
	#bad check. also need to check is it really pppd. will be added later. i think it's good for now.

#additional iface check
ifc=`tail -n 1 /proc/net/dev | grep ppp0 | wc -l`
if [ $ifc = 1 ]; then
	#interface seem to be up still though connection PID doesn't exist.

echo "PPTP Connection Daemon Failed. Restating pppd..."
pon vpn1
that shell script is added to crontab, runs every 1 minute. i got my hands full by now, so i'm still not came up to make a daemon on perl or python, that will be testing connection and reconnect once dropped... :/
because, actlually, that script needs to load shell, grep, wc and tail, which takes time and results in performance decreasing: so a better way it to have it all in RAM with static memory usage. Maybe I will write that on C someday

Last edited by Web31337; 01-17-2010 at 08:34 AM.
Old 01-28-2010, 02:02 AM   #7
Farrukh Fida
Registered: Jun 2006
Location: Dubai
Distribution: Cent OS
Posts: 34

Original Poster
Rep: Reputation: 15

I write following script.


TEST=$(ifconfig | grep "ppp")

if [ -z "$TEST" ]
pptp call testVPN_original

echo $TEST


echo $YY
echo $SUB
if [ $SUB == $YY ];
ping -c 2
route add default gw

This script I run after 2mins. 1st it checks that ifconfig has something like ppp if it has ppp means VPN is it just ping to other end(keep alive). If ifconfig not has ppp it dials PPTP using "pptp call testVPN_original"

I've tested that whenever VPN is down, it takes hardly 6 min to back online each and every thing.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Linux Configure point to point tunneling PPTP VPN client for Microsoft PPTP vpn server LXer Syndicated Linux News 0 06-13-2007 08:46 AM
vpn pptp client sameer666 Solaris / OpenSolaris 2 09-15-2006 04:44 AM
How to install vpn - client (pptp) for Linux. vadimkovalev Linux - Networking 1 09-30-2005 01:42 AM
Problem with installation of a VPN - PPTP client l2g Linux - Networking 1 12-24-2004 01:37 AM
use of pptp client to access vpn krish87 Linux - Networking 0 08-20-2004 01:32 PM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 12:46 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration