Linux的路由表詳細介紹
一 在Linux下執行route命令
[root@localhost backup]# route -nKernel IP routing tableDestination Gateway Genmask Flags Metric Ref Use Iface0.0.0.0 192.168.0.1 0.0.0.0 UG 100 0 0 enp0s3192.168.0.0 0.0.0.0 255.255.255.0 U 100 0 0 enp0s3192.168.122.0 0.0.0.0 255.255.255.0 U 0 0 0 virbr0 [root@localhost backup]# routeKernel IP routing tableDestination Gateway Genmask Flags Metric Ref Use Ifacedefault gateway 0.0.0.0 UG 100 0 0 enp0s3192.168.0.0 0.0.0.0 255.255.255.0 U 100 0 0 enp0s3192.168.122.0 0.0.0.0 255.255.255.0 U 0 0 0 virbr0
二 route命令詳解
1、命令語法
route [-n]選項與參數:-n:將主機名以IP方式顯示
2、查詢結果分析
Destination :其實就是Network的意思。Gateway :就是該接口的Gateway的IP,若為0.0.0.0,表示不需要額外的IP。Genmask :就是Netmask,與Destination組合成一臺主機或網絡。Flags :共有多個標志可以來表示該網絡或主機代表的意義。 U:代表該路由可用。 G:代表需要經過Gateway來幫忙傳遞。 H:代表該行路由為一臺主機,而非一個網絡。Iface :就是interface(接口)的意思。
以上就是對Linux 路由表的詳解,如有疑問請留言或者到本站社區交流討論,感謝閱讀,希望能幫助到大家,謝謝大家對本站的支持!
新聞熱點
疑難解答