ifconfig
命令主要用于配置和显示网络接口的参数,如 IP 地址、子网掩码等,但它并不直接显示路由表。要查看路由表,您可以使用 route
或 ip route
命令。
使用 route
命令查看路由表:
route -n
或者使用 ip route
命令查看路由表:
ip route show
这两个命令都会显示系统的路由表,包括目标网络、网关、接口等信息。如果您想查看更详细的信息,可以使用 -v
选项:
route -vn
或者
ip route show table all
请注意,根据您的 Linux 发行版和版本,某些命令可能略有不同。