Você pode configurar o servidor VPN pptp e o cliente a partir do terminal usando estas etapas:
Configuração do servidor VPN:
Instale e atualize o servidor VPN e os pacotes do cliente:
$ sudo apt-get install pptpd ppp pptp-linux
Quatro arquivos precisam ser configurados para o servidor:
- /etc/pptpd.conf
- / etc / ppp / pptpd-options
- / etc / ppp / options
- / etc / chat-secrets)
/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] *
(O [nome de usuário] e [userpass] são entradas sem os colchetes.)
Agora reinicie o servidor com:
$ sudo service pptpd restart
Configuração do cliente VPN:
Quatro arquivos de configuração estão envolvidos:
- / etc / ppp / peers / myvpn
- /etc/ppp/options.pptp
- / etc / ppp / chap-secrets
- /etc/ppp/ip-up.local
/ 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
/ etc / ppp / chap-secrets:
# 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 ".""."".0/24"}'' route add -net $network $IFNAME
Conecte o cliente VPN com:
$ sudo pon myvpn
Terminar a ligação VPN com:
$ sudo poff myvpn