Create a PPTP VPN connection on Fedora 9

In many companies, they use Windows PPTP VPN servers because they are easy to set up. However, there isn’t a native support for this protocol in NetworkManager. Ever wondered how to create a PPTP VPN with Fedora 9? It’s actually not that complicate once you know how to do it.

First of all, switch to user root and install the pptp package, which provides all the tools needed to create a PPTP VPN connection:

su -
yum install pptp

Now create a configuration file for your connection in /etc/ppp/peers. You can give it the name you want, we’ll call it myvpn.

vim /etc/ppp/peers/myvpn

In this file, insert all the configuration options to create a persistent connection. Replace VPN_URI with an URL or IP address of your VPN server, USER with your VPN username and set the connection name you want with remotename directive. Read man pppd for further options:

pty "pptp VPN_URI --nolaunchpppd"
require-mppe-128
persist
maxfail 0
name USER
remotename myvpn
file /etc/ppp/options.pptp
logfile /var/log/vpn.log

Now you need to set the login information needed by your CHAP-based VPN:

vim /etc/ppp/chap-secrets

Insert your username and password in this file, before the (begin) line, in the form:

USER   remotenane   password

Then you’re done if you connect to an MSCHAP-2 server, simply type:

pppd call myvpn

You can watch the /var/log/vpn.log file for help if it doesn’t connect, and ifconfig to see if it has successfully established a connection. You may have to alter routes depending on your network configuration, but the link is established now. To disconnect, type:

killall pppd (there is probably a more elegant solution)

It may display some junk on your screen during some seconds, but it will disconnect after that.

This entry was posted in Fedora. Bookmark the permalink.

6 Responses to Create a PPTP VPN connection on Fedora 9

  1. Hien Nguyen says:

    Hello,
    I’ve tried for a long time setting up the VPN connection using the add/remove software option. It look like all that option did was the ‘yum install’ step you described (When I tried the YUM, it said ‘nothing to do’). The connection never worked, and I was off on the wrong tract, since SeLinux always blocked something so I thought that was the reason the connection failed. I ended up chasing the ‘SeLinux’ problem. The rest of your instructions helped me going through the setup as a breze. Setting up the routes is a must. I wasn’t sure exactly what need to be done but after looking at the routes for the VPN connection on the Windows box it became pretty obvious.

    Thanks a millions!

  2. Steven says:

    Note that since Fedora 10, you can install NetworkManager-pppt that will do exactly the same, graphically.

  3. Zarteg says:

    What repo are you using for NetworkManager-pppt?

    I don’t seem to be able to find it.

    Bah. I hate click and drool anyway.

    Thanks for yet another accurate and easy to understand tutorial!

  4. Steven says:

    Ah, it was a typo, it’s NetworkManager-pptp in the standard Fedora 10 repository.

    [Steven@x301 ~]$ yum search NetworkManager-pptp
    NetworkManager-pptp.x86_64 : NetworkManager VPN integration for pptp
    knetworkmanager-pptp.x86_64 : knetworkmanager pptp client

  5. I tried to setup my network with NetworkManager, but without any luck. After reboot, wired connection disappeared every time … I read about buggy NetworkManager in Fedora Core 10. Finally I turned off NetworkManager with chkconfig and uncheck Controlled by NetworkManager in system-config-network. Now I start VPN connection from command line and it works: pppd starts, routes add and I have VPN – voila :)

  6. Mladen says:

    Hello,

    I’m using Fedora 10 and I installed the following applications:

    NetworkManager-pptp
    pptp

    After installation it took me only minute to establish stable and good VPN connection.
    My Wireless connection is still up and running, but Ethernet interface eth0 – I’m not sure, because I’m not using it and don’t have place to try it.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>