Linux operating system configuration vpn

Source: Internet
Author: User
System Environment: redhat5.2 NIC: eth0: 202.102.37. * Check the MPPE of the system first. Basically, redhat itself exists. If you see OK, you can proceed. If not, you can patch the system and install it everywhere. The modprobeppp-compress-18echookCentOS5.4 system has been installed with the Linux vpn Server process detailed description system environment: r EdHat 5.2 NIC: eth0: 202.102.37. * Check the MPPE of the system first. Basically, redhat itself exists. If you see OK, you can proceed. If not, you can patch the system and install it everywhere.
ModprobePpp- Compress-18 & echo okCentOS5.4 the system itself has the ppp version installed. You can use this version or reinstall it. I uninstalled it here and reinstall it all by myself.
Rpm-q ppp
Rpm-e rp-pppoe
Rpm-e ppp
Rm-The software required for rf/etc/ppp is as follows:
Wget http://poptop.sourceforge.net/yum/stable/packages/pptpd-1.3.4-1.rhel5.1.i386.rpm
Wget requests
Rpm-ivh pptpd-1.3.4-1.rhel5.1.i386.rpm
Rpm-ivh ppp-2.4.4-9.0.rhel5.i386.rpm
2. Set Basic Server configurations
The main configuration file is placed in
/Etc/pptpd. conf
/Etc/ppp/options.ppt pd
/Etc/ppp/chap-secretsvi/etc/pptpd. conf
Add the following information at the bottom of the Configuration:
Localip 202.102.37. * # Internet IP Address
Remoteip 192.168.8.1-254 # IP address obtained by VPN
(1) define the IP address on the vpn Server. (It is the IP address that the client can communicate with the vpn service after connecting, that is, the client may access the vpn Server through this address)
(2) define the IP segment of the client. (Use-to connect consecutive ip addresses and use commas to separate ip addresses of different segments) vi/etc/ppp/options.ppt pd
Add a row at the end
Ms-dns 61.177.7.1 # Internet DNS (you can change it to your usual dns) vi/etc/ppp/chap-secrets to grant user permissions and assign IP address format: user, service password * (courier)
# Vi/etc/ppp/chap-secrets:
# Secrets for authenti CatIon using CHAP
# Client server secret IP DdResses
Test pptpd test * (automatically obtained)
Test02 pptpd 654321 192.168.7.230 (specified IP address) 3. Enable the routing function of the Linux kernel (ensure that the routing function is enabled every time the Linux kernel is started, and add vi/etc/rc. local)
Echo "1">/proc/sys/net/ipv4/ip_forward (check whether the system SELINUX has disabled vi/etc/selinux/config and check if SELINUX = disabled) or edit/etc/sysctl. add the following statement to conf:
Net. ipv4.ip _ forward = 1
To make sysctl take effect immediately, run the following Command:-
Sysctl-p4. if iptables is enabled, the following rules are required:
Open Port 1723,47
Iptables-a input-p t Cp-- Dport 1723-j ACCEPT
Iptables-a input-p tcp -- dport 47-j ACCEPT5. start and stop the VPN Service
# Start service pptpd start
# Disable service pptpd stop
# Service pptpd restart in order to enable the VPN service to automatically start during system boot, run:
# ChkconfigPptpd on net Stat-Ap: Check whether port 1723 is enabled on the server. in this way, the VPN Server should be able to be started normally, but to use it normally, another command is required, which is not found in many articles on the network.
# Iptables-t nat-a postrouting-s 192.168.8.0/24-o eth0-j SNAT -- to 202.102.37. * (NAT translation, which can be bound to an ip address) # iptables-t nat-I POSTROUTING-s 192.168.8.0/24-j MASQUERADE # iptables-A INPUT-p gre-j ACCEPT7. enable iptable rules upon startup
# Iptables-save>/etc/sysconfig/iptables
# Chkconfig iptables on
# Chkconfig -- list iptables
View NAT
Iptables-t nat-L
Clear NAT
Iptables-t nat-F
Start NAT
Service iptables restart may need to add this route to access the Internet. (used by two NICS)
Ip route add 192.168.0.0/16 via 192.168.8.1create a VPN dial-up connection client in Windows: 1. Open the network connection, click "Create a new connection" in the list on the left, and click "Next ". 2. Select "connect to my workplace network" and click "Next ". 3. Select "Virtual Private Network Connection" and click "Next ". 4. Enter any name in the "Company Name" input box. You just like it and click "Next ". 5. Enter the domain name or IP address on the vpn Server in the "host name or IP address" box, click "Next", and click "finish" to create the connection, A connection icon is added to the network connection window. 6. Click the icon, open a connection window, enter the username and password you just added in/etc/ppp/chap-secrets, and click "Connect ", if the configuration is correct, the connection is established. The ip address used now displays the ip address on the server.

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.