使用 tun-adapter 的 yocto 系統上的預設路由錯誤

使用 tun-adapter 的 yocto 系統上的預設路由錯誤

我能夠建立一個支援 tun 適配器的 yocto 專案映像。連接建立後,ip 路由目的地 0.0.0.0網關0.0.0.0已創建,但我的互聯網連接已斷開。我的問題是,我不知道是誰或什麼創建了這個規則。我確信建立連接的軟體不會創建任何路由(我是開發人員)。有誰知道如何阻止這條路線?

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         0.0.0.0         0.0.0.0         U     0      0        0 VPN
0.0.0.0         192.168.178.1   0.0.0.0         UG    10     0        0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U     0      0        0 VPN
192.168.178.0   0.0.0.0         255.255.255.0   U     0      0        0 eth0
192.168.255.0   0.0.0.0         255.255.255.0   U     0      0        0 VPN

這是我的 /etc/network/interfaces 腳本

# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)

# The loopback interface
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

答案1

我找到了一個解決方案:康曼安裝在此 yocto 系統上。如果我透過 tun 適配器將其添加到 connman 的黑名單中,則不再有問題的路由。

/etc/connman/main.conf

[General]
AlowHostnameUpdates=false
NetworkInterfaceBlacklist=eth,wlan,VPN

相關內容