企业项目管理、ORK、研发管理与敏捷开发工具平台

网站首页 > 精选文章 正文

银河麒麟V10高级服务器版SP3配置openvpn

wudianyun 2025-01-24 14:11:52 精选文章 77 ℃

本教程不适合新手,适合配置过openvpn人员,快速配置笔记。

软件环境:

操作系统:

Kylin linux Advanced Server

软件版本:

EasyRSA 3.2.1

openvpn 2.4.8





证书生成:

这个比较简单,按照网上教程一步一步生成即可。

最终生成的证书文件


服务器端生成的证书文件


服务器端 配置文件

port 1194
proto udp
dev tun
ca ca.crt
cert server.crt
key server.key  # This file should be kept secret
dh dh.pem
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
push "route 192.168.10.0 255.255.255.0"
push "route 10.8.0.0 255.255.255.0"
keepalive 10 120
tls-auth ta.key 0 # This file is secret
;cipher AES-256-GSM
compress "lz4-v2"
push "compress lz4-2"
persist-key
persist-tun
status openvpn-status.log
log-append openvpn.log
verb 3
explicit-exit-notify 1

客户的配置文件

client
dev tun
proto udp
remote 这里写你的主机名 1194
resolv-retry infinite
nobind
persist-key
persist-tun
ca ca.crt
cert client.crt
key client.key
remote-cert-tls server
tls-auth ta.key 1
verb 3
compress "lz4-v2"

配置服务器防火墙,让vpn客户可以访问服务器内网

iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -j MASQUERADE iptables -L -n -t nat 
service iptables save 
systemctl enable --now iptables


windows客户的配置如图


配置成功检测方法,vpn客户端成功后,可以ping通服务器内其他局域网客户机。

Tags:

最近发表
标签列表