Home

Secondary links

  • News
    • Energy News
    • IT News
    • Sustainability News
  • Login/Join
    • Home
    • Search

Recent blog posts

  • The Kind of Stuff that Only Prince Would Sing About
  • Southern Kid and Goatling Show
  • Same Planet, Different Worlds
  • A Tale of Two Goaties
  • ...and so that's how Grace Kelly came to live at our farm
  • 15 out of 50 isn't too bad...
  • The Blackboard is GO!
  • Hello Hamish!
  • Greens Win the Seat of Fremantle - 44% Primary - 54% Final :)
  • Life and Death Under the Island Sky
more

Island Sky News

  • Farewell Pixie and Lala
more

Creating an Ubuntu/Debian PPTP Client

Submitted by craige on June 27, 2006 - 21:09
  • Debian
  • Ubuntu

To configure Ubuntu or Debian as a PPTP client, you will need to install the pptp-linux package first:

$ sudo apt-get install pptp-linux

Now you will need to edit the options.pptp file

sudo vi /etc/ppp/options.pptp

and insert the below line:

lock noauth nobsdcomp nodeflate

Next you will need to modify chap-secrets

$ sudo vi /etc/ppp/chap-secrets

add this line:

$DOMAIN\\$USERNAME PPTP $PASSWORD *

where:
$DOMAIN is the VPN domain name
$USERNAME is your VPN username
$PASSWORD is your VPN password

A completed chap-secrets on a default Dapper setup would look something similar to this:

# Secrets for authentication using CHAP
# client server secret IP addresses

MYVPN\\myusername PPTP mypassword *

You will then need to create a tunnel configuration file:

$ sudo vi /etc/ppp/peers/$TUNNEL

where $TUNNEL is the name you wish to give this VPN connection. Now:

$ sudo vi /etc/ppp/peers/MyVPN

and add the following lines:

pty "pptp $SERVER --nolaunchpppd"
name $DOMAIN\\$USERNAME
remotename PPTP
require-mppe-128
file /etc/ppp/options.pptp
ipparam $TUNNEL

where $SERVER is the IP address or hostname of the VPN gateway
where $DOMAIN, $USERNAME and $TUNNEL are as defined earlier.
the resulting file will look something like this:

pty "pptp myvpnserver --nolaunchpppd"
name MYVPN\\myusername
remotename PPTP
require-mppe-128
file /etc/ppp/options.pptp
ipparam MyVPN

The last step you'll need to take is to create a file in /etc/ppp/ip-up.d with the same name as your "peers" file that sets the route to the other network automatically for you:

$ sudo vi /etc/ppp/ip-up.d/MyVPN

which in this example for a class C network will look something like this:

#!/bin/sh  

route add -net 192.168.1.0 netmask 255.255.255.0 dev ppp0

Finalise the process by making the file executable:

$ sudo chmod a+x /etc/ppp/ip-up.d/MyVPN

Provide all your settings are correct, you should be able to start the PPTP connection by running:

$ sudo pon MYVPN

You can now run the ifconfig and route -n commands and perhaps ping a host at the other end to make sure the connection is good. The output of which will look similar to this:

$ ifconfig 
eth0 Link encap:Ethernet HWaddr 00:AA:11:BB:22:CC
inet addr:192.168.0.2 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::20e:35ff:fefc:e95/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:16780 errors:0 dropped:0 overruns:0 frame:0
TX packets:14489 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:11422112 (10.8 MiB) TX bytes:1604047 (1.5 MiB)
Interrupt:5 Base address:0x8000 Memory:e0210000-e0210fff

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:56159 errors:0 dropped:0 overruns:0 frame:0
TX packets:56159 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:25007982 (23.8 MiB) TX bytes:25007982 (23.8 MiB)

ppp0 Link encap:Point-to-Point Protocol
inet addr:192.168.1.2 P-t-P:192.168.1.1 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1496 Metric:1
RX packets:7 errors:0 dropped:0 overruns:0 frame:0
TX packets:7 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3
RX bytes:88 (88.0 b) TX bytes:82 (82.0 b)

$ route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.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
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 ppp0
0.0.0.0 192.168.0.1 0.0.0.0 UG 0 0 0 eth0
$ ping remote-server
PING remote-server.remote.com.au (192.168.1.101) 56(84) bytes of data.
64 bytes from remote-server.remote.com.au (192.168.1.101): icmp_seq=1 ttl=254 t
ime=765 ms
64 bytes from remote-server.remote.com.au (192.168.1.101): icmp_seq=2 ttl=254 t
ime=41.2 ms

Happy PPTP-ing :)

  • craige's blog
  • Add new comment

Thank you! Thank you!

Submitted by Indy (not verified) on February 12, 2007 - 06:00.

Just wanted to say a big thanks for posting this blog entry. It worked very nicely for me. I had been banging my head against the wall and was almost ready to give up on Ubuntu completely.But now I will persist with it :)  

  • reply

Sustainability

  • The Machinery Shed
  • Modest Makeover
  • A Study in Contrasts
  • Spreading its Wings
  • Height & Light
  • Once in a Lifetime
  • Best of Both Worlds
more

Energy News

  • Wind power led recovery - Environmental Management News (subscription)
  • First Solar Quarterly Profit Drops as Own Project Development Increases - Bloomberg
  • Queen's University set to design fully submerged deepwater turbine - Irish Times
  • Greens say Labor's solar ads dishonest - Sky News Australia
  • First Solar profit tops Street, trims sales view - Reuters
  • Spain Nearing Plan to Cut Solar Subsidy 15%, Extend Payments Three Years - Bloomberg
  • Ormat Names John Hancock Exclusive Debt Provider Under DOE Loan Guarantee ... - PR Newswire (press release)
  • MEMC 2Q Profit Soars On Strong Sales; 2010 View Weak - Wall Street Journal
more

IT News

  • Google site fools interwebs into China blockage scare
  • World's Fastest Hybrid OK'd For Production
  • 'Suspicious' Android wallpaper app nabs user data
  • Data for 100m Facebook accounts published to BitTorrent
  • Uncle Sam sues Oracle (again) for alleged fraud
  • Sometimes It's OK To Steal My Games
  • Thermoelectrics Could Let You Feel the Heat In Games
  • Ballmer and Softies sacrifice sleep to catch iPad
more
© Craige McWhirter