Linux 路由的概念与路由器的设置

2020-05-14  本文已影响0人  仰天望海

route -n 查看当前路由表:

[root@XonTel /]#route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         172.16.0.1      0.0.0.0         UG    0      0        0 eth0
172.16.0.0      0.0.0.0         255.255.0.0     U     0      0        0 eth0
192.168.101.0   0.0.0.0         255.255.255.0   U     0      0        0 eth1

各字段说明:


172.16.0.0/16 和 192.168.101.0/24 是依据网络接口产生的路由,只要网络上有这几个网络接口存在,该网络接口
就会存在一个路由;

可以通过route命令设置额外的路由;使用route命令时:你所规划的路由必须是你的设备或IP可以直接
沟通(Broadcast)的情况;

上一篇 下一篇

猜你喜欢

热点阅读