第一范文网 - 专业文章范例文档资料分享平台

Windows平台下实现搭建OpenVpn虚拟专用网络

来源:用户分享 时间:2025/6/29 0:02:27 本文由loading 分享 下载这篇文档手机版
说明:文章内容仅供预览,部分内容可能不全,需要完整文档或者需要复制内容,请下载word后使用。下载word有问题请添加微信号:xxxxxxx或QQ:xxxxxx 处理(尽可能给您提供完整文档),感谢您的支持与谅解。

图11

到此server端使用的证书生成完毕。

(8) 生成客户端证书 vars

图12

build-key client01

图13

图14

(9) 生成ta.key文件

vars

图15

openvpn --genkey --secret keys/ta.Key

图16

到此为止根ca、客户端、服务器端所需要的证书和密钥文件就已经全部准备就绪,接下来

要做的是配置服务器端文件和客户端文件。

C. 服务器端文件配置

(1) 服务器端的配置文件在C:\\Program Files\\OpenVPN\\sample-config文件夹下: server.ovpn内容如下(备注:以下的批注部分为当处的说明,严格按照这种格式,一处的格式不对,在启动openvpn服务器时都有可能连接不上) ################################################# # Sample OpenVPN 2.0 config file for # # multi-client server. # # # # This file is for the server side # # of a many-clients <-> one-server # # OpenVPN configuration. # # # # OpenVPN also supports # # single-machine <-> single-machine # # configurations (See the Examples page # # on the web site for more info). # # # # This config should work on Windows # # or Linux/BSD systems. Remember on # # Windows to quote pathnames and use # # double backslashes, e.g.: # # \# # # Comments are preceded with '#' or ';' # ################################################# # Which local IP address should OpenVPN # listen on? (optional) local 168.168.168.170

# Which TCP/UDP port should OpenVPN listen on? # If you want to run multiple OpenVPN instances # on the same machine, use a different port # number for each one. You will need to # open up this port on your firewall. port 8081

# TCP or UDP server? proto tcp ;proto udp

# \# \# Use \

# and have precreated a tap0 virtual interface # and bridged it with your ethernet interface. # If you want to control access policies # over the VPN, you must create firewall # rules for the the TUN/TAP interface. # On non-Windows systems, you can give # an explicit unit number, such as tun0. # On Windows, use \

# On most systems, the VPN will not function # unless you partially or fully disable # the firewall for the TUN/TAP interface. dev tap ;dev tun

# Windows needs the TAP-Win32 adapter name # from the Network Connections panel if you # have more than one. On XP SP2 or higher, # you may need to selectively disable the # Windows firewall for the TAP adapter.

# Non-Windows systems usually don't need this. ;dev-node MyTap

# SSL/TLS root certificate (ca), certificate # (cert), and private key (key). Each client # and the server must have their own cert and # key file. The server and all clients will # use the same ca file. #

# See the \# of scripts for generating RSA certificates # and private keys. Remember to use # a unique Common Name for the server # and each of the client certificates. #

# Any X509 key management system can be used.

# OpenVPN can also use a PKCS #12 formatted key file # (see \ca ca.crt

cert server01.crt

key server01.key # This file should be kept secret

# Diffie hellman parameters. # Generate your own with:

# openssl dhparam -out dh1024.pem 1024 # Substitute 2048 for 1024 if you are using

Windows平台下实现搭建OpenVpn虚拟专用网络.doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.diyifanwen.net/c6z40i8jw2z1xep036oia_3.html(转载请注明文章来源)
热门推荐
Copyright © 2012-2023 第一范文网 版权所有 免责声明 | 联系我们
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:xxxxxx 邮箱:xxxxxx@qq.com
渝ICP备2023013149号
Top