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
  • 1
    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

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.

  • 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 clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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