display ip routing 您所在的位置:网站首页 下一跳地址是什么 display ip routing

display ip routing

2024-07-01 07:12| 来源: 网络整理| 查看: 265

display ip routing-table

命令功能

display ip routing-table命令用来显示公网IPv4路由表的信息。

命令格式

display ip routing-table [ verbose ]

display ip routing-table ip-address [ mask | mask-length ] [ longer-match ] [ verbose ]

display ip routing-table ip-address { mask | mask-length } nexthop ip-address [ verbose ]

display ip routing-table ip-address1 { mask1 | mask-length1 } ip-address2 { mask2 | mask-length2 } [ verbose ]

display ip routing-table acl { acl-number | acl-name } [ verbose ]

display ip routing-table ip-prefix ip-prefix-name [ verbose ]

参数说明

参数

参数说明

取值

verbose

显示激活和未激活路由的详细信息。不指定该参数,则只显示激活路由的概要信息。

-

ip-address

目的IP地址。

点分十进制格式。

nexthop ip-address

下一跳的IP地址。

点分十进制格式。

longer-match

仅显示与特定网络/掩码匹配的路由。

-

mask

掩码。

点分十进制格式。

mask-length

掩码长度。

整数形式,取值范围是0~32。

ip-address1 / ip-address2

目的IP地址。ip-address1和ip-address2共同决定一个地址范围,从而显示在此范围内的路由信息。

ip-address1和ip-address2都是点分十进制格式。

mask1 | mask-length1

目的地址ip-address1的掩码/掩码长度。

-

mask2 | mask-length2

目的地址ip-address2的掩码/掩码长度。

-

acl

使用ACL对输出的信息进行过滤。如果指定的ACL不存在,将显示所有激活路由的信息。

-

acl-number

基本访问控制列表ACL(Access Control List)号。

整数形式,取值范围是2000~2999。

acl-name

命名型访问控制列表ACL的名称。

字符串形式,不支持空格,区分大小写,长度范围是1~32。以英文字母a~z或A~Z开始,可以是英文字母、数字、连字符“-”或下划线“_”的组合。

ip-prefix ip-prefix-name

指定前缀列表名称。

字符串形式,区分大小写,不支持空格,取值范围是1~169。

视图

所有视图

缺省级别

1:监控级

使用指南

应用场景

对于未加verbose参数的显示信息中,每一行代表一条路由。内容包括目的地址、掩码长度、协议、优先级、路由开销值、路由标记、下一跳和输出接口。

clip_image001 说明:

迭代路由不论迭代出多少出接口和下一跳,仅统计为一条路由。

该命令(不含verbose参数)只显示当前被优选的路由。

对于此命令,根据显示需要的不同,可以通过选择参数来进行不同的方式的匹配。

· 对于display ip routing-table ip-address,显示与目的地址最长匹配的路由表项。

· 对于display ip routing-table ip-address mask,显示与目的地址和掩码精确匹配的路由表项。

· 对于display ip routing-table ip-address longer-match,显示与目的地址和自然掩码指定的IP地址匹配的所有路由表项。

· 对于display ip routing-table ip-address mask longer-match,显示与目的地址和输入掩码指定的IP地址匹配的所有路由表项。

· 对于display ip routing-table ip-address1 mask1 ip-address2 mask2,该命令用来查看目的地址在输入的ip-address1 mask1到ip-address2 mask2范围内的路由表项。

注意事项

如果指定的ip-prefix ip-prefix-name不存在,该命令显示当前所有被优选的路由。

使用实例

# 显示当前路由表的概要信息,路由1.1.1.1/32为两条静态路由(下一跳不同),所以路由计数为8。

display ip routing-table

Route Flags: R - relay, D - download to fib

------------------------------------------------------------------------------

Routing Tables: Public

Destinations : 7 Routes : 8

Destination/Mask Proto Pre Cost Flags NextHop Interface

1.1.1.1/32 Static 60 0 D 0.0.0.0 NULL0

