在 Linux 系统上可以通过以下几种方式获取路由表信息:
1. 使用 `ip route show` 命令:
```
$ ip route show
default via 192.168.1.1 dev eth0
169.254.0.0/16 dev eth0 scope link metric 1000
192.168.1.0/24 dev eth0 proto kernel scope link src 192.168.1.100
```
这个命令会显示当前系统的所有路由条目。
2. 使用 `route` 命令:
```
$ route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.1.1 0.0.0.0 UG 100 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 1000 0 0 eth0
192.168.1.0 0.0.0.0 255.255.255.0 U 100 0 0 eth0
```
`route -n` 命令会以数字形式显示路由表。
3. 直接查看 `/proc/net/route` 文件:
```
$ cat /proc/net/route
Iface Destination Gateway Flags RefCnt Use Metric Mask MTU Window IRTT
eth0 00000000 0101A8C0 0003 0 0 100 00000000 0 0 0
eth0 0000A8C0 00000000 0001 0 0 100 00FFFFFF 0 0 0
```
这个文件包含了系统当前的路由表信息。
4. 使用 `netstat` 命令:
```
$ netstat -rn
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
```
`netstat -rn` 命令可以以数字形式显示路由表。
这些命令都可以帮助你查看 Linux 系统当前的路由表信息。你可以根据自己的需要选择合适的命令来获取所需的路由信息。