Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. 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 have set up a VPN on a remote ubuntu machine using pptp-linux and the instructions found here.

After set up no traffic seemed to be going through the VPN and the VPN network devices were not visible (on a tested and working VPN server). This command

route add -net ppp0

maps the correct the devices correctly.

Is the following the best method for forwarding all traffic through the VPN?

route add -net ppp0
share|improve this question
Honest question: Can't you just use the PPTP module of NetworkManager? – Juliano Jun 7 '11 at 1:58
I may have misunderstood the instructions, but I think I set up the vpn manually rather then using the network-manager gui interface with pptp module. I do not want to use the gui interface because I do not have one installed on the remote machine. I found instruction/documentation for pptp-linux and not for network-manager-pptp or at least I found pptp-linux first and it worked on the first try other then it did not auto route all traffic through the vpn. If you think NetworkManager is worth another look I will dig deeper into it though. – Davorak Jun 7 '11 at 4:18
up vote 4 down vote accepted

I have no experience of PPTP Client and haven't looked at the instructions. But the command route add -net ppp0 means “route all traffic through ppp0 except the traffic that has more precise routes”. This means that

  • the loopback interface, your local network if you have one, and the route to the VPN server (which is set up, right?) will use the correct interfaces,
  • and everything else will go through the VPN.

So yes, your configuration looks correct. Does something seem to be not working?

If you're worried whether the traffic is indeed going through your VPN, one way to check is to run tcpdump -n -i eth0 (where eth0 is your Ethernet interface, you may need to change that to eth1 or wlan0 or something depending on your setup). This will show every packet going through that interface. Use your network a bit and check that the packets are all coming from or going to the VPN server.

share|improve this answer
Should have thought of using tcpdump I was using traceroute, tcpdump is much more reassuring. – Davorak Jun 7 '11 at 4:20

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.