Static 60 0 D 100.0.0.1 GigabitEthernet1/0/0

100.0.0.0/24 Direct 0 0 D 100.0.0.1 GigabitEthernet1/0/0

100.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0

103.0.0.0/24 Direct 0 0 D 103.0.0.1 GigabitEthernet2/0/0

103.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0

127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0

127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0

表1 display ip routing-table命令输出信息描述

项目

描述

Route Flags

路由标记

· R:表示该路由是迭代路由

· D:表示该路由下发到FIB表

Routing Tables:Public

此路由表是公网路由表。

Destinations

目的网络/主机的总数

Routes

路由的总数

Destination/Mask

目的网络/主机的地址和掩码长度

Proto

用来学习路由的协议

Pre

优先级

Cost

路由开销

Flags

路由标记,即路由表头的Route Flags

NextHop

下一跳

Interface

下一跳可达的出接口

# 显示当前路由表的概要信息,路由2.2.2.2/32为一条静态路由(下一跳1.1.1.1相同),该路由为迭代路由,由于1.1.1.1有两个出接口,故2.2.2.2/32也迭代出了这两个出接口,但是目的网络仍然为一个,所以路由计数为9。

display ip routing-table

Route Flags: R - relay, D - download to fib

------------------------------------------------------------------------------

Routing Tables: Public

Destinations : 8 Routes : 9

Destination/Mask Proto Pre Cost Flags NextHop Interface

1.1.1.1/32 Static 60 0 D 0.0.0.0 NULL0

Static 60 0 D 100.0.0.1 GigabitEthernet1/0/0

2.2.2.2/32 Static 60 0 RD 1.1.1.1 NULL0

Static 60 0 RD 1.1.1.1 GigabitEthernet1/0/0

100.0.0.0/24 Direct 0 0 D 100.0.0.1 GigabitEthernet1/0/0

100.0.0.1/32 Direct 0 0 D 127.0.0.1 Ethernet1/0/0

103.0.0.0/24 Direct 0 0 D 103.0.0.1 GigabitEthernet2/0/0

103.0.0.1/32 Direct 0 0 D 127.0.0.1 Ethernet2/0/0

127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0

127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0

# 显示路由表的详细信息。

display ip routing-table verbose

Route Flags: R - relay, D - download to fib

------------------------------------------------------------------------------

Routing Table : Public

Destinations : 3 Routes : 3

Destination: 30.0.0.36/32

Protocol: Direct Process ID: 0

Preference: 0 Cost: 0

NextHop: 127.0.0.1 Neighbour: 0.0.0.0

State: Active Adv Age: 01h03m56s

Tag: 0 Priority: high

Label: NULL QoSInfo: 0x0

IndirectID: 0x0

RelayNextHop: 0.0.0.0 Interface: Ethernet3/1/0

TunnelID: 0x0 Flags: D

Destination: 60.0.0.36/32

Protocol: Direct Process ID: 0

Preference: 0 Cost: 0

NextHop: 127.0.0.1 Neighbour: 0.0.0.0

State: Active Adv Age: 00h26m41s

Tag: 0 Priority: high

Label: NULL QoSInfo: 0x0

IndirectID: 0x0

RelayNextHop: 0.0.0.0 Interface: Ethernet3/2/0

TunnelID: 0x0 Flags: D

Destination: 60.35.36.0/24

Protocol: Direct Process ID: 0

Preference: 0 Cost: 0

NextHop: 60.35.36.2 Neighbour: 0.0.0.0

State: Active Adv Age: 00h26m36s

Tag: 0 Priority: high

Label: NULL QoSInfo: 0x0

IndirectID: 0x0

RelayNextHop: 0.0.0.0 Interface: GigabitEthernet1/0/0

TunnelID: 0x0 Flags: D

表2 display ip routing-table verbose命令输出信息描述

项目

描述

Route Flags

路由标记

· R:表示该路由是迭代路由

· D:表示该路由下发到FIB表

