OpenVPN 多网关问题(服务器无法访问新客户端网关)

OpenVPN 多网关问题(服务器无法访问新客户端网关)

默认情况下,OpenVPN网关是10.8.0.x,我想另外添加10.8.1.x网关。

问题 :

具有 10.8.0.x 和 10.8.1.x ip 的客户端可以 ping 服务器并通过 ssh 进行访问。此外,客户端之间可以执行 ping 和 ssh 任务。但是,服务器只能 ping 具有 10.8.0.x ip 的设备并通过 ssh 进行连接。我无法访问 10.8.1.x。

我为客户端添加了静态 IP:

客户端1(10.8.0.x):

added "ifconfig-push 10.8.0.31 255.255.0.0" to /etc/openvpn/ccd/client1 

客户端2(10.8.1.x):

added "ifconfig-push 10.8.1.31 255.255.0.0" to /etc/openvpn/ccd/client2

此外,我在结果配置中添加了以下内容:

route-nopull
route 10.8.0.1

客户端1(10.8.0.x):

client
route-nopull
route 10.8.0.1
dev tun
proto udp
remote 11.111.111.111 1194
resolv-retry infinite
nobind
persist-key
persist-tun
remote-cert-tls server
auth SHA512
cipher AES-256-CBC
ignore-unknown-option block-outside-dns
block-outside-dns
verb 3

客户端2(10.8.1.x):

client
route-nopull
route 10.8.0.1
dev tun
proto udp
remote 11.111.111.111 1194
resolv-retry infinite
nobind
persist-key
persist-tun
remote-cert-tls server
auth SHA512
cipher AES-256-CBC
ignore-unknown-option block-outside-dns
block-outside-dns
verb 3

服务器.conf:

client-config-dir /etc/openvpn/ccd
client-to-client
local 11.111.111.111
port 1194
proto udp
dev tun
ca ca.crt
cert server.crt
key server.key
dh dh.pem
auth SHA512
tls-crypt tc.key
topology subnet
server 10.8.0.0 255.255.0.0
server-ipv6 fddd:1194:1194:1194::/64
push "redirect-gateway def1 ipv6 bypass-dhcp"
ifconfig-pool-persist ipp.txt
push "dhcp-option DNS 8.8.8.8"
push "dhcp-option DNS 8.8.4.4"
keepalive 10 120
cipher AES-256-CBC
user nobody
group nogroup
persist-key
persist-tun
verb 3
crl-verify crl.pem
explicit-exit-notify

服务器iptables:

pkts bytes target     prot opt in     out     source               destination         
 243K   51M ACCEPT     udp  --  any    any     anywhere             anywhere             udp dpt:openvpn
    0     0 ACCEPT     udp  --  any    any     anywhere             anywhere             udp dpt:openvpn
   72  7070 ACCEPT     all  --  lo     any     anywhere             anywhere            
 2602  200K ACCEPT     icmp --  any    any     anywhere             anywhere             icmp any
 269K   53M ACCEPT     all  --  any    any     anywhere             anywhere             state RELATED,ESTABLISHED
22178 1325K ACCEPT     tcp  --  any    any     anywhere             anywhere             state NEW tcp dpt:ssh

Chain FORWARD (policy ACCEPT 136K packets, 7731K bytes)
 pkts bytes target     prot opt in     out     source               destination         
26413   16M ACCEPT     all  --  any    any     anywhere             anywhere             state RELATED,ESTABLISHED
 1760  214K ACCEPT     all  --  any    any     10.8.0.0/24          anywhere            
    0     0 ACCEPT     all  --  any    any     anywhere             anywhere             state RELATED,ESTABLISHED
    0     0 ACCEPT     all  --  any    any     10.8.0.0/24          anywhere            

Chain OUTPUT (policy ACCEPT 632K packets, 124M bytes)
 pkts bytes target     prot opt in     out     source               destination         
   72  7070 ACCEPT     all  --  any    lo      anywhere             anywhere            
 2442  177K ACCEPT     icmp --  any    any     anywhere             anywhere    

相关内容