I have PC2 connected to a VPN (L2TP/IPsec) server I have setup on R2. I need PC2 to be able to ping PC3 and PC4, but it's not working. When I use a Windows machine to connect to the VPN I can ping hosts under R2, but that is not the case with my Linux machine (Raspbian Jessie). I believe the solution has to do with the routing table but I have no idea what I am doing there.

I know that I am connected to R2 from PC2 because when I type into the browser I am greeted with the remote router's login screen.

Networking diagram

PC2 is under R1, and it is under R2. The public IP for R2 is Here is the current routing information:

root@raspberrypi:/home/pi# ip route show
default dev ppp0  scope link
default via dev wlan0  metric 303 via dev wlan0 dev wlan0  proto kernel  scope link  src  metric 303 dev ppp0  proto kernel  scope link  src

What do I need to do in order to get PC2 to be able to ping the hosts under R2?


This looks a mess! First things first, routers connect different networks together. As a simplification, if things are on the same network then they should be able to talk to each other directly. You have 2 networks The simplest solution would be to renumber one of them (PC1, PC2, R1) to be

Let us say that PC3 is on

The reason it is a problem is that you have 3 rules for how to get to PC3, one of them because it matches the and two because it matches the default rules which could also be written (once via the ppp0 interface (the tunnel) and once via the wlan0 interface).

The rules are ranked in order, because 24 is more than 0 it is more specific, and hence is used.

So this routing table says that PC2 can communicate directly with PC3 via the wlan0 interface. so when you ping PC3 it uses your wireless card.

If you renumbered PC1, PC2 and R1 to be on the network then the rules for where PC2 become much simpler. If the packet has to go to, then send it via wlan0, otherwise send it to via ppp0.

To get to there are 4 choices via ppp0, via wlan0, via wlan0 and via ppp0. The /32 route is the most specific and hence is chosen, which explains why you see R2.

You could add extra routes for PC3 and PC4, something like

ip route add dev ppp0
ip route add dev ppp0

and hope that R2 sorts things out enough to enable packets to come back, but renumbering is much simpler.

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.