到 192.168.1.1 的简​​单路由总是会到达环回接口,而不是 eth0

到 192.168.1.1 的简​​单路由总是会到达环回接口,而不是 eth0

我正在通过 wlan0 ssh 连接到树莓派并尝试通过以太网接口连接到调制解调器。

看一下我的表格和我的 ip 路由获取:

lz@raspberrypi:~ $ route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         192.168.33.1    0.0.0.0         UG    600    0        0 wlan0
192.168.1.1     0.0.0.0         255.255.255.255 UH    10     0        0 eth0
192.168.33.0    0.0.0.0         255.255.255.0   U     600    0        0 wlan0
lz@raspberrypi:~ $ ip route get 192.168.1.1
local 192.168.1.1 dev lo src 192.168.1.1 uid 1000
cache local

无论我尝试什么,它总是通过环回接口。

ifconfig 输出:

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.1  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::____________  prefixlen 64  scopeid 0x20<link>
        ether ____________  txqueuelen 1000  (Ethernet)
        RX packets 346  bytes 15916 (15.5 KiB)
        RX errors 1  dropped 346  overruns 0  frame 0
        TX packets 113  bytes 13414 (13.0 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

我也尝试了跨界面:

cat /proc/sys/net/ipv4/ip_forward
  1

网络接口

$ cat /etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)
# Include files from /etc/network/interfaces.d:
source /etc/network/interfaces.d/*
auto eth0
iface eth0 inet static
    address 192.168.1.1
    netmask 255.255.255.0

为什么路由总是以环回结束?

相关内容