在 Debian(以及其他 Linux 发行版)里,ifconfig 本身不能查路由。
ifconfig 只用于查看和配置网络接口(IP 地址、子网掩码、MAC、收发统计等)在 Debian 中查路由,常用以下命令:
net-tools)route -n
或
netstat -rn
ip route
或简写:
ip r
示例输出:
default via 192.168.1.1 dev eth0
192.168.1.0/24 dev eth0 proto kernel scope link src 192.168.1.10
| 命令 | 能否查路由 |
|---|---|
| ifconfig | ❌ 不能 |
| ip route | ✅ 能 |
| route -n | ✅ 能 |
如果你愿意,我也可以帮你解释某条路由的含义。