首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >OpenVpn不能从interla LAN中平送服务器

OpenVpn不能从interla LAN中平送服务器
EN

Server Fault用户
提问于 2021-02-10 21:24:48
回答 1查看 74关注 0票数 0

我以这种方式在FW (Centos8)上配置了Centos8:

代码语言:javascript
复制
Remote Client
↓dev ens6
Server (OpenVpn + Firewalld) 10.14.128.29
↓dev ens7
Internal Lan (10.14.128.0/24)
↓                      ↓
A (10.14.128.13)     B(10.14.128.14)

A可以平BA/B不能平服务器。为什么?

我怀疑服务器的路由表中缺少什么东西。我的/etc/openvpn/server.conf

代码语言:javascript
复制
# OpenVPN Port, Protocol, and the Tun
port 1194
proto udp
dev tun

# OpenVPN Server Certificate - CA, server key and certificate
ca /etc/openvpn/server/ca.crt
cert /etc/openvpn/server/ca.crt
key /etc/openvpn/server/pkki.key

#DH and CRL key
dh /etc/openvpn/server/dh.pem


# Redirect all Connection through OpenVPN Server
server 10.14.128.0 255.255.255.0
push "route 10.14.128.0 255.255.255.0"
push "redirect-gateway def1"

# Using the DNS from https://dns.watch
push "dhcp-option DNS 84.200.69.80"
push "dhcp-option DNS 84.200.70.40"
# Redirect all Connection through OpenVPN Server
server 10.14.128.0 255.255.255.0
push "route 10.14.128.0 255.255.255.0"
push "redirect-gateway def1"

# Using the DNS from https://dns.watch
push "dhcp-option DNS 84.200.69.80"
push "dhcp-option DNS 84.200.70.40"

#Enable multiple clients to connect with the same certificate key
duplicate-cn

# TLS Security
cipher AES-256-CBC
tls-version-min 1.2
tls-cipher TLS-DHE-RSA-WITH-AES-256-GCM-SHA384:TLS-DHE-RSA-WITH-AES-256-CBC-SHA256:TLS-DHE-RSA-WITH-AES-128-GCM-SHA256:TLS-DHE-RSA-WITH-AES-128-CBC-SHA256
auth SHA512
auth-nocache

生成的路由表

代码语言:javascript
复制
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         xxx.xxx.xxx.1   0.0.0.0         UG    100    0        0 ens6
0.0.0.0         xxx.xxx.xxx.1   0.0.0.0         UG    101    0        0 ens7
10.14.128.0     10.14.128.2     255.255.255.0   UG    0      0        0 tun0
10.14.128.0     0.0.0.0         255.255.255.0   U     101    0        0 ens7
10.14.128.2     0.0.0.0         255.255.255.255 UH    0      0        0 tun0
192.168.122.0   0.0.0.0         255.255.255.0   U     0      0        0 virbr0
xxx.xxx.xxx.1   0.0.0.0         255.255.255.255 UH    100    0        0 ens6
xxx.xxx.xxx.1   0.0.0.0         255.255.255.255 UH    101    0        0 ens7
EN

回答 1

Server Fault用户

发布于 2021-02-10 21:40:57

这个错误很简单。我使用了相同的地址空间两个子网络,远程和内部的。只要改变这一行就足够了:

代码语言:javascript
复制
server 10.14.128.0 255.255.255.0

代码语言:javascript
复制
server 10.15.128.0 255.255.255.0
票数 0
EN
页面原文内容由Server Fault提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://serverfault.com/questions/1053175

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档