linux route命令输出详解

添加路由,即将本机网段ip与其它机器网段ip可以ping通:

route add -net 目的网段(如:10.22.122.0) netmask 255.255.255.0 gw 本机网段网关 dev 网卡id

输出详解
route命令输出的路由表字段含义如下:
Destination 目标
The destination network or destination host. 目标网络或目标主机。

Gateway 网关
      The gateway address or '*' if none set. 网关地址,如果没有就显示星号。

Genmask 网络掩码
      The  netmask  for  the  destination net; '255.255.255.255' for a
      host destination and '0.0.0.0' for the default route.


 Flags:总共有多个旗标,代表的意义如下:                        

     o U (route is up):该路由是启动的;                       

     o H (target is a host):目标是一部主机 (IP) 而非网域;                       

     o G (use gateway):需要透过外部的主机 (gateway) 来转递封包;                       

     o R (reinstate route for dynamic routing):使用动态路由时,恢复路由资讯的旗标;                       

     o D (dynamically installed by daemon or redirect):已经由服务或转 port 功能设定为动态路由                       

     o M (modified from routing daemon or redirect):路由已经被修改了;                       

     o !  (reject route):这个路由将不会被接受(用来抵挡不安全的网域!)

     o A (installed by addrconf)



     o C (cache entry)

Metric 距离、跳数。暂无用。
      The 'distance' to the target (usually counted in  hops).  It  is
      not  used  by  recent kernels, but may be needed by routing dae-
      mons.

Ref   不用管,恒为0。
      Number of references to this route. (Not used in the Linux  ker-nel.)

Use    该路由被使用的次数,可以粗略估计通向指定网络地址的网络流量。
      Count  of lookups for the route.  Depending on the use of -F and
      -C this will be either route cache misses (-F) or hits (-C).

Iface 接口,即eth0,eth0等网络接口名
      Interface to which packets for this route will be sent.
  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值