江苏省吴江市双板桥路3号兴源网络

0512-63028342

ly@wjxy.net.cn

Docker极速搭建一个pptp vpn

一句话修改root密码
echo -e "newpwd\nnewpwd" | (passwd root)

以下正式脚本:
yum install -y yum-utils device-mapper-persistent-data lvm2 yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo yum install docker-ce docker-ce-cli containerd.io systemctl enable docker systemctl start docker
mkdir -p /etc/ppp
touch /etc/ppp/chap-secrets
echo "# Secrets for authentication using PAP" >> /etc/ppp/chap-secrets
echo "# client    server      secret      acceptable local IP addresses" >> /etc/ppp/chap-secrets
echo "tony   *           tony123    *" >> /etc/ppp/chap-secrets
sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{
"registry-mirrors": ["https://uwbns7nz.mirror.aliyuncs.com"]
}
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker

docker run -d --restart=always --privileged --net=host -v /etc/ppp/chap-secrets:/etc/ppp/chap-secrets mobtitude/vpn-pptp

现在用tony/tony123分别作为用户名和密码连接vps的ip就可以了,vpn类型选择pptp.

iptables -I INPUT -p tcp --dport 1725 -j ACCEPT
放行端口
service iptables save
service iptables restart
宝塔默认关闭所有udp,以下命令放行
centos6:iptables -A INPUT -p udp --dport 9001 -j ACCEPT
centos7:firewall-cmd --add-port=9001/udp --permanent

发表评论

邮箱地址不会被公开。 必填项已用*标注