Skip to main content

OpenWRT PPTP Client – Part 1

We have moved to yet another apartment and decided not to use O3 (o3.kiev.ua) whose cable was already available to connect to. UA-IX up to 100Mbit is nice, but I could see the traffic from/to a whole bunch of users in the building (on the ethernet, right…), I am not the owner of the contract and cannot re-sign-up w/o paying 300₴ upfront to be eligible for 1₴ one-time fee and it took me a trip to their office to top-up the account… Haven’t yet got rid of the cable completely though.

I decided to give Beeline Internet (former Golden Telecom, former Sovam Teleport) a try and upon physical connection I returned to the configuration of my WRT54GL router.

The setup is quite easy:

/etc/config/network:

...
config 'interface' 'wan'
option 'ifname' 'eth0.1'
option 'peerdns' '1'
option 'defaultroute' '1'
option 'proto' 'dhcp'

config 'interface' 'beeline'
option 'proto' 'pptp'
option 'ifname' 'ppp0'
option 'server' 'vpn.beeline.ua'
option 'username' '*****@internet.beeline.ua'
option 'password' '*****'
option 'auto' '1'

config 'route'
option 'interface' 'wan'
option 'target' '10.0.0.0'
option 'netmask' '255.0.0.0'
# gw may be different. check what DHCP gives you on wan
option 'gateway' '10.22.12.1'
...

I was not able to make the interface start at boot via regular network config so I created rc script with simple ifup beeline and ifdown beeline in it.

You may need additional route to the vpn server so that your default route will not create a loop. On Kamikaze 8.09 this appears not to be needed, though. The route for 10.0.0.0 is required to access internal network resources.

I signed up for 5Mbit internet connection service, configured the router and got… 1 Mbit with some spikes down to 200Kbit. WTF?

WRT54GL. This unit features CPU that is (by default) running @ 200MHz. It is possible to make it run @ 250MHz but it does not help. The reason is how pptp handles the networking traffic. CPU just can’t cope with the amount of work required to copy the frames to/from userspace. When the cable is hooked up to the PC i get 5Mbit. So?

The first step was to search for alternative pptp implementations for Linux. There aren’t many, since pptpclient does a perfect job of being (as the name implies) a PPTP client. The embedded devices with limited CPU power and memory is not a good candidate for being a PPTP client in current implementation, YMMV though.

But it turns out that this issue is already being addressed, Accel-PPTP project provide kernel-level pptp module running on top of PPPoX architecture, modified userspace PPTP daemon (the separate client is no longer needed) and a plugin for pppd that utilizes the kernel module. ACCEL-PPTP uses kernel module to increase performance and decrease system usage.

The module works on kernel 2.6 so the first step was to upgrade the router to 2.6-based OpenWRT Kamikaze 8.09. I can confirm that Wi-Fi AP is working fine for some period, running /sbin/wifi restarts it on the router and it works again) and PPTP is slightly faster – I could get up to 2Mbit with 2.6 kernel. A good start, isn’t it :) ?

I was not able to find any precompiled module so I will try to make one myself and report the results here.

Here’s the second part.