(1) Login as root user
(2) Download steps
wget --no-check-certificate https://raw.githubusercontent.com/teddysun/across/master/l2tp.sh
(3) Modify permissions
chmod +x l2tp.sh
(4) Execute the steps
./l2tp.sh
(5) Settings
Please input IP-Range:
(Default Range: 192.168.18):
Enter the local IP range (a local IP address assigned after the local computer is connected to the VPS), pressing Enter directly means entering the default value of 192.168.18
Please input Username:
(Default Username: teddysun):
Username means username, which is the first default user. Entering directly means entering the default value teddysun
Please input teddysun's password:
(Default Password: Q4SKhu2EXQ):
Enter the user's password. By default, a 10-digit password containing uppercase and lowercase letters and numbers will be randomly generated. Of course, you can also specify a password.
Press any key to start…or Press Ctrl+c to cancel
Press any key to continue, if you want to cancel the installation, please press Ctrl+c
(6) If the network card is an intranet address
export iptables settings
sudo sh -c "iptables-save > /etc/network/iptables.up.rules"
Modify settings
sudo vi /etc/network/iptables.up.rules
Change the external IP to the internal IP
-A POSTROUTING -s 192.168.18.0/24 -j SNAT --to-source 内网ip
application
sudo iptables-apply