1.安装 ubuntu
nano /etc/apt/sources.list
apt update
apt install vim openssh-server net-tools open-vm-tools
vi /etc/ssh/sshd_config
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
vi /etc/ppp/chap-secrets
vi /etc/ppp/pptpd-options
ms-dns 220.96.104.17
ms-dns 223.5.5.5
systemctl enable pptpd
systemctl start pptpd
systemctl status pptpd
vi /etc/sysctl.conf
net.ipv4.ip_forward=1
sysctl -p
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
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
chmod +x /etc/ppp/ip-down.local