You can configure pptp VPN server and client from the terminal using these steps:
Install and update the VPN server and client packages:
$ sudo apt-get install pptpd ppp pptp-linux
Four files has to be configured for the server:
/etc/pptpd.conf:
option /etc/ppp/pptpd-options logwtmp localip 192.168.23.20 remoteip 192.168.23.30-39
/etc/ppp/pptpd-options:
name pptpd refuse-pap refuse-chap refuse-mschap require-mschap-v2 require-mppe-128 proxyarp nodefaultroute lock nobsdcomp noipx ## you don’t need IPX mtu 1490 ## may help your linux client from disconnecting mru 1490 ## may help your linux client from disconnecting
/etc/ppp/options:
lock
/etc/ppp/chap-secrets:
# Secrets for authentication using CHAP # client server secret IP addresses [username] pptpd [userpass] *
(The [username] and [userpass] are entries without the brackets.)
Now restart the server with:
$ sudo service pptpd restart
Four configuration files are involved:
/etc/ppp/peers/myvpn:
# replace the bracket paramters with the host name of the VPN server and VPN user remotename myvpn linkname myvpn ipparam myvpn pty "pptp [vpn server] --nolaunchpppd " name [username] usepeerdns require-mppe refuse-eap noauth # adopt defaults from the pptp-linux package file /etc/ppp/options.pptp
/etc/ppp/options.pptp:
lock noauth refuse-pap refuse-eap refuse-chap refuse-mschap nobsdcomp nodeflate
# Secrets for authentication using CHAP # client server secret IP addresses username myvpn password *
/etc/ppp/ip-up.local:
#!/bin/sh network=`echo $IPREMOTE | awk -F\. '{print $1"."$2"."$3".0/24"}'` route add -net $network $IFNAME
Configure routing with iptables:
Â
iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 1723 -j ACCEPT iptables -t nat -A POSTROUTING -o eth0 -s 192.168.23.0/24 -j MASQUERADE service iptables save service iptables start
Connect the VPN client with:
$ sudo pon myvpn
End the VPN connection with:
$ sudo poff myvpn
« Go back
Powered by Help Desk Software HESK, in partnership with SysAid Technologies