What is VPN first? A virtual private network (VPN) is defined as a temporary and secure connection through a public network (usually the Internet). It is a secure and stable tunnel through a chaotic public network. A virtual private network is an extension of the enterprise Intranet. Virtual private network can help remote users, company branches, business partners and supply
What is VPN first?
A virtual private network (VPN) is defined as a temporary and secure connection through a public network (usually the Internet). It is a secure and stable tunnel through a chaotic public network. A virtual private network is an extension of the enterprise Intranet.
Virtual private network can help remote users, company branches, business partners and suppliers to establish trusted and secure connections with the company's intranet, and ensure secure data transmission. By transferring data streams to a low-cost pressure Network, an enterprise's virtual private network solution will greatly reduce the cost of user spending on man and remote network connections. At the same time, this will simplify the design and management of the network and accelerate the connection to new users and websites. In addition, the virtual private network can protect existing network investment. With the continuous development of users' business services, enterprise virtual private network solutions allow users to focus on their own business, rather than on the network. A virtual private network can be used for the global internet access of increasing mobile users to achieve secure connections. it can be used to implement virtual private lines for secure communication between enterprise websites, it is used to economically and effectively connect commercial partners and users to a secure, out-of-network virtual private network.
1. prepare the tool pptpd-1 [1]. 3.4-1. rhel5.1.i386. rpm, ppp, dkms, kernel_ppp_mppe, these rpm packages.
Run the rpm-qa | grep software package to check whether you have installed pptpd, dkms, and pptpd packages. Wget http://poptop.sourceforge.net/yum/stable/packages/pptpd-1.3.4-2.rhel5.i386.rpm
2. rpm-ivh pptpd-1 [1]. 3.4-1. rhel5.1.i386. rpm // install this package
3.ppt pd has many descriptions in the default configuration, which is not easy to read. So the sorting is as follows:
The/etc/ppp/options.ppt pd Directory has a default configuration that can be moved to another place to save the music video first.
Vi/etc/ppp/options.ppt pd
Enter the following content:
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
4. configure the/etc/ppp/chap-secrets file to configure the user name and logon ip address segment of the client vpn, and save the music video by default.
Enter the following content
# Secrets for authentication using CHAP
User name, protocol password * indicates that all ip addresses can log on.
# Client server secret IP addresses
Test pptpd 123456 *
5. the option/etc/pptpd. conf file is also backed up and moved elsewhere.
Enter the following content:
Option/etc/ppp/options.ppt pd
Logwtmp
Localip 192.168.1.1 // This is the local IP address
Remoteip192.168.1.2-30 // This indicates that the ip address segment obtained by the vpn is 2-30, and different ip addresses can be separated by commas. the default number of vpn connections is 10.
6. configure/etc/sysctl. conf
Change net_ipv4.ip_forward = 0 to net_ipv4.ip_forward = 1.
Enable forwarding permanently.
7. temporarily activated/sbin/sysctl-p
8. start The pptp vpn server process.
/Sbin/service pptpd start
If you see OK.
9. setIptablesDisable the firewall.
10. set NAT
Iptables-t nat-a postrouting-s 192.168.1.0/24-o eth0-j SNAT -- to-source WANip OR
Iptables-t nat-a postrouting-o eth0-s 192.168.1.0/24-jMASQUERADE
/Etc/init. d/iptables save
/Etc/init. d/iptables restart
After pptpd is installed, the Ports 1723 and 47 are automatically opened. if not, run the following command:
Iptables-a input-p tcp? Dport 1723-j ACCEPT
Iptables-a input-p tcp? Dport 47-j ACCEPT
Iptables-a input-p gre-j ACCEPT
/Etc/init. d/iptables save
/Etc/init. d/iptables restart
You can use netstat-an to check whether the port is opened.
You can also write a script and place it in/etc/rc. local to start the instance.
Run the chkconfig pptpd on and chkconfig iptables on commands to start the pptpd service. You can also set it using nstsysv.
Restart the pptpd process:
Service pptpd restart
Client vpn connection windows xp Network and Internet connection --- create a new connection. Connect to the vpn.
650) this. width = 650; "src =" http://upload.server110.com/image/20131203/204G62628-0.jpg "/>
650) this. width = 650; "src =" http://upload.server110.com/image/20131203/204GC1Z-1.jpg "/>
650) this. width = 650; "src =" http://upload.server110.com/image/20131203/204GB630-2.jpg "/>
Enter the connection ip address.
650) this. width = 650; "src =" http://upload.server110.com/image/20131203/204G63J3-3.jpg "/>
The connection is successful.