ubuntu 16.04 build pptpd V** server

This article is automatically synchronized by Tencent Cloud + Community, the original address https://stackoverflow.club/article/pptpd-V**-on-ubuntu/

background#

Normal people’s Internet access starts by spending money on broadband, not normal people. For example, programmers’ Internet access starts from self-reliance.

Claim#

V** servers are usually built on Linux systems, and Ubuntu 16.04 is recommended.

step#

Install PPTPD Service##

sudo apt-get update
sudo apt-get install pptpd

Configure pptpd.conf

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

Configure PPP

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

Add user##

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

Restart PPTPD service##

sudo service pptpd restart

Configure network and routing rules to forward ipv4

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.

TroubleShooting:

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

ubuntu 16.04 build pptpd V** server
[Linux] Build Samba server (ubuntu16.04)
Build Ubuntu 12.04 cross compilation server
Ubuntu16.04 build GitLab server tutorial
Build Nginx-RTMP live server on ubuntu
Ubuntu16.04 build php5.6 Web server environment
Build a file server on ubuntu
Ubuntu build etcd
Ubuntu build Seafile
Build a Minecraft Bedrock Edition server (Ubuntu)
Ubuntu 18.04 LTS LAMP build
ubuntu install nginx server
Deploy FTP server under ubuntu
Build OpenV** Server under CentOS7
ubuntu16.04 build vim and pyt
Install OpenSSL 1.0.2 on Ubuntu Server 14.04
Ubuntu Server Chapter 8 DNS Service
Ubuntu Server Chapter 3 Package Management
Configure tomcat on ubuntu server
Ubuntu Server Chapter 7 Remote Management
Server upgrade Ubuntu 20.04 LTS record
Teach you how to build a Git server on Ubuntu
How to build an NFS file sharing server on Ubuntu 16.04
ubuntu1804 build the latest Suricata
Server upgrade Ubuntu 20.04 LTS record
Ubuntu server builds Java web server
ubuntu build python development environment
Ubuntu deploys squid proxy server
Initial setup of Ubuntu 16.04 server
Ubuntu 18.04.1 build Java environment and HelloWorld
CentOS8.1 build Gitlab server detailed tutorial
Install Chef server workstation on Ubuntu 18.04
MySQL connected to remote Ubuntu server
Build an FTP server under centos7
Install Ubuntu 18.04 server with kvm virtualization
Centos7 build java web server tomcat
Ubuntu Server Chapter 2 Command Line Basics
Build Discuz forum based on ubuntu
Use Ubuntu 16.04 for initial server setup
Install Oracle 11gR2 on Ubuntu Server 12.4.0