无法通过 openVPN 隧道连接到 Apache 服务器

无法通过 openVPN 隧道连接到 Apache 服务器

我在 virtualbox 中使用两台虚拟机。它们都在一个子网中10.0.2.0。在第一个虚拟机上,我运行 client.conf,在另一台虚拟机上运行 server.conf 并启动 Apache 服务器。OpenVPN 隧道已成功建立。但我想让客户端中的所有流量都通过 VPN 隧道。为了测试这一点,我使用与 Apache 服务器端口共享的端口,打开 Firefox 浏览器并尝试连接https://10.0.2.5:4433。但unreachable发生了错误。不幸的是,我找不到问题。

这是我的 server.conf (带有 ip: 10.0.2.5):

#Network Configuration
mode server
proto tcp-server
dev tun
topology subnet    
ifconfig xxxx 255.255.255.0
port 1194
port-share 10.0.2.5 4433
user nobody
group nogroup
persist-key
persist-tun
keepalive 10 120
dh none
# Control Configuration (Crypto)
tls-server
tls-version-min 1.3
tls-version-max 1.3

ca /home/files/ca.crt
cert /home/files/server.crt
key /home/files/server.key
tls-ciphersuites TLS_AES_256_GCM_SHA384

# Select a cryptographic cipher and Authentication in network.
cipher AES-256-GCM
verb 5
push "redirect-gateway local def1"
push "route 10.0.2.5 255.255.255.0"

和 client.conf (带有 ip: 10.0.2.5):

#Network Configuration
;client

proto tcp-client
dev tun
pull
remote 10.0.2.5
port 1194
user nobody
group nogroup
persist-key
persist-tun
keepalive 10 120
# Control Configuration (Crypto)
tls-client
tls-version-min 1.3
tls-version-max 1.3
ca /home/ca.crt
cert /home/client.crt
key /home/client.key
tls-ciphersuites TLS_AES_256_GCM_SHA384
# Select a cryptographic cipher and Authentication in network.
cipher AES-256-GCM
verb 5
redirect-gateway local
dhcp-option DNS 10.0.2.5

提前致谢,希望您能提供帮助。

相关内容