我当前的 IP 是 192.168.31.77,但现在我无法 ping 通网关 192.168.31.1,这是我使用的网络ifconfig
:
[dolphin@MiWiFi-R4CM-srv network-scripts]$ ifconfig
br0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 192.168.31.78 netmask 255.255.255.0 broadcast 192.168.31.255
ether 06:b2:78:35:2c:73 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1 bytes 54 (54.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
eno2: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
ether 2c:f0:5d:2c:6e:d5 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 16 memory 0xa1200000-a1220000
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 21641 bytes 10131426 (9.6 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 21641 bytes 10131426 (9.6 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
virbr0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 192.168.122.1 netmask 255.255.255.0 broadcast 192.168.122.255
ether 52:54:00:39:c6:9f txqueuelen 1000 (Ethernet)
RX packets 306 bytes 29011 (28.3 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1275 bytes 349679 (341.4 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
vnet0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet6 fe80::fc54:ff:fe68:f8d9 prefixlen 64 scopeid 0x20<link>
ether fe:54:00:68:f8:d9 txqueuelen 1000 (Ethernet)
RX packets 18802 bytes 1759871 (1.6 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 21395 bytes 2447455 (2.3 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
wlo1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.31.77 netmask 255.255.255.0 broadcast 192.168.31.255
inet6 fe80::2ac2:c907:fd23:c4d8 prefixlen 64 scopeid 0x20<link>
ether 74:d8:3e:76:46:98 txqueuelen 1000 (Ethernet)
RX packets 961736 bytes 1143507635 (1.0 GiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 373606 bytes 53955089 (51.4 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
这是arp -a
输出:
[dolphin@MiWiFi-R4CM-srv network-scripts]$ arp -a
? (192.168.31.29) at <incomplete> on br0
_gateway (192.168.31.1) at 50:d2:f5:7c:4a:60 [ether] on wlo1
? (192.168.31.30) at <incomplete> on br0
_gateway (192.168.31.1) at <incomplete> on br0
为什么无法 ping 通网关地址?
答案1
问题在于br0
和wl01
共享同一网络 ( 192.168.31.7/24
),即网关所在的网络。
分配不同的网络即可wl01
解决该问题。
192.168.31.1
您还可以尝试通过正确的设备创建明确的路由或添加wl01
到网桥。