Centos5 configure vpn pptp Service

Source: Internet
Author: User
Tags unsupported

Download the target RPM from http://poptop.sourceforge.net/yum/stable/packages/

My 64-bit centos5.5 download is

Http://poptop.sourceforge.net/yum/stable/packages/pptpd-1.3.4-2.rhel4.x86_64.rpm

Install

Rpm-IVH pptpd-1.3.4-2.rhel4.x86_64.rpm

1. Modify the main configuration file/etc/pptpd. conf. You only need to add the following two lines

Localip 10.0.0.1remoteip 10.0.0.100-200

2. Modify the option file/etc/PPP/options.ppt PD. You need to set the DNS assigned to the client.

MS-DNS 8.8.4.4ms-DNS 8.8.8.83. Add an account. Add (* Indicates a dynamic IP address or an IP address) youraccount pptpd yourpassword * by editing the file/etc/PPP/chap-secrets *

4. Start the service

Service pptpd start


5. modify the configuration file/etc/sysctl. conf to make net. ipv4.ip _ forward = 1

Effective immediately

Echo
1>/proc/sys/NET/IPv4/ip_forward


6. Set a NAT forwarding route (you can create a file to run manually each time or put it in an automatic running script)

/Sbin/iptables
-T Nat-A postrouting-s 10.0.0.0/24-O eth0-j snat -- To 202.16.12.158

/Sbin/iptables
-T Nat-A postrouting-O eth0-J
Masquerade

/Etc/init. d/iptables
Save

/Etc/init. d/iptables
Restart

Service
Pptpd restart

If you find that you can only access QQ and Baidu, but cannot open the webpage, run the following command to modify the MTU of the VPN Server (you can view the MTU of the server ppp0 as 1396 through netstat-I, each 20 bytes of the IP and TCP header is 1356)

 

/Sbin/iptables-I forward-p tcp -- syn-I PPP +-J tcpmss -- Set-MSS 1356

You can access the Internet on your computer and iOS, but android can connect and cannot access the Internet.

It is found that there are errors similar to this in/var/log/messages of centos.

Pppd [6893]:
MPPE 128-bit stateless compression Enabled
......
Pppd [6893]: Protocol-reject for unsupported protocol 0x0000d
Pppd [6893]: Protocol-reject for unsupported protocol 0xd897
Pppd [6893]: Protocol-reject for unsupported protocol 0x486a

Solution:
Comment out the following line in/etc/pptpd. conf or/etc/PPP/options.ppt PD:

Require-mppe-128

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.