网站首页 > 精选文章 正文
本教程不适合新手,适合配置过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通服务器内其他局域网客户机。
猜你喜欢
- 2025-01-24 宝塔面板CentOS6.x/7.x系统盘迁移到数据盘操作方法
- 2025-01-24 谷歌Go团队震撼变动!十二年领航者突然退位,未来走向引猜测
- 2025-01-24 DEVC++的卸载(卸载devc++会删除cpp吗)
- 2025-01-24 “日本全国受游击队或特殊部队攻击”?!日本雅虎APP一条弹窗吓坏网民
- 2025-01-24 一文理解 K8s 容器网络虚拟化(k8s虚拟化部署kvm)
- 2025-01-24 WIN10出现重大蓝屏漏洞 可被黑客用于拒绝服务攻击
- 2025-01-24 ESP32 开发入门 使用 Arduino IDE
- 2025-01-24 Win11学院:在Windows11 25905预览版中如何启用Dev Drive
- 2025-01-24 癌细胞也能玩“特洛伊木马计”,靠的是什么?
- 2025-01-24 微软组建新AI团队,瞄准端到端应用开发与部署
- 最近发表
- 标签列表
-
- 向日葵无法连接服务器 (32)
- git.exe (33)
- vscode更新 (34)
- dev c (33)
- git ignore命令 (32)
- gitlab提交代码步骤 (37)
- java update (36)
- vue debug (34)
- vue blur (32)
- vscode导入vue项目 (33)
- vue chart (32)
- vue cms (32)
- 大雅数据库 (34)
- 技术迭代 (37)
- 同一局域网 (33)
- github拒绝连接 (33)
- vscode php插件 (32)
- vue注释快捷键 (32)
- linux ssr (33)
- 微端服务器 (35)
- 导航猫 (32)
- 获取当前时间年月日 (33)
- stp软件 (33)
- http下载文件 (33)
- linux bt下载 (33)