Awhile ago I posted this howto for compiling a kernel with MPPE support to be able to connect to a Microsoft VPN. Now that I’m going through this process again for a new Dell Latitude D610 I thought it might be time to document the next step, which is setting up the scripts to connect to an actual VPN.
Most of these steps were taken pretty directly from http://www.adamhooper.com:4242/mcgill-vpn-mppe/#config, but it can’t hurt to have more than one howto out there, right?
Steps to connect to a Microsoft VPN from a Debian linux client:
- Install ppp: apt-get install pptpd pptp-linux
- Create and edit ”/etc/ppp/options.your_vpn_abrev” to contain:
lock
noauth
nobsdcomp
nodeflate
persist
- Create and edit ”/etc/ppp/peers/your_vpn_abrev” to contain:
pty "pptp <i>your_vpn_url</i> --nolaunchpppd" # i.e. vpn.domain.com
name "<i>your_login_username</i>"
remotename <i>your_vpn_abrev</i>
require-mppe-128
file /etc/ppp/options.<i>your_vpn_abrev</i>
ipparam <i>your_vpn_abrev</i>
- Update ”/etc/ppp/chap-secrets” to contain:
<i>your_login_username</i> <i>your_vpn_abrev</i> <i>your_login_password</i> *
<i>your_vpn_abrev</i> <i>your_login_username</i> <i>your_login_password</i> *
- Create and edit ”/etc/ppp/ip-up.d/your_vpn_abrev” to contain (add one line per ip range that needs to go through the VPN):
route add -net <i>vpn_ip_range</i> ppp0 # i.e. 192.168.20.0/24 or 132.216.0.0/16
- Make the ip-up script executable: chmod +x /etc/ppp/ip-up.d/your_vpn_abrev
Try to connect:
At this point you should be able to execute the following command to bring up the VPN:
pon <i>your_vpn_abrev</i> debug dump logfd 2 updetach persist && /etc/ppp/ip-up.d/<i>your_vpn_abrev</i>
You should see something similar to this:
pppd options in effect:
debug # (from command line)
updetach # (from command line)
persist # (from command line)
logfd 2 # (from command line)
dump # (from command line)
noauth # (from /etc/ppp/options.<i>your_vpn_abrev</i>)
name ryan # (from /etc/ppp/peers/<i>your_vpn_abrev</i>)
remotename tribeca # (from /etc/ppp/peers/<i>your_vpn_abrev</i>)
# (from /etc/ppp/options.<i>your_vpn_abrev</i>)
pty pptp <i>your_vpn_url</i> --nolaunchpppd # (from /etc/ppp/peers/<i>your_vpn_abrev</i>)
crtscts # (from /etc/ppp/options)
# (from /etc/ppp/options)
asyncmap 0 # (from /etc/ppp/options)
lcp-echo-failure 4 # (from /etc/ppp/options)
lcp-echo-interval 30 # (from /etc/ppp/options)
hide-password # (from /etc/ppp/options)
ipparam tribeca # (from /etc/ppp/peers/<i>your_vpn_abrev</i>)
proxyarp # (from /etc/ppp/options)
nobsdcomp # (from /etc/ppp/options.<i>your_vpn_abrev</i>)
nodeflate # (from /etc/ppp/options.<i>your_vpn_abrev</i>)
require-mppe-128 # (from /etc/ppp/peers/<i>your_vpn_abrev</i>)
noipx # (from /etc/ppp/options)
using channel 2
Using interface ppp0
Connect: ppp0 <--> /dev/pts/2
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0xbd67cf7f> <pcomp> <accomp>]
rcvd [LCP ConfReq id=0x1 <asyncmap 0x0> <auth chap MS-v2> <magic 0x359da88e> <pcomp> <accomp>]
sent [LCP ConfAck id=0x1 <asyncmap 0x0> <auth chap MS-v2> <magic 0x359da88e> <pcomp> <accomp>]
rcvd [LCP ConfAck id=0x1 <asyncmap 0x0> <magic 0xbd67cf7f> <pcomp> <accomp>]
sent [LCP EchoReq id=0x0 magic=0xbd67cf7f]
rcvd [CHAP Challenge id=0x1 <db473bebd9077d4f59295aa64932f573>, name = "nas"]
sent [CHAP Response id=0x1 <9c3606e62374744e490d7305f3050a3784090810000000e057efca0fc6216021088d786cb800533ccce2d92e1b17819500>, name = "<i>your_vpn_username</i>"]
rcvd [LCP EchoRep id=0x0 magic=0x359da88e]
rcvd [CHAP Success id=0x1 "S=46E4685DE0338610FF22D2CA53DE41F9310424AF"]
sent [CCP ConfReq id=0x1 <mppe +H -M +S -L -D -C>]
rcvd [IPCP ConfReq id=0x1 <addr 192.168.20.230> <compress VJ 0f 01>]
sent [IPCP TermAck id=0x1]
rcvd [CCP ConfReq id=0x1 <deflate 15> <deflate(old#) 15> <mppe +H -M +S +L -D -C>]
sent [CCP ConfRej id=0x1 <deflate 15> <deflate(old#) 15>]
rcvd [CCP ConfAck id=0x1 <mppe +H -M +S -L -D -C>]
rcvd [CCP ConfReq id=0x2 <mppe +H -M +S +L -D -C>]
sent [CCP ConfNak id=0x2 <mppe +H -M +S -L -D -C>]
rcvd [CCP ConfReq id=0x3 <mppe +H -M +S -L -D -C>]
sent [CCP ConfAck id=0x3 <mppe +H -M +S -L -D -C>]
MPPE 128-bit stateless compression enabled
sent [IPCP ConfReq id=0x1 <compress VJ 0f 01> <addr 0.0.0.0>]
rcvd [IPCP ConfNak id=0x1 <addr 192.168.20.233>]
sent [IPCP ConfReq id=0x2 <compress VJ 0f 01> <addr 192.168.20.233>]
rcvd [IPCP ConfAck id=0x2 <compress VJ 0f 01> <addr 192.168.20.233>]
rcvd [IPCP ConfReq id=0x1 <addr 192.168.20.230> <compress VJ 0f 01>]
sent [IPCP ConfAck id=0x1 <addr 192.168.20.230> <compress VJ 0f 01>]
Cannot determine ethernet address for proxy ARP
local IP address 192.168.20.233
remote IP address 192.168.20.230
Note: I could never get the automatic execution of the ip-up script to work after the vpn connects which is why it’s explicitly being executed here (the “&& /etc/ppp/ip-up.d/
your_vpn_abrev” part)
After this is done, you should be able to ping the remote ip address (the last line of the log above) and you should see “ppp0” now listed in “ifconfig”:
# ifconfig
eth0 ...
lo ...
ppp0 Link encap:Point-to-Point Protocol
inet addr:192.168.20.233 P-t-P:192.168.20.230 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1496 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:106 (106.0 b) TX bytes:94 (94.0 b)
If you see this chances are you’ve got it all up and running! And to stop the
VPN, just execute this command:
poff <i>your_vpn_abrev</i>
And that’s all there is to it (well, and this minor step that you should have done before hand). Let me know if you have any issues and I’ll see what I can come up with. Keep in mind I am by no means an expert, I’ll just see if I can help up as I’ve run into setup problems myself that you may find yourself confronted with.