admin管理员组

文章数量:1635988

linux 路由表

路由表样例

[root@centos6 ~]#route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.27.0    0.0.0.0         255.255.255.0   U     0      0        0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U     1002   0        0 eth0
0.0.0.0         192.168.27.2    0.0.0.0         UG    0      0        0 eth0

路由表主要字段说明

Destination: 目的地址,可以是主机地址、网络地址,常用的是网络地址
Gateway: 网关地址,所有未知地址都会找网关,有网关统一转发,只有边缘网络才会配置网关,并且直连网络不需要配置网关
Genmask:目的地址的子网掩码
Iface: 接口,去往目的地址的网络路径的出口(也就是从那个出口可以去往目的地址)

官方的原文

OUTPUT
  The output of the kernel routing table is organized in the following columns

  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  Possible flags include
    U (route is up)
    H (target is a host)
    G (use gateway)
    R (reinstate route for dynamic routing)
    D (dynamically inst

本文标签: 路由表简介destinationIfaceGenmask