# pptp client routing problems

## neilhwatson

I have setup a linux pptp client to connect to a Microsoft VPN server at work. The connection is successful but, all traffic still routes through my ISP instead of the tunnel.

Relevant info (ppp0 is my IPS, ppp1 is the VPN tunnel):

```

ppp0      Link encap:Point-to-Point Protocol  

          inet addr:216.138.221.7  P-t-P:216.138.221.1  Mask:255.255.255.255

          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1492  Metric:1

          RX packets:19351 errors:0 dropped:0 overruns:0 frame:0

          TX packets:14009 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:3 

          RX bytes:20860129 (19.8 Mb)  TX bytes:1559338 (1.4 Mb)

ppp1      Link encap:Point-to-Point Protocol  

          inet addr:205.150.90.247  P-t-P:205.150.90.240  Mask:255.255.255.255

          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1000  Metric:1

          RX packets:8 errors:0 dropped:0 overruns:0 frame:0

          TX packets:8 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:3 

          RX bytes:80 (80.0 b)  TX bytes:86 (86.0 b)

Kernel IP routing table

Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface

205.150.90.240  0.0.0.0         255.255.255.255 UH        0 0          0 ppp1

216.138.221.1   0.0.0.0         255.255.255.255 UH        0 0          0 ppp0

10.0.0.0        0.0.0.0         255.255.255.0   U         0 0          0 eth0

192.168.0.0     0.0.0.0         255.255.255.0   U         0 0          0 eth1

127.0.0.0       127.0.0.1       255.0.0.0       UG        0 0          0 lo

0.0.0.0         216.138.221.1   0.0.0.0         UG        0 0          0 ppp0

```

At this point traceroute to 205.150.90.103 (on the same network as the VPN tunnel) still routes through ppp0.   I tried adding a different route:

```
route add -net 205.150.90.0 netmask 255.255.255.0 gw 205.150.90.240 dev ppp1
```

When I add that route, the tunnel drops.  What have I missed?

Log at tunnel drop:

```

Mar 19 13:28:20 ettin pppd[13626]: remote IP address 205.150.90.240

Mar 19 13:29:19 ettin pptp[13639]: anon log[logecho:pptp_ctrl.c:659]: Echo Request received.

Mar 19 13:29:19 ettin pptp[13639]: anon log[ctrlp_rep:pptp_ctrl.c:243]: Sent control packet type is 6 'Echo-Reply' 

Mar 19 13:30:19 ettin pptp[13639]: anon log[logecho:pptp_ctrl.c:659]: Echo Request received.

Mar 19 13:30:19 ettin pptp[13639]: anon log[ctrlp_rep:pptp_ctrl.c:243]: Sent control packet type is 6 'Echo-Reply' 

Mar 19 13:31:19 ettin pptp[13639]: anon log[logecho:pptp_ctrl.c:659]: Echo Request received.

Mar 19 13:31:19 ettin pptp[13639]: anon log[ctrlp_rep:pptp_ctrl.c:243]: Sent control packet type is 6 'Echo-Reply' 

Mar 19 13:32:19 ettin pptp[13639]: anon log[logecho:pptp_ctrl.c:659]: Echo Request received.

Mar 19 13:32:19 ettin pptp[13639]: anon log[ctrlp_rep:pptp_ctrl.c:243]: Sent control packet type is 6 'Echo-Reply' 

Mar 19 13:32:40 ettin pppd[13626]: Modem hangup

Mar 19 13:32:40 ettin pptp[13639]: anon log[callmgr_main:pptp_callmgr.c:228]: Closing connection

Mar 19 13:32:40 ettin pptp[13639]: anon log[ctrlp_rep:pptp_ctrl.c:243]: Sent control packet type is 12 'Call-Clear-Request' 

Mar 19 13:32:40 ettin pppd[13626]: MPPE disabled

Mar 19 13:32:40 ettin pppd[13626]: Connection terminated.

Mar 19 13:32:40 ettin pppd[13626]: Connect time 4.4 minutes.

Mar 19 13:32:40 ettin pppd[13626]: Sent 86 bytes, received 144 bytes.

Mar 19 13:32:40 ettin pppd[13626]: Connect time 4.4 minutes.

Mar 19 13:32:40 ettin pppd[13626]: Sent 86 bytes, received 144 bytes.

Mar 19 13:32:40 ettin pppd[13626]: Exit.

Mar 19 13:32:40 ettin pptp[13639]: anon log[ctrlp_disp:pptp_ctrl.c:912]: Call disconnect notification received (call id 33757)

Mar 19 13:32:40 ettin pptp[13639]: anon log[ctrlp_rep:pptp_ctrl.c:243]: Sent control packet type is 12 'Call-Clear-Request' 

Mar 19 13:32:40 ettin pptp[13639]: anon log[pptp_conn_close:pptp_ctrl.c:425]: Closing PPTP connection

Mar 19 13:32:40 ettin pptp[13639]: anon log[ctrlp_rep:pptp_ctrl.c:243]: Sent control packet type is 3 'Stop-Control-Connection-Request' 

Mar 19 13:32:40 ettin pptp[13639]: anon log[ctrlp_disp:pptp_ctrl.c:782]: Received Stop Control Connection Reqply.

Mar 19 13:32:40 ettin pptp[13639]: anon log[call_callback:pptp_callmgr.c:77]: Closing connection

```

----------

## KsE

Try

```

route add -net 205.150.90.247/24 dev ppp1

```

----------

## neilhwatson

205.150.90.247 is a host not a network.

----------

## KsE

Lol, I meant to put a 0 at the end, not the 247. Copy/paste error.

----------

## neilhwatson

Alas, the result is the same.  Adding the route causes the tunnel to drop.

----------

## neilhwatson

Success.  The VPN server is in the same network range used in the route add command.  I have set a route to the VPN server that uses the ppp0 before using the VPN tunnel and setting a route for it.

----------

