Debian system build VPN Server 1. install PPTPD www.2cto.com # apt-get install pptpd 2. Edit pptpd. conf file # vim/etc/pptpd. conf makes the uncommented content as follows: option/etc/ppp/pptpd-optionslocalip 192.168.0.1remoteip 192.168.0.234-238,192.168 .0.245 set the IP address range that can be obtained after the external computer connects to the vpn through pptp and the IP address of the server. Www.2cto.com 3. Add a logon user # vim/etc/ppp/chap-secrets to add a line. The content is as follows: lavender pptpd "lavender" * the password is enclosed in double quotation marks. The asterisk at last indicates that the password can be connected from any IP address. If you want to set an IP address, you can also. Theoretically, a vpn has been set up here. However, you cannot use this method to access the Internet, because all the data is applied to the pptpd server, instead of being transferred to the dial-in computer device. To access the Internet, you also need to configure iptables: 4. Set DNS resolution, edit pptpd-options #/etc/ppp/pptpd-options, find ms-dns, and cancel the comment, and modify the DNS address I use google dns, the following ms-dns 8.8.8.8ms-dns 8.8.4.4 5, enable forwarding vim/etc/sysctl. conf cancels the annotation of the following content line (debian4 and 5 will be slightly different). net. ipv4.ip _ forward = 1 6. Run the following command, set the FORWARD function to enable echo 1>/proc/sys/net/ipv4/ip_forward 7, install iptables, and set # apt-get install iptables # iptables-t nat-I POSTROUTING-j MASQUERADE 8. Start the service #/etc/init After the. d/pptpd restart VPN is set up, you can try to log on with the client. PS: pptpd listening port number is 1723