在 Linux 系统中,ifconfig
命令主要用于配置和显示网络接口的信息,如 IP 地址、子网掩码、广播地址等。要查看路由信息,您应该使用 route
或 ip route
命令。
使用 route
命令查看路由信息:
route -n
使用 ip route
命令查看路由信息:
ip route show
或者
ip route
这些命令将显示系统的路由表,包括目标网络、网关、接口等信息。如果您想查看更详细的信息,可以使用 -v
选项:
route -vn
或者
ip route show -v
请注意,route
命令在一些 Linux 发行版中可能已被弃用,建议使用 ip route
命令。