Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using vyprvpn as a VPN provider and I would like to make my Ubuntu 12.04 server connect to it via pptp-linux. I only have the option of using the command line to connect so I used this guide:

And it seems to work, but, I don't think I'm sending my data through the connection. My server has a static IP and I tried putting that IP in the settings. I'm trying w3m on ipchicken and not noticing any changes. How do I make sure its traffic is going through the VPN?

Once this works, how do I make the VPN client connect automatically whenever it has internet?

Cheers (finally, as a bonus, how do I update my nameservers? Will it work with the VPNs address?)

share|improve this question
up vote 0 down vote accepted

I've mostly solved this except for making the VPN start when the computer does, but here is my solution.

I originally was using the link above, but after a week of learning and mucking about, I have my own solution using the link above as a starting point (thanks Eliah for reminding me)

So, following the link above, I installed pptp-linux and then I edited /etc/ppp/peers/vpnconfigname to this:

sudo nano /etc/ppp/peers/vpnconfigname
pty "pptp vpndomain --nolaunchpppd"
ipparam vpnname
remotename vpnname
name vpnuser

then in this /etc/ppp/chap-secrets:

sudo nano /etc/ppp/chap-secrets
# Secrets for authentication using CHAP
# client        server  secret                  IP addresses
vpnusername        *    vpnpassword            *

Finally to make it run on boot edit /etc/rc.local:

sudo nano /etc/rc.local
#!/bin/sh -e
# rc.local
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
# In order to enable or disable this script just change the execution
# bits.
# By default this script does nothing.

pon vpnconfigname 
exit 0

Now start it with sudo pon vpnconfigname (whatever the file is called at /etc/ppp/peers/ ) stop it with sudo poff vpnconfigname If you need debug, add it to the config file before launching. Once it's on, you can use ifconfig and route to check if it's connected, then I use tracepath and w3m to check if I'm going through the vpn or not.


share|improve this answer
Welcome to Ask Ubuntu! Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference. – Eliah Kagan Oct 4 '12 at 5:14

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.