緣起

無,pptp已無法翻墻。

[========]

安裝

從源安裝

apt update
apt upgrade -y
apt install -y pptpd 

DNS和dhcp配置

echo "localip 10.0.0.1" >> /etc/pptpd.conf
echo "remoteip 10.0.0.100-200" >> /etc/pptpd.conf
echo "ms-dns 223.5.5.5" >> /etc/ppp/pptpd-options
echo "ms-dns 119.29.29.29" >> /etc/ppp/pptpd-options
echo "ms-dns 182.254.116.116" >> /etc/ppp/pptpd-options
echo "ms-dns 223.6.6.6" >> /etc/ppp/pptpd-options

用戶賬戶密碼配置

echo "username  pptpd   [email protected]    *" >> /etc/ppp/chap-secrets

重啓服務配置生效

service pptpd restart

配置iptables並保存

apt install -y iptables-persistent
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
iptables-save > /etc/iptables/rules.v4

echo "net.ipv4.ip_forward = 1" >> /etc/sysctl.conf
sysctl -p