本地网络内的路由是什么?

本地网络内的路由是什么?

我的IP地址wlan1192.168.1.3.

$ netstat -r
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
default         192.168.1.1     0.0.0.0         UG        0 0          0 wlan1
192.168.1.0     *               255.255.255.0   U         0 0          0 wlan1

表中的第二个条目是否意味着如果目标与 位于同一本地网络中,则wlan1数据报不会转发到网关(*for Gateway)?

wlan1数据报从到 中的 IP 地址的路由是什么192.168.1.0/24

UG下是什么意思Flags

答案1

您是正确的,列*中的条目Gateway意味着数据包保留在本地网络中。

其中“ FlagsU表示该路由已启动,“ ”G表示该路由是到网关的路由。

列中可能出现的其他选项Flags有:

U : This flag signifies that the route is up
G : This flag signifies that the route is to a gateway. If this flag is not present then we can say that the route is to a directly connected destination
H : This flag signifies that the route is to a host which means that the destination is a complete host address. If this flag is not present then it can be assumed that the route is to a network and destination would be a network address.
D : This flag signifies that this route is created by a redirect.
M : This flag signifies that this route is modified by a redirect.

来源:http://www.thegeekstuff.com/2012/05/route-flags/

相关内容