This article is automatically synchronized by Tencent Cloud + Community, the original address https://stackoverflow.club/article/pptpd-V**-on-ubuntu/
Normal people’s Internet access starts by spending money on broadband, not normal people. For example, programmers’ Internet access starts from self-reliance.
Go home and see
anytime, anywhere.V** servers are usually built on Linux systems, and Ubuntu 16.04
is recommended.
sudo apt-get update
sudo apt-get install pptpd
sudo vim /etc/pptpd.conf
# Ensure the configuration of the following options
option /etc/ppp/pptpd-option #Specify the location of the PPP options file
debug #Enable debug mode
localip 192.168.0.1 #V**Virtual IP of the server
remoteip 192.168.0.200-238,192.168.0.245 #Assigned to V**Virtual IP of the client
sudo vim /etc/ppp/pptpd-options
# Ensure the configuration of the following options
name pptpd #pptpd service name
refuse-pap #Reject the pap authentication mode
refuse-chap #Reject chap authentication mode
refuse-mschap #Reject mschap authentication mode
require-mschap-v2 #Allow mschap-v2 authentication mode
require-mppe-128 #Allow mppe 128-bit encryption authentication mode
ms-dns 8.8.8.8 #Use Google DNS
ms-dns 8.8.4.4 #Use Google DNS
proxyarp #arp proxy
debug #Debug mode
dump #Print out all configuration information when the service starts
lock #Lock TTY device
nobsdcomp #Disable BSD compression mode
logfile /var/log/pptpd.log #Output log file location
sudo vim /etc/ppp/chap-secrets
# Format: ip address assigned by username, service type, password
test *1234*
# First*The representative service can be PPTPD or L2TPD, the second*Represents random allocation of ip
sudo service pptpd restart
sudo sed -i 's/#net.ipv4.ip_forward=1/net.ipv4.ip_forward=1/g'/etc/sysctl.conf
sudo sysctl -p
Set up iptables NAT forwarding
# Note that wlp4s0b1 represents your external network card, please use ifconfig to view or consult the network administrator
sudo iptables -t nat -A POSTROUTING -s 192.168.0.0/24-o wlp4s0b1 -j MASQUERADE
Configure MTU to forward large data packets and increase network speed
sudo iptables -I FORWARD -s 192.168.0.0/24-p tcp --syn -i ppp+-j TCPMSS --set-mss 1300
My test conditions:
Set V** according to the normal process, and fill in the campus network address where the service host is located for the server address.
If the V** connection is wrong, it may be a firewall problem, turn off the firewall
sudo ufw disable
You can refer to [Official pptp description] (http://pptpclient.sourceforge.net/howto-diagnosis.phtml#eap_response) to troubleshoot the problem.
Or refer to [here] (https://www.polarxiong.com/archives/ubuntu-ufw-V**-can-not-connect-internet.html) to allow port 1723 and other ports that may need to be opened.
Recommended Posts