Build a vpn Server using centos
I recently set up a vpn Server and checked a lot of information. Here I will summarize it for later use.
1. Install software
1. Run cat/etc/issue to view the system version.
2. Click here to download the rpm packages of dkms, kernel-ppp, ppp (excluding devel), and pptpd systems.
3. Run the rpm command to install the following rpm packages:
Rpm-ivh dkms *
Rpm-ivh kernel-ppp *
Rpm-ivh pptpd *
Rpm-ivh ppp
The error message is displayed when you run the fourth command. libpcap. so is not installed.
4. download and install the libpcap package of the corresponding version from the corresponding image site. For example, the installation package of the 6 series system is located at the centos6 image address, open, download the libpcap-1.4.0-* package, and rpm Installation
Rpm-ivh libpcap-1.4.0 *
Configure Server Settings1. Configure the IP address range
Vi/etc/pptp. conf
Localip = 192.168.1.2
Remoteip = 192.168.193-223 # configure the IP Address allocation range for connecting to the computer
: Wq press ENTER
2. Configure the vpn user name and password list
Vi/etc/ppp/chap-secrets
# Client | server | secret | IP addresses
Usr pptpd passwd *
: Wq
** 3. Start the pptpd Service
Service pptpd start
** 4. Set nat forwarding
Iptables-t nat-F
Iptables-t nat-a postrouting-s 192.168.1.2/27-j SNAT-to 192.168.1.26 (replace 192.168.1.26 with your server ip address)
Now, you can use vpn to connect to your network.