CentOS-min operation records (5)-configure your own VPN

Source: Internet
Author: User
Tags install perl
1. synchronization time server yum-yinstallntpdatentpdatestdtimegovhkclock-1. synchronization time server

Yum-y install ntpdate

Ntpdate stdtime.gov.hk

Clock-w

-------------------------------------------------------

Ntpdate 210.72.145.44 no

Unknown cause

It is unclear whether synchronization will be performed multiple times in the future.

Not mounted yet

-------------------------------------------------------

I bought a virtual server space from digitalocean.

Build your own vpn

Your website will be built later

5 $ January

Https://www.digitalocean.com /? Refcode = 3a6149ad9924

2. set VPN-PPTP1.yum-y install ppp

2. download and install pptpd, you can get http://poptop.sourceforge.net/yum/stable/packages/ on this site

3. yum-y install perl

4. wget http://poptop.sourceforge.net/yum/stable/packages/pptpd-1.4.0-1.el6.x86_64.rpm

Rpm-Uvh pptpd-1.4.0-1.el6.x86_64.rpm

5. after the installation, open/etc/pptpd. conf to add or modify the following configuration:

Localip 192.168.0.1 remoteip 192.168.0.234-238

6. open/etc/ppp/options.ppt pd and add the dns of the vpn (use google dns ):

Ms-dns 8.8.8.8

7. add an account to the vpn. open/etc/ppp/chap-secrets and add the user name and password in the following format:

Vpnuser pptpd thisisnewpwd *

The format is as follows: [username] [space] [server] [space] [password] [space] [IPaddresses]

8. we need to enable IP forwarding for the service. open/etc/sysctl. conf to change the following configuration:

Net. ipv4.ip _ forward = 1

# Net. ipv4.tcp _ syncookies = 1 comment out this line

9. run the following command to make the configuration take effect:

Sysctl-p

8. add rules to the firewall to allow NAT translation:

Iptables-t nat-a postrouting-o eth0-j MASQUERADE

Service iptables save

Service iptables restart

Note: When you finish step 9, check/etc/sysconfig/iptables. make sure that the POSTROUTING rule is before any REJECT rule.

10. enable the pptpd service and restart the server.

Chkconfig pptpd on

Init 6

After the system is restarted, you can connect to the server through the VPN client.

Related Article

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.