linux下openvpn服务安装记

linux下openvpn服务安装记

ID:34724163

大小:60.12 KB

页数:21页

时间:2019-03-10

linux下openvpn服务安装记_第1页
linux下openvpn服务安装记_第2页
linux下openvpn服务安装记_第3页
linux下openvpn服务安装记_第4页
linux下openvpn服务安装记_第5页
资源描述:

《linux下openvpn服务安装记》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库

1、Linux下OpenVPN服务安装记操作系统是CentOS,运行在XEN架构的VPS上面。环境配置首先,检测VPS是否支持TUN(via):cat/dev/net/tun返回“cat:/dev/net/tun:Filedescriptorinbadstate”说明支持TUN。检测iptables_nat模块支持:iptables-tnat-APOSTROUTING-s10.8.0.0/24-oeth0-jMASQUERADE如果返回信息为:iptables:Unknownerror4294967

2、295说明支持模块。安装LZO库:wgethttp://www.oberhumer.com/opensource/lzo/download/lzo-2.05.tar.gztarzxvflzo-2.05.tar.gzcdlzo-2.05./configuremakemakeinstall安装OpenSSL开发库:yuminstall-yopenssl-devel服务端安装配置然后,在服务器端下载OpenVPN源代码(下载页面),目前最新版本为2.2.0:wgethttp://swupdate.op

3、envpn.net/community/releases/openvpn-2.2.0.tar.gz解压编译安装:tarzxfopenvpn-2.2.0.tar.gzcdopenvpn-2.2.0./configure–prefix=/usr/local/openvpnmakemakeinstall复制服务端样例配置文件:cpsample-config-files/server.conf/usr/local/openvpn/etc/server.conf编辑配置文件为,比如我的以下内容,采用UDP

4、协议监听53端口:##################################################SampleOpenVPN2.0configfilefor##multi-clientserver.####Thisfileisfortheserverside##ofamany-clients<->one-server##OpenVPNconfiguration.####OpenVPNalsosupports##single-machine<->single-machine##

5、configurations(SeetheExamplespage##onthewebsiteformoreinfo).####ThisconfigshouldworkonWindows##orLinux/BSDsystems.Rememberon##Windowstoquotepathnamesanduse##doublebackslashes,e.g.:##"C:\ProgramFiles\OpenVPN\config\foo.key"####Commentsareprecededw

6、ith‘#’or‘;’###################################################WhichlocalIPaddressshouldOpenVPN#listenon?(optional);locala.b.c.d#WhichTCP/UDPportshouldOpenVPNlistenon?#IfyouwanttorunmultipleOpenVPNinstances#onthesamemachine,useadifferentport#numberfor

7、eachone.Youwillneedto#openupthisportonyourfirewall.port53#TCPorUDPserver?;prototcpprotoudp#"devtun"willcreatearoutedIPtunnel,#"devtap"willcreateanethernettunnel.#Use"devtap0"ifyouareethernetbridging#andhaveprecreatedatap0virtualinterface#andbridgedit

8、withyourethernetinterface.#Ifyouwanttocontrolaccesspolicies#overtheVPN,youmustcreatefirewall#rulesforthetheTUN/TAPinterface.#Onnon-Windowssystems,youcangive#anexplicitunitnumber,suchastun0.#OnWindows,use"dev-node"forthis.#Onmostsystems,theVPNwillnotf

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。