Centos 6.4 Install PPTP and configure the Debian GNOME desktop VPN Client connection

Source: Internet
Author: User
Tags centos vps iptables vps server

The following is based on the Linode VPS Centos 6.4 Install PPTP service, remember that the Linode VPS is Xen virtual, so please see the environment configuration clearly.

Fast installation, of course, Yum:

# RPM-UVH http://poptop.sourceforge.net/yum/stable/rhel6/pptp-release-current.noarch.rpm
# yum Install pptpd

Package PPTPD and PPP will be installed automatically, and if you are compiling manually, install the corresponding PPTPD and PPP, which can be automatically resolved and installed here:

ppp-2.4.5-33.0.rhel6.x86_64.rpm
pptpd-1.4.0-3.el6.x86_64.rpm

The following starts the configuration of pptpd.
1. Editor/ETC/PPP/OPTIONS.PPTPD:
# Mv/etc/ppp/options.pptpd/etc/ppp/options.pptpd.bak
# VI/ETC/PPP/OPTIONS.PPTPD
Join
Name PPTPD
Refuse-pap
Refuse-chap
Refuse-mschap
Require-mschap-v2
require-mppe-128
Proxyarp
Lock
Nobsdcomp
Novj
Novjccomp
Nologfd
Idle 2592000
Ms-dns 8.8.8.8
Ms-dns 8.8.4.4

Ms-dns 8.8.8.8, Ms-dns 8.8.4.4 Represents a DNS server that uses Google

2. Editor/etc/ppp/chap-secrets:

# Cp/etc/ppp/chap-secrets/etc/ppp/chap-secrets.bak
# vi/etc/ppp/chap-secrets

Add user and password entries

# Secrets for authentication using CHAP
# Client Server Secret IP addresses
Vpnusername pptpd Vpnpassword *

Vpnusername is your VPN account, Vpnpassword is your VPN login password and will use this account and password when configuring the client.

3. Configure PPTP, edit/etc/pptpd.conf:

# Cp/etc/pptpd.conf/etc/pptpd.conf.bak
# vi/etc/pptpd.conf

Add Content:
Localip YOUR. SERVER. Ip. Address
Remoteip YOUR. SERVER. Ip. Address+1-255,your. SERVER. IP.1 # IP range obtained by VPN clients
Among them, YOUR. SERVER. Ip. Address replacement for your VPS server IP addresses, if it is 10.0.0.122, then Localip is 10.0.0.122, and Remoteip is 10.0.0.123-255,10.0.0.1.

But after testing, Localip and REMOTEIP can be virtual IP, I can set Localip to 10.0.0.1, and REMOTEIP can be set to 10.0.0.122-255. By default, pptpd.conf already has the recommended default IP range, just remove the front # and save it.
# (Recommended)
#localip 192.168.0.1
#remoteip 192.168.0.234-238,192.168.0.245
# or
#localip 192.168.0.234-238,192.168.0.245
#remoteip 192.168.1.234-238,192.168.1.245

Change to:

# (Recommended)
Localip 192.168.0.1
Remoteip 192.168.0.234-238,192.168.0.245
# or
#localip 192.168.0.234-238,192.168.0.245
#remoteip 192.168.1.234-238,192.168.1.245

4. Add IPv4 Forwarding:

# vi/etc/sysctl.conf
Net.ipv4.ip_forward=1

Change the net.ipv4.ip_forward=0 to 1

5. Enable IPv4 forwarding:

# sysctl-p

Then start Pptpd:service pptpd start

6. Enable Iptables forwarding:

Iptables-t nat-a postrouting-s YOUR. SERVER. Ip.0/24-o Eth0-j Masquerade

This YOUR. SERVER. IP is the first three paragraphs of the localip above pptpd.conf, for example: 10.0.0.122, is 10.0.0.0/24.

And then Save:

# Service Iptables Save
# Service Iptables Restart

Here, the entire PPTP service configuration has been completed, and the VPN client can be configured to connect.
My desktop system is Debian Wheezy gnome and is installed with Network-manager-gnome, so install:

$ sudo apt-get install NETWORK-MANAGER-PPTP
$ apt-get Install Network-manager-pptp-gnome

After installation, "VPN connection-> Add VPN Connection" appears in Network-manager, after clicked, creates the new VPN connection, remembers one point, in the Advanced option, must choose "uses point-to-point security encryption (MPPE) (P)" This, Otherwise it will not be connected.

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.