/etc/defaulrouter文件
配置缺省網關,防止不必要的路由進程,適用于只有一個路由器通向其它網段,單一路由占用較小的路由表資源
該文件保存了缺省路由得信息。系統安裝時并沒有該文件,是用戶自己創建的。文件內容是缺省路由的地址。
#cat /etc/defaultrouter 172.16.255.254 優點: 占用資源少,只有一條路由條目。
|
/etc/gateways文件
路由表文件
net gateway metric dest. net 目標網段 router 下一跳路由器的地址 count 跳數 route命令 route add|delete [host|net] destination [gateway ] Add a route #route add net 128.50.3.0 192.168.1.1 1 delete a route #route delete net 128.50.2.0 192.168.12.2
|
查看路由表
# netstat -r Routing Table: Destination Gateway Flags Ref Use Interface ----------- ---------- ----- --- --- --------- localhost localhost UH 0 2272 lo0 202.96.0.0 192.168.12.1 U 3 562 le0 10.103.0.0 192.168.12.2 U 3 562 le0 #
|
Destination 目標網絡或主機
Gateway 轉發數據包的主機
Flags 這條路由的狀態,這個參數有這樣幾個選項:
U 端口處于激活狀態(up)
H 目標是個主機,而不是網段
Ref 同一個網絡接口地址擁有的路由條目數量
Use 通過這條路由的包數量,對于localhost來說,這個數字代表 所以接收的包數量
Interface 路由的網絡接口