Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install VPN in a CentOS6.5 environment

2025-01-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly explains "how to install VPN in the CentOS6.5 environment". The content of the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn how to install VPN in the CentOS6.5 environment.

System: centos 6.564 bit

Public network ip:139.155.96.23

Private network ip:172.27.0.12

System resources: 1 core 1 gb 1 mbps

Step 1: install ppp and pptp

Enter the command:

Yum install-y ppprpm-ivh http://static.ucloud.cn/pptpd-1.3.4-2.el6.x86_64.rpm

Description: yum install-y ppp pptpd should also be used directly.

Step 2: edit pptp.conf

Open the file through vi / etc/pptpd.conf and add the following two lines of information at the end of the file:

Localip 10.8.0.1remoteip 10.8.0.10-100

Note: this address setting has nothing to do with the original address of my server, which refers to the address of the server and the address that can be assigned by the dialed client after it is configured.

Step 3: edit options.pptpd

Open the file through vi / etc/ppp/options.pptpd and add the following two lines of information at the end of the file:

Ms-dns 8.8.8.8ms-dns 8.8.4.4

Note: these two dns servers are provided by Google. Here the setting is dns for vpn. You can also change them to other available servers, such as 114.114.114.114 or other dns commonly used in China.

Step 4: edit chap-secrets

Open the file through vi / etc/ppp/chap-secrets and add the following information to the end of the file:

Test pptpd test *

Note: looking at the comments in the screenshot below, you can also guess that the first test represents the user name of the pptpd service, the second test is the password, and the * number represents any ip address to log in.

Step 5: edit sysctl.conf

Open the file through vi / etc/sysctl.conf and add the following information to the end of the file:

Net.ipv4.ip_forward = 1

After saving the file, execute the following command to configure it to take effect:

Sysctl-p

Note: this item is used to turn on the network forwarding function. Some configuration files already have net.ipv4.ip_forward, which is only 0, which can be directly modified to 1.

Step 6: configure nat

Execute the following two commands:

Iptables-t nat-a postrouting-s 10.8.0.0 eth0 24-o eth0-j masqueradeservice iptables save

Step 7: start the pptp service

Execute the following command:

Service pptpd start

Step 8: set to boot

Execute the following two commands:

Chkconfig pptpd on

Chkconfig iptables on

Ok, the following entire configuration is over. I have managed win10 to create a new vpn dial-up that can log in and open the web page. The original reference document also mentioned further setting up the firewall, but I did not set it any further.

Then there are two questions:

One is that the speed of surfing the Internet is worrying. After reading other documents, it is mentioned that it may be the relationship of mtu, so I will set it up again later.

Another problem is that I have no problem dialing at home, but there is something wrong with dialing in the company. There is an article saying that this may be because the router does not support pptp penetration, uh-huh, so consider setting up other vpn environments later.

For the slow network, refer to the original text:

After debugging, there is indeed an obvious difference. All you need is to set the size of the mss. Here are the commands I set up on my lab server:

Step 9: set up mss

Enter the following two commands at the command line to modify the firewall configuration and make it effective:

Iptables-I forward-p tcp-- syn-I ppp+-j tcpmss-- set-mss 1356service iptables save Thank you for reading, this is the content of "how to install VPN in CentOS6.5 environment". After the study of this article, I believe you have a deeper understanding of how to install VPN in the CentOS6.5 environment, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report