https://www.cnblogs.com/peida/archive/2013/03/05/2943698.html
[root@localhost ~]# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.120.0 * 255.255.255.0 U 0 0 0 eth0
e192.168.0.0 192.168.120.1 255.255.0.0 UG 0 0 0 eth0
10.0.0.0 192.168.120.1 255.0.0.0 UG 0 0 0 eth0
default 192.168.120.240 0.0.0.0 UG 0 0 0 eth0
[root@localhost ~]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.120.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
192.168.0.0 192.168.120.1 255.255.0.0 UG 0 0 0 eth0
10.0.0.0 192.168.120.1 255.0.0.0 UG 0 0 0 eth0
0.0.0.0 192.168.120.240 0.0.0.0 UG 0 0 0 eth0
說明:
第一行表示主機所在網(wǎng)絡(luò)的地址為192.168.120.0,若數(shù)據(jù)傳送目標是在本局域網(wǎng)內(nèi)通信,則可直接通過eth0轉(zhuǎn)發(fā)數(shù)據(jù)包;
第四行表示數(shù)據(jù)傳送目的是訪問Internet,則由接口eth0,將數(shù)據(jù)包發(fā)送到網(wǎng)關(guān)192.168.120.240
其中Flags為路由標志,標記當(dāng)前網(wǎng)絡(luò)節(jié)點的狀態(tài)。
Flags標志說明:
U Up表示此路由當(dāng)前為啟動狀態(tài)
H Host,表示此網(wǎng)關(guān)為一主機
G Gateway,表示此網(wǎng)關(guān)為一路由器
R Reinstate Route,使用動態(tài)路由重新初始化的路由
D Dynamically,此路由是動態(tài)性地寫入
M Modified,此路由是由路由守護程序或?qū)蚱鲃討B(tài)修改
! 表示此路由當(dāng)前為關(guān)閉狀態(tài)
備注:
route -n (-n 表示不解析名字,列出速度會比route 快)