TCP/IP linux路由表详解
Linux内核的路由表
通过route -n命令查看Linux内核路由表:
[root@bogon ~]# route -n
Kernel IP routing table
Destination Gateway Genmask FLags Metric Ref Use Iface
0.0.0.0 10.139.128.1 0.0.0.0 UG 0 0 0 eth0
10.0.0.10 10.139.128.1 255.255.255.255 UGH 0 0 0 eth0
10.139.128.0 0.0.0.0 255.255.224.0 U 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 1002 0 0 eth0
字段 | 含义 |
---|---|
Destination | 目的网络或者目标主机;当Destination为default(0.0.0.0)时,表示所有数据发送到默认网关,上图中所示为10.139.128.1 |
Gateway | 网关地址,0.0.0.0表示当前记录对应的Destination与本机所属网络相同,通信时不需要路由。 |
Genmask | Destination的网络掩码 |
Flags | U-路由是活动的;H-目标 |