1.安装 ubuntu

nano /etc/apt/sources.list

apt update

apt install vim openssh-server net-tools open-vm-tools

vi /etc/ssh/sshd_config

How to install pptpd on Ubuntu 20.04.3 LTS_pptpd

systemctl restart sshd

systemctl status sshd

apt install pptpd

vi /etc/pptpd.conf

localip 192.168.1.2

remoteip 192.168.1.234-238,192.168.1.245

How to install pptpd on Ubuntu 20.04.3 LTS_pptpd_02

vi /etc/ppp/chap-secrets

How to install pptpd on Ubuntu 20.04.3 LTS_ubuntu_03

vi /etc/ppp/pptpd-options

ms-dns 220.96.104.17

ms-dns 223.5.5.5

How to install pptpd on Ubuntu 20.04.3 LTS_pptpd_04

systemctl enable pptpd

systemctl start pptpd

systemctl status pptpd

How to install pptpd on Ubuntu 20.04.3 LTS_pptpd_05

vi /etc/sysctl.conf

net.ipv4.ip_forward=1

How to install pptpd on Ubuntu 20.04.3 LTS_ubuntu_06

sysctl -p

How to install pptpd on Ubuntu 20.04.3 LTS_pptpd_07

nano /etc/netplan/01-netcfg.yaml

netplan apply

nano /etc/ppp/ip-up.local

echo "time:`date -d today +%F_%T`,clientIP:$6,username:$PEERNAME,assignIP:$5" >> /var/log/pptpd.log

或:

echo "---------------Login---------------------------------------" >> /var/log/pptpd.log

echo "time: `date -d today +%F_%T`" >> /var/log/pptpd.log

echo "clientIP: $6" >> /var/log/pptpd.log

echo "username: $PEERNAME" >> /var/log/pptpd.log

echo "device: $1" >> /var/log/pptpd.log

echo "vpnIP: $4" >> /var/log/pptpd.log

echo "assignIP: $5" >> /var/log/pptpd.log

echo "-----------------------------------------------------------" >> /var/log/pptpd.log

How to install pptpd on Ubuntu 20.04.3 LTS_ubuntu_08

chmod +x /etc/ppp/ip-up.local

nano /etc/ppp/ip-down.local

echo "time:`date -d today +%F_%T`,clientIP:$6,username:$PEERNAME,assignIP:$5" >> /var/log/pptpd.log

或:

echo "---------------Logout--------------------------------------" >> /var/log/pptpd.log

echo "time: `date -d today +%F_%T`" >> /var/log/pptpd.log

echo "clientIP: $6" >> /var/log/pptpd.log

echo "username: $PEERNAME" >> /var/log/pptpd.log

echo "device: $1" >> /var/log/pptpd.log

echo "vpnIP: $4" >> /var/log/pptpd.log

echo "assignIP: $5" >> /var/log/pptpd.log

echo "-----------------------------------------------------------" >> /var/log/pptpd.log

How to install pptpd on Ubuntu 20.04.3 LTS_ubuntu_09

chmod +x /etc/ppp/ip-down.local