Build a vpn Server using centos

Source: Internet
Author: User

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 Settings

1. 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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.