Ubuntu14安装PPTP协议VPN
apt-get install pptpd
nano /etc/pptpd.conf //修改IP
localip 10.152.2.1
remoteip 10.152.2.160-17010.152.2.250
nano /etc/ppp/chap-secrets //添加用户
usernamea vpn 123456 *
usernameb vpn 123456 *
nano /etc/ppp/options //添加DNS
ms-dns 8.8.8.8
ms-dns 114.114.114.114
nano /etc/sysctl.conf //去掉net.ipv4.ip_forward=1前的注释
net.ipv4.ip_forward=1 //去掉#
运行
sysctl -p
重启pptpd服务
/etc/init.d/pptpd restart
安装iptables
apt-get install iptables
开启iptables转发
iptables -t nat -A POSTROUTING -s 10.152.2.0/24 -o eth0 -j MASQUERADE
iptables-save > /etc/iptables.pptp
cd /etc/network/if-up.d/
nano iptables添加下面2行内容
#!/bin/sh
iptables-restore < /etc/iptables.pptp
给脚本添加执行权限:
chmod +x /etc/network/if-up.d/iptables
至此PPTP VPN服务器端的设置就完成
转载请注明:RAIN MAN » Ubuntu14安装PPTP协议VPN
还没有人抢沙发呢~