Destinations

目的网络/主机的总数

Routes

激活路由和非激活路由的总数

Destination

目的网络/主机的地址和掩码长度

Protocol

路由协议

Process ID

路由协议的进程号

Preference

路由的优先级

Cost

路由开销

NextHop

下一跳

Neighbour

邻居

State

路由的状态

· Active:激活路由

· Invalid:无效路由

· Inactive:非激活路由

· NoAdv:不允许发布的路由

· Adv:可以发布的路由

· Del:即将被删除的路由

· Relied:迭代到下一跳及出接口的路由,或者迭代到隧道的路由

· Stale:带Stale标记的路由,在GR中使用

Age

路由的存活时间

Tag

路由管理标识。整数形式,取值范围是0~4294967295

Priority

路由的收敛优先级。

· low:低路由收敛优先级

· medium:中等路由收敛优先级

· high:高路由收敛优先级

· critical:紧要路由收敛优先级

Label

MPLS分配的标签

QoSInfo

QoS信息,其中0x0表示QoS信息为空。

IndirectID

下一跳分离关键字

RelayNextHop

迭代下一跳

Interface

迭代出接口

Tunnel ID

隧道ID

Flags

路由标记,即路由表头的Route Flags

# 显示通过ACL2000过滤的激活路由的概要信息。

display ip routing-table acl 2000

Route Flags: R - relay, D - download to fib

------------------------------------------------------------------------------

Routes Matched by Access list 2000:

Destinations : 1 Routes : 1

Destination/Mask Proto Pre Cost Flags NextHop Interface

172.16.0.0/16 Static 60 0 D 0.0.0.0 NULL0

# 显示自然掩码范围内与目的IP地址169.0.0.0匹配的路由信息。

display ip routing-table 169.0.0.0

Route Flags: R - relay, D - download to fib

------------------------------------------------------------------------------

Routing Tables: Public

Summary Count: 1

Destination/Mask Proto Pre Cost Flags Nexthop Interface

169.0.0.0/16 Static 60 0 D 2.1.1.1 LoopBack1

# 根据下一跳显示目的地址为1.1.1.1/32的路由。

display ip routing-table 1.1.1.1 32 nexthop 2.2.2.2

Route Flags: R - relay, D - download to fib

------------------------------------------------------------------------------

Routing Table : Public

Summary Count : 1

Destination/Mask Proto Pre Cost Flags NextHop Interface

1.1.1.1/32 Static 60 0 RD 2.2.2.2 NULL0

# 显示目的地址在1.0.0.0/8到4.0.0.0/24范围内的路由信息。

display ip routing-table 1.0.0.0 8 4.0.0.0 24

Route Flags: R - relay, D - download to fib

------------------------------------------------------------------------------

Routing Tables: Public

Destinations : 5 Routes : 5

Destination/Mask Proto Pre Cost Flags NextHop Interface

1.0.0.0/8 Static 60 0 D 10.0.0.1 GigabitEthernet1/0/0

1.1.1.0/24 Static 60 0 D 2.1.1.1 GigabitEthernet1/0/0

1.2.0.0/16 Static 60 0 D 10.0.0.1 GigabitEthernet1/0/0

2.1.1.0/24 Static 40 0 D 10.0.0.1 GigabitEthernet1/0/0

3.1.1.0/24 Static 60 0 D 4.1.1.1 GigabitEthernet1/0/0

# 显示通过前缀列表abc2过滤的激活路由的概要信息。

display ip routing-table ip-prefix abc2

Route Flags: R - relay, D - download to fib

------------------------------------------------------------------------------

Routes Matched by Prefix-list abc2:

Destinations : 4 Routes : 4

Destination/Mask Proto Pre Cost Flags Nexthop Interface

127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0

127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0

169.0.0.0/8 Static 60 0 D 2.1.1.1 LoopBack1

169.0.0.0/15 Static 60 0 D 2.1.1.1 LoopBack1



【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有