VPN 流量不經過 tun0

VPN 流量不經過 tun0

午安!

我正在嘗試使用 openVpn 在 Ubuntu 中配置 VPN 伺服器。我已經配置了 server.conf 檔案和 client.conf 檔案(我的 VPN 用戶端之一是 Windows 虛擬機,另一個是 Ubuntu VM)。這些是我的配置:

伺服器設定檔

port 1194
proto udp
dev tun
ca ca.crt
cert grupo04vpn.crt
key grupo04vpn.key  # This file should be kept secret
dh dh2048.pem
server 10.0.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
push "route 172.17.20.0 255.255.255.0"
push "redirect-gateway def1 bypass-dhcp"
push "dhcp-option DNS 172.17.20.4"
client-to-client
keepalive 10 120
comp-lzo
max-clients 100
persist-key
persist-tun
status openvpn-status.log
verb 5

客戶端設定檔

client
dev tun
proto udp
remote 172.17.20.6 1194
resolv-retry infinite
nobind
persist-key
persist-tun
ca ca.crt
cert client.crt
key client.key
ns-cert-type server
comp-lzo
verb 3

我能夠從 vpn 用戶端 ping 10.0.0.1 (這是伺服器的 ip),並且我能夠從 vpn 伺服器 ping 10.0.0.10 (這是客戶端的 ip)。但是,當我從 IPTRAF 檢查 tun0 介面時,我發現沒有流量通過 tun0,僅透過 eth0。這裡你可以看到當我 ping 10.0.0.1 時 iptraf 的螢幕截圖

eth0: eth0 iptraf

這是我的網絡 拓樸結構

正如您所看到的,所有流量都通過 eth0 接口,我猜它應該通過 tun0。我真的很感激任何能讓交通正常通過隧道的幫助。

謝謝。

更新:這是 netstat -rn 的輸出

Destination   Gateway       Genmask        Flags   MSS Window  irtt Iface
0.0.0.0       10.0.0.5      128.0.0.0       UG       0 0          0 tun0
0.0.0.0       172.16.10.1   0.0.0.0         UG       0 0          0 eth0
10.0.0.0      10.0.0.5      255.255.255.0   UG       0 0          0 tun0
10.0.0.5      0.0.0.0       255.255.255.255 UH       0 0          0 tun0
128.0.0.0     10.0.0.5      128.0.0.0       UG       0 0          0 tun0
169.254.0.0   0.0.0.0       255.255.0.0      U       0 0          0 eth0
172.16.10.0   0.0.0.0       255.255.255.0    U       0 0          0 eth0
172.17.20.0   10.0.0.5      255.255.255.0   UG       0 0          0 tun0
172.17.20.6   172.16.10.1   255.255.255.255 UGH      0 0          0 eth0

相關內容