歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> 關於Linux >> centos6.5 企業級vpn服務器搭建

centos6.5 企業級vpn服務器搭建

日期:2017/3/1 12:01:28   编辑:關於Linux
\

實驗場景: 通過------win8 vpn連接--------訪問-------vpn服務器。

一、下載並安裝VPN服務

1、下載所需安裝包

Kernel_ppp_mppe1.0.2 http://pan.baidu.com/s/1hstt8Uw

pptpd-1.4.0-3.el6.x86_64 http://pan.baidu.com/s/1c2jYteo

dkms-2.0.17.5-1.noarch.arpm http://pan.baidu.com/s/1pLN72Bp

檢查下系統已安裝的ppp 版本

ppp 2.4.4——————>pptpd 1.3.4

ppp 2.5.0——————>pptpd 1.4.0

2、依次安裝

#rpm -ivh dkms-2.0.17.5-1.noarch.rpm

#rpm -ivh kernel_ppp_mppe-1.0.2-3dkms.noarch.rpm

# rpm -ivh pptpd-1.4.0-3.el6.x86_64.rpm

二、配置VPN服務器

1、配置主配置文件

#egrep -v '^#' /etc/pptpd.conf

ppp /usr/sbin/pppd

option /etc/ppp/options.pptpd

connections 100

debug

localip 192.168.1.1(本地ip)

remoteip 10.16.1.10-20(表示vpn客戶端獲得ip的范圍)

2、配置賬號文件

# cat /etc/ppp/chap-secrets

# Secrets for authentication using CHAP

# client server secret IP addresses

####### system-config-network will overwrite this part!!! (begin) ##########

####### system-config-network will overwrite this part!!! (end) ############

Wangershui(賬號) pptpd(服務)111111(密碼)*(允許所有IP)

3、啟動服務

#service pptpd start

4.檢查服務是否啟動

ps -ef | grep pptpd

5、設置NAT並打開Linux內核路由功能

依次執行如下命令:

#iptables -t nat -F

#iptables -t nat -A POSTROUTING -s 10.16.1.0/24(內網ip) -j SNAT --to 192.168.1.1(外網ip)

#echo 1 > /proc/sys/net/ipv4/ip_forward

6、vpn開機自啟動

# chkconfig pptpd on//或者 使用ntsysv命令

7、設置iptables允許VPN連接(或禁用防火牆)

#iptables -I INPUT -p tcp --dport 1723 -j ACCEPT

#iptables -I INPUT -p tcp --dport 47 -j ACCEPT

#iptables -I INPUT -p gre -j ACCEPT

#service iptables save

#service iptables start

三、使用win8VPN客戶端接入

\

\\\\\\\\\

Copyright © Linux教程網 All Rights Reserved