# Problem with routing, causing endless loop

## matrixer

Hi

I have used a PPTP connection for a while and routed all traffic in the VPN , it has worked flawless for quite some time. But yesterday a new problem showed up when I rebooted the server.

When I prompt 

```
route add default ppp0
```

 it seams that a loop is created and after just 2 minutes the connections is broken. These outputs are just 3 seconds in between. 

```
ppp0: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST>  mtu 996

        inet 5.254.149.xxx  netmask 255.255.255.255  destination 5.254.149.1

        ppp  txqueuelen 3  (Point-to-Point Protocol)

        RX packets 6  bytes 78 (78.0 B)

        RX errors 0  dropped 0  overruns 0  frame 0   

        TX packets 181207  bytes 64872610 (61.8 MiB)

        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

```

and 

```
ppp0: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST>  mtu 996

        inet 5.254.149.211  netmask 255.255.255.255  destination 5.254.149.1

        ppp  txqueuelen 3  (Point-to-Point Protocol)

        RX packets 6  bytes 78 (78.0 B)

        RX errors 0  dropped 0  overruns 0  frame 0

        TX packets 305181  bytes 109420240 (104.3 MiB)

        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

```

 and then after I have the following in the logfiles 

```
May  9 22:48:41 NAS pptp[1838]: anon log[logecho:pptp_ctrl.c:677]: Echo Request received.

May  9 22:59:41 NAS pptp[1838]: anon log[pptp_handle_timer:pptp_ctrl.c:1050]: closing control connection due to missing echo reply

May  9 22:59:41 NAS pptp[1838]: anon log[ctrlp_rep:pptp_ctrl.c:251]: Sent control packet type is 12 'Call-Clear-Request'

May  9 22:59:41 NAS pptp[1838]: anon log[pptp_conn_close:pptp_ctrl.c:430]: Closing PPTP connection

May  9 22:59:41 NAS pptp[1838]: anon log[ctrlp_rep:pptp_ctrl.c:251]: Sent control packet type is 3 'Stop-Control-Connection-Request'

May  9 22:59:41 NAS pptp[1838]: anon log[call_callback:pptp_callmgr.c:79]: Closing connection (call state)

May  9 22:59:41 NAS pppd[1830]: Modem hangup

May  9 22:59:41 NAS pppd[1830]: Connect time 2.0 minutes.

May  9 22:59:41 NAS pppd[1830]: Sent 813898930 bytes, received 0 bytes.

May  9 22:59:41 NAS pppd[1830]: MPPE disabled

May  9 22:59:41 NAS pppd[1830]: Connection terminated.

May  9 22:59:41 NAS pppd[1830]: Exit.

```

I have read that it's probably an error in my routings, but I don't really understand the issue (haven't looked at the routing output before this issue came up)

Routing before i redirecting my default to ppp0 

```

Kernel IP routing table

Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface

0.0.0.0         192.168.0.1     0.0.0.0         UG        0 0          0 eth0

127.0.0.0       127.0.0.1       255.0.0.0       UG        0 0          0 lo

178.73.207.1    0.0.0.0         255.255.255.255 UH        0 0          0 ppp0

192.168.0.0     0.0.0.0         255.255.255.0   U         0 0          0 eth0

```

 and after 

```
Kernel IP routing table

Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface

0.0.0.0         0.0.0.0         0.0.0.0         U         0 0          0 ppp0

0.0.0.0         192.168.0.1     0.0.0.0         UG        0 0          0 eth0

127.0.0.0       127.0.0.1       255.0.0.0       UG        0 0          0 lo

178.73.207.1    0.0.0.0         255.255.255.255 UH        0 0          0 ppp0

192.168.0.0     0.0.0.0         255.255.255.0   U         0 0          0 eth0
```

And suggestions on how to correct my routings?

----------

## matrixer

sorry for bumping the thread, but I'm still stuck on the same issue. My routing knowledge is poor...

----------

## papahuhn

You need to set a specific route towards your VPN server on eth0.

----------

## matrixer

Okay, before I launched my VPN connection and then set the default route to the ppp0 (my VPN connection).

```
route add default ppp0
```

 now gives me a loop, how should I make it more specific?

----------

## papahuhn

```
route add -host vpn-server-ip gw 192.168.0.1
```

----------

## yjm

pptpclient-1.7.2-r3 fixes your issue I believe

----------

## matrixer

Thanks, the update to r3 solved the problem. The more specif argument for routing didn't cause the loop but the routing was still via my eth0 connection and not the PPTP.

----------

