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

openvpnhowto中文版

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

status)

if [ -f $lock ]; then

for pidf in `/bin/ls $piddir/*.pid 2>/dev/null`; do if [ -s $pidf ]; then

kill -USR2 `cat $pidf` >/dev/null 2>&1 fi

done

echo \ else

echo \ exit 1 fi

;; *)

echo \ exit 1 esac exit 0

用inetd或xinetd衍生(instantiate)一个 OpenVPN daemon

通用服务进程 xinetd 能够响应远端节点发送的初始数据报,自动衍生一个 OpenVPN daemon 。

此 xinetd 配置会使 xinetd 进程监听 UDP 端口 5000,当流入一个 OpenVPN session (使用 pre-shared key)的数据报时,xinetd 自动衍生一个 OpenVPN daemon来处理此 session。注意使用 --inactive 参数会使 OpenVPN daemon 在发呆10分钟后超时退出。无论何种原因一旦OpenVPN daemon 退出,xinetd 服务会重新监听端口等待新的连接。另外要注意 xinetd 使用 root 权限衍生 OpenVPN daemon,但随后(读取受保护的密钥文件后) OpenVPN 会将权限降为 nobody 。

可用如下命令生成密钥(key)文件:

openvpn --genkey --secret key

注意每一条新的 OpenVPN 隧道都有它独自的端口,同时也有它自己的 xinetd 配置文件。这是因为OpenVPN 对每一个潜在的接入者需要特定的信息,包括key文件,TUN/TAP 设备,隧道节点(endpoints),和路由配置。基于这种观点在 OpenVPN 的发展中,它从不使用单个配置文件来处理一大批类似的潜在接入者,即它没有描述接入的模板文件。从OpenVPN 作为一个UDP server 实现以来,它不具有TCP server可监听一个固定端口同时可 fork 一个新的 daemon 来动态处理客户连接的优点。尽管如此,接入模板的实现已进入预期计划,只要得到开发者和最终用户社区的足够注意和支持,它一定会实现的。

-------------------------------------------------------------------------------- sample-config-files/xinetd-server-config # An xinetd configuration file for OpenVPN. #

# This file should be renamed to openvpn or something suitably # descriptive and copied to the /etc/ directory.

# xinetd can then be made aware of this file by restarting # it or sending it a SIGHUP signal. #

# For each potential incoming client, create a separate version # of this configuration file on a unique port number. Also note # that the key file and ifconfig endpoints should be unique for # each client. This configuration assumes that the OpenVPN # executable and key live in /root/openvpn. Change this to fit # your environment.

service openvpn_1 {

type = UNLISTED port = 5000 socket_type = dgram protocol = udp wait = yes user = root

server = /root/openvpn/openvpn

server_args = --inetd --dev tun --ifconfig --secret /root/openvpn/key --inactive 600 --user nobody }

-------------------------------------------------------------------------------- sample-config-files/xinetd-client-config # This OpenVPN config file

# is the client side counterpart # of xinetd-server-config dev tun ifconfig

remote my-server port 5000 user nobody

secret /root/openvpn/key inactive 600

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