# [SOLVED] Why does this routing table work?

## Shining Arcanine

My university requires that all users connecting through the campus wireless either use a http interface (all http requests are redirected it) to authenticate for limited access (i.e. basic web browsing and one other minor thing) or a VPN connection for full access (i.e. it lets me connect to IRC, do rsync updates, etcetera). Last semester, I could connect to the VPN using pon <name>. This semester, I could not. Everything indicated that things should work and the only thing I could conceive of being the issue was the routing table, which looked like the following:

 *Quote:*   

> # route
> 
> Kernel IP routing table
> 
> Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
> ...

 

I had been banging my head over this for the past few days and finally went to the following guide:

http://pptpclient.sourceforge.net/routing.phtml#all-to-tunnel

I had been using really simple scripts that worked for me last semester. My ip-up script was route add default dev $1 and my ip-down script was route del default. I replaced these scripts with the scripts recommended at the official site, changing the variables to match my university's configuration and now all of a sudden the VPN connection works. The routing table after doing this is the following:

Kernel IP routing table

 *Quote:*   

> Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
> 
> <pptp host> *               255.255.255.255 UH    0      0        0 wlan0
> 
> <pptp host> *               255.255.255.255 UH    0      0        0 ppp0
> ...

 

What is the difference between these two routing tables that makes the first one work, but the second one fail? I had reverted various software (i.e. kernel to 2.6.33, pptpd, pppclient and NetworkManager to 0.8-r1) involved with the networking stack back to the versions I was using last semester (although not all at the same time) and the routing table configuration that my ip-up script made still did not work. still did not work, back to kernel 2.6.33, which I had been using at the end of last semester and the original routing table configuration still failed to work.Last edited by Shining Arcanine on Fri Sep 03, 2010 12:29 pm; edited 1 time in total

----------

## NeddySeagoon

Shining Arcanine,

Both routing tables are broken - its just luck the first one works.  

In the first one you have

```
default * 0.0.0.0 U 0 0 0 ppp0

default <http authentication host> 0.0.0.0 UG 303 0 0 wlan0
```

You can't usefully gave two default routes - only the first one in the routing table will be used.

In your second routing table you have

```
Destination Gateway Genmask Flags Metric Ref Use Iface

<pptp host> * 255.255.255.255 UH 0 0 0 wlan0

<pptp host> * 255.255.255.255 UH 0 0 0 ppp0 
```

so all packets to <pptp host> will be sent over wlan0, which not what you want according to your first routing table.

You need to remove  <pptp host> * 255.255.255.255 UH 0 0 0 wlan0 from the second routing table.

Hint:  Using code tags preserves white space. It makes routing tables much easier to read.

----------

## Shining Arcanine

 *NeddySeagoon wrote:*   

> Shining Arcanine,
> 
> Both routing tables are broken - its just luck the first one works.  
> 
> In the first one you have
> ...

 

My university requires that all traffic go through ppp0, whose encrypted traffic must be sent over wlan0, so directing the tunnel through wlan0 was what I wanted and the second routing table is the one that worked. I now realize that the packets to ppp0 were being sent over itself, which created a black hole. I feel somewhat silly now that I understand the syntax of the routing table.

Thankyou for your information.

----------

