# Using PPP/PPTP for VPN.  How do I Route

## alistair

Hey guys.

Basically I have setup PPP/PPTP to authenticate with my workplace but am having issues getting anything to route over the link.

Basically I followed pptpclient gentoo howto. This seems to authenticate and stay up for a period of time ( I believe it only drops because nothing is happening on the line )

My attempts at routing by following Client to Lan howto didn't seem to get any success.

But after reading the docs a bit more, I came across same-ip  in which I realised that the public (internet) address of the server I connect to is also the remote IP address of the client's (aka my) tunnel.

Now the same-ip howto tells me to set the "destination address of the PPP interface to be the internal address of the PPTP server" but this is also the same ip address as the public and remote ip address.  so as an example ( made up ip address )

Public IP:  203.22.22.1

PPP Dest Tunnel IP:  203.22.22.1

Internal address:  203.22.22.1

So what do I do,  besides shooting my system admin?

Hopefully this is explained well.

Thanks for the help.

Alistair.

----------

## skunk

try giving the "noipdefault" option to the pppd command, you should get an ip for your tunnel...

----------

## alistair

 *skunk wrote:*   

> try giving the "noipdefault" option to the pppd command, you should get an ip for your tunnel...

 

Ok I figured out I was wrong.  When I got home from work I reconnected and discovered that in fact they are all different

eg here is the output from pon.

local  IP address 202.33.212.105

remote IP address 202.33.212.108

primary   DNS address 202.33.212.11

secondary DNS address 202.33.212.25

What i'm finding interesting is that if I run route (no args) it hangs after printing the column names ( like so )

```
# time route

Kernel IP routing table

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface

202.33.212.108  *               255.255.255.255 UH    0      0        0 ppp0

202.33.212.0    *               255.255.255.0   U     0      0        0 ppp0

10.0.0.0        *               255.0.0.0       U     2      0        0 eth0

loopback        localhost       255.0.0.0       UG    0      0        0 lo

default         10.1.1.1        0.0.0.0         UG    2      0        0 eth0

real    1m0.141s

user    0m0.007s

sys     0m0.000s

LINUX overlays # time route

Kernel IP routing table

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface

10.0.0.0        *               255.0.0.0       U     2      0        0 eth0

loopback        localhost       255.0.0.0       UG    0      0        0 lo

default         10.1.1.1        0.0.0.0         UG    2      0        0 eth0

real    0m0.200s

user    0m0.003s

sys     0m0.000s

```

even in that example the first one ( where pon was running ) would probably of lasted for longer as the link was dropped.

[edit]  Ok maybe not,

But it is still hanging for about a minute.

----------

## skunk

are the routes added automatically after pon or do you add them yourself?

is the vpn server ip like 202.33.212.x?

if so, try adding this route before running pon:

```
route add <vpn_ip> gw 10.1.1.1 eth0
```

----------

## alistair

 *skunk wrote:*   

> are the routes added automatically after pon or do you add them yourself?
> 
> is the vpn server ip like 202.33.212.x?
> 
> if so, try adding this route before running pon:
> ...

 

They are added automatically.

I will try this when I get home.

Thanks

----------

## alistair

 *alistair wrote:*   

> 
> 
> I will try this when I get home.
> 
> Thanks

 

No luck sadly.   I will talk to my sysadmin about getting the server/firewall to stop dropping pings.  Hopefully that might help.

----------

## mrness

Usually PPTP servers have 2 interfaces: one towards Internet (with a public IP, the one you specify it on pptpd command line) and the other one towards intranet (usually with private IPs). 

In order to work, the traffic destined to the public address of your PPTP server mustn't be routed through the PPP interface. This can be solved the easy way by setting the local PPP address of the PPTP server to be equal with the intranet address of the machine. 

If you cannot repair PPTP server configuration, you can fix it on the client by using advanced IP routing. Following traffic needs to be routed through your normal Internet interface:

  - destination IP == PPTP server and protocol TCP and destination port 1723

  - destination IP == PPTP server and protocol 47

----------

## soloslinger

Hey hey,

What was the final fix for this?  This thread seems to closely resemble my problem.

soloslinger

----------

## soloslinger

bump

----------

