当我在 shell 上运行 route 命令时,我得到以下连接:
root@ct1000-1332:/opt/storage/dlogger# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default * 0.0.0.0 U 0 0 0 hso0
default my.firewall 0.0.0.0 UG 4 0 0 wlan0
192.168.2.0 * 255.255.255.0 U 0 0 0 wlan0
192.168.43.0 * 255.255.255.0 U 0 0 0 eth1
我想知道路由表中防火墙的含义。谢谢
答案1
my.firewall 是网关的符号主机名。route -n
如果您只希望使用 IP 地址,请使用此名称。示例:
doug@s15:~/temp-k-git/linux$ route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default ns1.smythies.co 0.0.0.0 UG 0 0 0 br0
10.0.3.0 * 255.255.255.0 U 0 0 0 lxcbr0
192.168.111.0 * 255.255.255.0 U 0 0 0 br0
192.168.122.0 * 255.255.255.0 U 0 0 0 virbr0
现在使用 -n 选项:
doug@s15:~/temp-k-git/linux$ route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.111.1 0.0.0.0 UG 0 0 0 br0
10.0.3.0 0.0.0.0 255.255.255.0 U 0 0 0 lxcbr0
192.168.111.0 0.0.0.0 255.255.255.0 U 0 0 0 br0
192.168.122.0 0.0.0.0 255.255.255.0 U 0 0 0 virbr0