show route
语法
show route <all> <destination-prefix> <logical-system (all | logical-system-name)> <private> <te-ipv4-prefix-ip te-ipv4-prefix-ip> <te-ipv4-prefix-node-ip te-ipv4-prefix-node-ip> <te-ipv4-prefix-node-iso te-ipv4-prefix-node-iso> <te-ipv6-prefix-ipv6-addr te-ipv6-prefix-ipv6-addr> <te-ipv6-prefix-node-iso te-ipv6-prefix-node-iso> <rib-sharding (main | rib-shard-name)>
语法(EX 系列交换机)
show route <all> <destination-prefix> <private>
说明
显示路由表中的活动条目。
选项
none | 显示有关路由表中所有活动条目的简要信息。 |
all | (可选)显示有关所有路由表的信息,包括专用或内部路由表。 |
destination-prefix | (可选)显示指定地址或地址范围的活动条目。 |
logical-system (all | logical-system-name) | (可选)在所有逻辑系统或特定逻辑系统上执行此操作。 |
private | (可选)仅显示有关所有专用或内部路由表的信息。 |
programmed detail | (可选)显示 API 编程的路由。 |
display-client-data | (可选)显示由路由协议处理客户端应用程序的路由安装的路由的客户端 ID 和 Cookie 信息。 |
te-ipv4-prefix-ip te-ipv4-prefix-ip | (可选)显示流量工程前缀的 IPv4 地址,如果路由表中存在,则不带掩码长度。 |
te-ipv4-prefix-node-ip te-ipv4-prefix-node-ip | (可选)显示源自流量工程节点的所有前缀。您可以从表中经过流量设计的路由 |
te-ipv4-prefix-node-iso te-ipv4-prefix-node-iso | (可选)显示源自流量工程节点的所有前缀。您可以从表中过滤具有指定 ISO 电路 ID 的 |
te-ipv6-prefix-ipv6-addr te-ipv6-prefix-ipv6-addr |
(可选)过滤流量工程 IPv6 前缀中的 IPv6 节点地址。 |
te-ipv6-prefix-node-iso te-ipv6-prefix-node-iso | (可选)过滤在流量工程 IPv6 前缀中具有指定 ISO 电路 ID 的 IPv6 路由。 |
rib-sharding (main | rib-shard-name) | (可选)显示 rib 分片名称。 |
必需的权限级别
视图
输出字段
表 1 介绍了命令的 show route
输出字段。输出字段按其显示大致顺序列出。
字段名称 |
字段说明 |
---|---|
routing-table-name |
路由表的名称(例如 inet.0)。 |
number 目的地 |
路由表中有路由的目的地数。 |
number 路线 |
路由表中的路由数和处于以下状态的路由总数:
|
destination-prefix |
路由目标(例如:10.0.0.1/24)。有时,路由信息会以另一种格式显示,例如:
|
[ protocol, preference ] |
从中获知路由的协议和路由的优先级值。
在除 BGP LocalPref 属性以外的每个路由指标中,首选值较小。为了使用通用比较例程,Junos OS 将 1 的 LocalPref 值补补存储在 Preference2 字段中。例如,如果路由 1 的 LocalPref 值为 100,则首选项 2 值为 -101。如果路由 2 的本地Pref 值 155,则首选项 2 值为 -156。路由 2 首选,因为它的本地Pref 值较高,优先级 2 值较低。 |
weeks:days hours:minutes:seconds |
路由已知时长(例如,2w4d 13:11:14 或 2 周、4 天、13 小时 11 分 14 秒)。 |
度量 |
指示路由的成本值。对于 AS 中的路由,成本由 IGP 和单个协议指标决定。对于外部路由、目标或路由域,成本由优先级值决定。 |
本地预 |
路由中包含的本地优先级值。 |
从 |
接收路由的接口。 |
AS 系列 |
AS 路径,通过它获知路由。AS 路径末尾的字母表示路径源,指示 AS 路径始发点处的路由状态:
当路由中包含 AS 路径编号时,格式如下所示:
注:
在 Junos OS 10.3 及更高版本中,如果 BGP 接收属性 128(属性集),并且您未在任何路由实例中配置独立域,则 AS 路径字段将显示无法识别的属性和关联的十六进制值。 |
封装 |
为指定 BGP 社区启用了扩展的下一跃点编码功能,用于通过 IPv6 隧道路由 IPv4 流量。当 BGP 接收的路由没有隧道社区时,不会创建 IPv4-0 或 IPv6 隧道,且在不封装的情况下解析 BGP 路由。 |
路由标签 |
BGP 路由更新中携带的标签堆栈。 |
验证状态 |
(BGP 学习型路由)路由的验证状态:
|
到 |
下一跃点前往目的地。尖括号 (>) 表示路由是所选路由。 如果目标为 |
通过 |
用于到达下一跃点的接口。如果下一跃点有多个接口可用,则实际使用的接口后跟“选定”一词。此字段还可以包含以下信息:
|
专用单播 |
(针对 MX 系列路由器的增强型订阅者管理)指示通过增强的订阅者管理来管理访问内部路由。相比之下,非由增强型订阅者管理管理的接入内部路由会显示相关的下一跃点和媒体访问控制 (MAC) 地址信息。 |
平衡 |
基于等价多路径 (ECMP) 的底层操作接口带宽分配负载,以百分比表示在下一跳网关上。 |
示例输出
- show route
- show route
- 显示路由转发表匹配 10.1.1.1
- show route 10.1.1.1 extensive expanded-nh
- show route te-ipv6-prefix-ipv6-addr
- 显示路由 te-ipv6-前缀-node-iso
- show route (VPN)
- show route(带目标前缀)
- 显示路由目标前缀详细信息
- show route extensive
- 显示路由编程详细信息
show route
user@host> show route inet.0: 11 destinations, 12 routes (11 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 1:65500:1:10.0.0.20/240 *[MVPN/70] 19:53:41, metric2 1 Indirect 1:65500:1:10.0.0.40/240 *[BGP/170] 19:53:29, localpref 100, from 10.0.0.30 AS path: I > to 10.0.24.4 via lt-0/3/0.24, label-switched-path toD [BGP/170] 19:53:26, localpref 100, from 10.0.0.33 AS path: I > to 10.0.24.4 via lt-0/3/0.24, label-switched-path toD 1:65500:1:10.0.0.60/240 *[BGP/170] 19:53:29, localpref 100, from 10.0.0.30 AS path: I > to 10.0.28.8 via lt-0/3/0.28, label-switched-path toF [BGP/170] 19:53:25, localpref 100, from 10.0.0.33 AS path: I > to 10.0.28.8 via lt-0/3/0.28, label-switched-path toF
show route
以下示例输出显示了转换路由的路由层次结构。
user@host> show route 10.1.1.1 C1.inet.0: 44 destinations, 44 routes (44 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 10.1.1.1/32 *[PRPD/10] 00:16:50, metric 2 > to 192.0.2.2 via ge-0/0/1.0
显示路由转发表匹配 10.1.1.1
user@host> show route forwarding-table matching 10.1.1.1 Routing table: C1.inet Internet: Destination Type RtRef Next hop Type Index NhRef Netif 10.1.1.1/32 user 0 indr 1048574 4 comp 624 2
show route 10.1.1.1 extensive expanded-nh
user@host> show route 10.1.1.1extensive expanded-nh C1.inet C1.inet.0: 44 destinations, 44 routes (44 active, 0 holddown, 0 hidden) 10.1.1.1/32 (1 entry, 1 announced) Installed-nexthop: Indr (0xc5c207c) ::44.0.0.1 Krt_inh (0xc6fd004) Index:1048574 PNH: ::44.0.0.1 Translate-comp (0xc5c2144) Index:624 v4tov6 src ::22.0.0.1 dest ::44.0.0.1
show route te-ipv6-prefix-ipv6-addr
user@host> show route te-ipv6-prefix-ipv6-addr 10::10 inet.0: 14 destinations, 14 routes (14 active, 0 holddown, 0 hidden) inet.3: 1 destinations, 1 routes (1 active, 0 holddown, 0 hidden) iso.0: 1 destinations, 1 routes (1 active, 0 holddown, 0 hidden) mpls.0: 14 destinations, 14 routes (14 active, 0 holddown, 0 hidden) inet6.0: 10 destinations, 11 routes (10 active, 0 holddown, 0 hidden) inet6.3: 1 destinations, 1 routes (1 active, 0 holddown, 0 hidden) lsdist.0: 18 destinations, 18 routes (18 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both IPV6 PREFIX { Node { AS:100 ISO:0100.0100.0100.00 } { IPv6:10::10/128 } ISIS-L1:0 }/1216 *[IS-IS/15] 00:07:58 Fictitious
显示路由 te-ipv6-前缀-node-iso
user@host> show route te-ipv6-prefix-node-iso 0100.0100.0100.00 inet.0: 14 destinations, 14 routes (14 active, 0 holddown, 0 hidden) inet.3: 1 destinations, 1 routes (1 active, 0 holddown, 0 hidden) iso.0: 1 destinations, 1 routes (1 active, 0 holddown, 0 hidden) mpls.0: 14 destinations, 14 routes (14 active, 0 holddown, 0 hidden) inet6.0: 10 destinations, 11 routes (10 active, 0 holddown, 0 hidden) inet6.3: 1 destinations, 1 routes (1 active, 0 holddown, 0 hidden) lsdist.0: 18 destinations, 18 routes (18 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both IPV6 PREFIX { Node { AS:100 ISO:0100.0100.0100.00 } { IPv6:10::10/128 } ISIS-L1:0 }/1216 *[IS-IS/15] 00:08:46 Fictitious IPV6 PREFIX { Node { AS:100 ISO:0100.0100.0100.00 } { IPv6:21:0:1::1/128 } ISIS-L1:0 }/1216 *[IS-IS/15] 00:08:46 Fictitious IPV6 PREFIX { Node { AS:100 ISO:0100.0100.0100.00 } { IPv6:abcd::128:207:200:16/128 } ISIS-L1:0 }/1216 *[IS-IS/15] 00:08:46 Fictitious
show route (VPN)
以下示例输出显示启用了复合下一跃点的 VPN 路由。第一个 Push
操作与外部标签相对应。第二 Push
个操作与内部标签对应。
user@host> show route 192.0.2.0 13979:665001.inet.0: 871 destinations, 3556 routes (871 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 192.0.2.0/24 [BGP/170] 00:28:32, localpref 100, from 10.9.9.160 AS path: 13980 ?, validation-state: unverified > to 10.100.0.42 via ae2.0, Push 16, Push 300368(top) [BGP/170] 00:28:28, localpref 100, from 10.9.9.169 AS path: 13980 ?, validation-state: unverified > to 10.100.0.42 via ae2.0, Push 126016, Push 300368(top) #[Multipath/255] 00:28:28, metric2 102 > to 10.100.0.42 via ae2.0, Push 16, Push 300368(top) to 10.100.0.42 via ae2.0, Push 16, Push 300368(top)
show route(带目标前缀)
user@host> show route 192.168.0.0/12 inet.0: 10 destinations, 10 routes (9 active, 0 holddown, 1 hidden) + = Active Route, - = Last Active, * = Both 192.168.0.0/12 *[Static/5] 2w4d 12:54:27 > to 192.168.167.254 via fxp0.0
显示路由目标前缀详细信息
user@host> show route 198.51.100.0 detail inet.0: 15 destinations, 20 routes (15 active, 0 holddown, 0 hidden) 198.51.100.0/24 (2 entries, 2 announced) *BGP Preference: 170/-101 ... BGP-Static Preference: 4294967292 Next hop type: Discard Address: 0x9041ae4 Next-hop reference count: 2 State: <NoReadvrt Int Ext AlwaysFlash> Inactive reason: Route Preference Local AS: 200 Age: 4d 1:40:40 Validation State: unverified Task: RT Announcement bits (1): 2-BGP_RT_Background AS path: 4 5 6 I
show route extensive
user@host> show route extensive v1.mvpn.0: 5 destinations, 8 routes (5 active, 1 holddown, 0 hidden) 1:65500:1:10.0.0.40/240 (1 entry, 1 announced) *BGP Preference: 170/-101 PMSI: Flags 0x0: Label[0:0:0]: PIM-SM: Sender 10.0.0.40 Group 203.0.113.1 Next hop type: Indirect Address: 0x92455b8 Next-hop reference count: 2 Source: 10.0.0.30 Protocol next hop: 10.0.0.40 Indirect next hop: 2 no-forward State: <Active Int Ext> Local AS: 64510 Peer AS: 64511 Age: 3 Metric2: 1 Validation State: unverified Task: BGP_64510.10.0.0.30+179 Announcement bits (2): 0-PIM.v1 1-mvpn global task AS path: I (Originator) Cluster list: 10.0.0.30 AS path: Originator ID: 10.0.0.40 Communities: target:64502:100 encapsulation:0L:14 Import Accepted Localpref: 100 Router ID: 10.0.0.30 Primary Routing Table bgp.mvpn.0 Indirect next hops: 1 Protocol next hop: 10.0.0.40 Metric: 1 Indirect next hop: 2 no-forward Indirect path forwarding next hops: 1 Next hop type: Router Next hop: 10.0.24.4 via lt-0/3/0.24 weight 0x1 10.0.0.40/32 Originating RIB: inet.3 Metric: 1 Node path count: 1 Forwarding nexthops: 1 Nexthop: 10.0.24.4 via lt-0/3/0.24
显示路由编程详细信息
user@host> show route programmed detail inet.0: 36 destinations, 37 routes (36 active, 0 holddown, 0 hidden) 100.75.1.0/27 (2 entries, 1 announced) *Static Preference: 5/100 Next hop type: Router, Next hop index: 0 Address: 0xcc38a10 Next-hop reference count: 1 Next hop: 100.30.1.2 via ge-0/0/2.0 weight 0x1, selected Session Id: 0x0 Next hop: via fti0.1001 weight 0x8001 Session Id: 0x0 State: <Active Int NSR-incapable Programmed> Age: 37 Validation State: unverified Announcement bits (1): 0-KRT AS path: I
发布信息
在 Junos OS 7.4 版之前引入的命令。
在 Junos OS 9.5 版中引入的选项 private
。
在适用于 EX 系列交换机的 Junos OS 9.5 版中引入的选项 private
。
在 Junos OS 16.2R1 版中引入的选项 display-client-data
,包括 MX80、MX104、MX240、MX480、MX960、MX2010、MX2020、vMX 系列路由器。
选项 te-ipv4-prefix-ip
和 te-ipv4-prefix-node-ip
在 MX 系列和 te-ipv4-prefix-node-iso
PTX 系列上的 Junos OS 17.2R1 版中引入。
rib-sharding
在 cRPD 20.1R1 版中引入的选项。