Wednesday, July 04, 2007

How to Setup a PPTP VPN on ubuntu 7.04 feisty

Since I'm setting up a new Ubuntu computer for work, I figured I should clarify some of my previous jumbled posts on Ubuntu setup. And so, here is my quick how to on setting up a VPN with a Windows style PPTP server.

Using synaptic package manager, install the network-manager-pptp package (which will install the needed dependencies). This package lives in the universe repository - enabled under software sources.

You need to restart the network manger now::

sudo /etc/init.d/networking restart


sudo /etc/dbus-1/event.d/25NetworkManager restart

(or just reboot)

Then clicking on the network icon in the upper
right: (in this screen cap its the blue bar icon) Choose VPN connections, configure VPN.

Use the following images as a guide, but only the indicatged settings are different from the defaults:

On the connection tab:
you need to enter a name, and type is Windows VPN (PPTP), and then enter VPN server's gateway address. Authentication tab: Refuse EAP Compression and Encryption tab: Require MPPE compression PPP options tab: Should be fine without any changes. Routing: I set this to only use the VPN for the range of IPs inside my work's private network. This may fail IF your work network does not allow split tunnels. then go under the network manger icon, and connect your new VPN. You should be prompted for your credentials:
you need to put in your credentials as: domain\username and then password .

Once you successfully connect, you should see a little key on the network manager icon:
At this point you can (usually) only connect to the IP of the vpn server - not the entire remote network.

To fix this you need
to put a script in /etc/ppp/ip-up.d
So open a terminal, and type:

cd /etc/ppp/ip-up.d

We are going to make a script called routeadd, so I just type the following:

sudo pico routeadd

then paste the following in:


route add -net netmask dev ppp0

(Where the being whatever the correct range for the remote network is)

NOTE - the #! line must be the first one in the file

then CTRL+O to write it, and CTRL+X to exit

The script must be made executable:

sudo chmod +x /etc/ppp/ip-up.d/routeadd

Now, under the network manager you should be able to connect, and browse your remote network.

1 comment: