Ubuntu使用PPTP VPN

http://blog.fens.me/vpn-pptp-client-ubuntu/

https://help.ubuntu.com/community/VPNClient

###安装pptp client

sudo apt-get install pptp-linux

###初始化pptp

sudo pptpsetup --create myvpn --server <vpn server ip> --username <username> --password <password> --encrypt --start

以上操作生成/etc/ppp/peers/myvpn 及 /etc/ppp/chap-secrets

###配置路由

sudo vi /etc/ppp/ip-up.d/route-traffic

#!/bin/bash
/sbin/ip route add <vpn server ip> via <client gateway>
/sbin/ip route del default
/sbin/ip route add default dev ppp0

sudo chmod +x /etc/ppp/ip-up.d/route-traffic

sudo vi /etc/ppp/ip-down.d/disableroute

#!/bin/bash
/sbin/ip route add default via  <client gateway>

sudo chmod +x /etc/ppp/ip-down.d/disableroute

###启动和停止pptp

sudo pon myvpn
sudo poff myvpn
1赞

Powered by eduStack & ifLab