Centos6.5 install pptp-vpn Server

Source: Internet
Author: User

Centos6.5 install pptp-vpn Server

1. I am using yum for installation;

# Yum-y install dkms ppp pptpd rpm-build gcc iptables # Wait quietly

2. Configure the address range obtained by the client;

# Cat <eof>/etc/pptpd. conf

> Localip 192.168.2.2

> Remoteip 192.168.2.100-200

> Eof

Or

# Echo "localip 192.168.2.2">/etc/pptpd. conf

# Echo "remoteip 192.168.2.100-200">/etc/pptpd. conf

3. Set the dns Service of the server;

# Echo "ms-dns 8.8.8.8">/etc/ppp/options.ppt pd

# Echo "ms-dns 8.8.4.4">/etc/ppp/options.ppt pd

The above is the dns service obtained from the configuration file/etc/ppp/options.ppt pd.

5. Configure route forwarding and find the configuration file/etc/sysctl. conf;

Net. ipv4.ip _ forward = 0 # Change 0 to 1

Refresh Kernel Parameters

# Sysctl-p

6. Configure the VPN account and password

# Vim/etc/ppp/chap-secrets

# Secrets for authentication using CHAP

# Client server secret IP addresses

User1 * user1 *

User2 * suer2 *

The first column is the corresponding account. The third column corresponds to the password. The fourth column is the server address.

7. Configure Firewall settings;

# Iptables-t filter-a input-p tcp-m state NEW-m tcp -- dport 1723-j ACCEPT

# Iptables-t filter-a input-p tcp-m state NEW-m tcp -- dport 22-j ACCEPT

# Iptables-t filter-a input-p tcp-m state NEW-m tcp -- dport 47-j ACCEPT

# Iptables-a input-p gre-j ACCEPT

----- The firewall implements nat forwarding settings (two methods are available ----

# Iptables-t nat-a postrouting-s 192.168.2.0/24-j SNAT -- to-source = x. x. x. x (corresponding to the IP address on which your server can access the Internet) is the first method.

# Iptables-t nat-a postrouting-s 192.168.2.0/24-o eth0 (your Nic name)-j MASQUERADE # method 2

# Service iptables save

# Chkconfig pptpd on

# Chkconfig iptables on

# Service pptpd start

# Service iptables start

At this point, my vpn Server has been built.

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.