We know that there are many VPN types, such as the Windows Server series with their own VPN servers, and the installation and configuration are very simple. Today I will introduce the deployment in the log, is a VPN-Server in Linux based on the PPTP protocol. The Ubuntu system is a Debian-based release. The communication community is very active. Because of Debian-based, the Package Manager provided by Debian can handle dependencies well and facilitate software installation.
Install pptp
sudo apt-get install pptpd
Modify the pptp configuration file. Here, you need to modify the three pptp configuration files:/etc/pptpd. conf.
vim /etc/pptpd.conf
Find localip and remoteip. localip is the IP address of the linux host, and remoteip is the IP address pool, that is, the IP address assigned by the remote computer.
You can configure it as needed. Modify/etc/ppp/pptpd-options
vim /etc/ppp/pptpd-options
Find the ms-dns and configure the dns server. Here I use google's dns. You can add two, and write another line.
Modify/etc/ppp/chap-secrets. This file is used to add a vpn user,
vim /etc/ppp/chap-secrets
Fill in the format of the IP address assigned by the user name (tab) Host Name (tab) and password (tab). The host name can be replaced, if you do not specify the IP address to which the user is allocated, you can change the last IP address to "*" to restart the pptp service.
/etc/init.d/pptpd restart
Wait for a moment. Hey, create a VPN connection from a remote device. Try again.
PS:
If you find that you cannot access the Internet, you need to enable ipv4 forward as follows:
Enable ipv4 forward to modify/etc/sysctl. conf, remove the comment before "net. ipv4.ip _ forward = 1", and then "sudo sysctl-p" to apply the configuration.
OK. Your vpn Server has been set up. Create a vpn connection on your computer!