BGP 路由反射器
了解 BGP 路由反射器
本主题讨论如何使用 BGP 路由反射器来简化配置并帮助扩展。
在 BGP 自治系统 (AS) 中,路由必须分布在所有 AS 边界路由器之间。边界网关协议 (BGP) 通过内部 BGP (IBGP) 对等会话实现这一点。默认情况下,从一个 IBGP 对等方获知的路由不会播发给其他 IBGP 对等方。此限制要求 AS 中的所有路由器之间存在 IBGP 会话的全网状结构,以确保完整的路由可见性。
但是,维护全网状网络会增加配置的复杂性并限制可扩展性。每个新的 IBGP 对等方都必须与 AS 中的每个其他对等方建立会话。全网状网络所需的会话总数使用公式 v * (v - 1)/2 计算得出,其中 v 代表 BGP 对等节点的数量。
除了配置开销,全网状还会增加路由扩展。每个 IBGP 对等方接收所有路由,即使许多路由对于其在网络中的位置来说并不理想。
在 RFC 4456 中定义的 BGP 路由反射解决了 IBGP 全网状拓扑的可扩展性挑战。路由反射允许被称为路由反射器 (RR) 的路由器将从一个 IBGP 对等方获知的路由重新分配给其他 IBGP 对等方。这放宽了阻止 IBGP 到 IBGP 路由播发的默认 BGP 规则。
由于路由反射引入了路由环路的可能性,因此 RFC 4456 定义了两个新的 BGP 路径属性,以确保环路预防和一致的路径选择:
ORIGINATOR_ID — 标识最初播发路由的BGP邻接方的路由器 ID。仅当首次反映路由时,才会附加 ORIGINATOR_ID 属性。
CLUSTER_LIST — 记录路由反射器的群集 ID,这些 ID 在路由通过网络传播时已反映路由。
有关这些属性如何影响 BGP 最佳路径选择的详细信息,请参阅 了解 BGP 路径选择。
由于内部 BGP (IBGP) 全网状要求,大多数网络使用路由反射器来简化配置。使用路由反射器,路由器可按群集分组,群集由自治系统特有的数字标识符标识。在群集中,您必须配置从单个路由器(路由反射器)到每个内部对等方的 BGP 会话。使用此配置,可以满足 IBGP 全网状要求。
要在 AS 中使用路由反射,请将一个或多个路由器指定为路由反射器,通常为每个接入点 (接入点) 一个。路由反射器能够将从内部对等方获知的路由重新播发至其他内部对等方。路由反射不需要所有内部对等方彼此完全网状,而只需要路由反射器与所有内部对等方完全网状。路由反射器及其所有内部对等方组成一个群集,如 图 1 所示。
对于某些瞻博网络设备,您必须在使用路由反射器的每台设备上安装高级 BGP 功能许可证。有关许可证的详细信息,请参阅《 软件安装和升级指南》。
图 1 显示了配置为群集 127 路由反射器的路由器 RR。其他路由器被指定为群集内的内部对等方。BGP 路由由任何内部对等方播发至路由器 RR。然后,RR 会将这些路由重新播发至群集中的所有其他对等方。
您可以通过配置路由反射器的全网状结构来配置多个群集并将其链接起来(参见 图 2)。
图 2 将路由反射器 RR 1、RR 2、RR 3 和 RR 4 显示为全网状内部对等方。当路由器将路由播发至 RR 1 时,RR 1 会将路由重新播发至其他路由反射器,而其他路由反射器又会将路由重新播发至 AS 中的其余路由器。路由反射允许路由在整个 AS 中传播,而不会出现全网状要求造成的扩展问题。
支持多个群集的路由反射器不接受来自非客户端路由器的具有相同群集 ID 的路由。因此,您必须为冗余 RR 配置不同的群集 ID,以便将路由反映到其他群集。
客户端是从路由反射器接收路由的 IBGP 路由器。非客户端是另一个 IBGP 邻接方。路由反射器仅将从非客户端获知的路由播发至其客户端,而不播发至非客户端。但是,路由反射器会将从客户端获知的路由通告给客户端和非客户端。
但是,随着群集变大,带有路由反射器的全网格变得难以扩展,路由反射器之间的全网格也变得难以扩展。为了帮助解决此问题,您可以将路由器群集分组到群集中,以进行分层路由反射(参见 图 3)。
图 3 显示 RR 2、RR 3 和 RR 4 分别作为群集 127、19 和 45 的路由反射器。网络管理员没有对这些路由反射器进行完全网格化,而是将它们配置为另一个群集(群集 6)的一部分,其中 RR 1 是其路由反射器。当路由器将路由播发至 RR 2 时,RR 2 会将路由重新播发至其自身群集中的所有路由器,然后将路由重新播发至 RR 1。RR 1 将路由重新播发至其群集中的路由器,这些路由器通过其群集向下传播路由。
也可以看看
非转发路由反射器
在许多网络中,部署 BGP 路由反射器是为了提高可扩展性,但不直接参与流量转发。这些路由反射器保持 BGP 控制平面功能,不参与数据转发。当路由反射器不在流量路径中时,无需将其反映的路由安装到其转发表中。此类设备称为非转发路由反射器。
您可以通过下列方式之一配置非转发路由反射器:
-
使用
no-install语句 – 该语句在 Junos OS 15.1 版中引入,no-install可防止在转发表中安装 BGP 路由。您可以在以下层级为每个地址族配置此选项:[edit protocols bgp family family-name] set no-install
-
使用转发表导出策略 – 在早于 15.1 的 Junos OS 版本中,您可以通过配置拒绝从 BGP 获知的路由的转发表导出策略来实现类似的行为。
非转发路由反射器有助于减少主要用作控制平面路由器的设备上的资源负载,特别是在大型服务提供商网络中。
示例:配置路由反射器
此示例说明了如何配置路由反射器。
要求
配置此示例之前,不需要除设备初始化之外的特殊配置。
概述
通常,启用了内部 BGP (IBGP) 的设备需要完全网状化,因为 IBGP 不会将更新重新播发到其他支持 IBGP 的设备。全网状结构是在每台支持 IBGP 的设备上配置多个 neighbor 语句来实现的逻辑网格。全网格不一定是物理全网格。在大型部署中,维护全网状(逻辑或物理)并不能很好地扩展。
图 4 显示了设备 A 充当路由反射器的 IBGP 网络。设备 B 和设备 C 是路由反射器的客户端。设备 D 和设备 E 位于群集之外,因此它们是路由反射器的非客户端。
在设备 A(路由反射器)上,您必须通过包含 neighbor 客户端(设备 B 和设备 C)和非客户端(设备 D 和设备 E)的语句,与所有启用 IBGP 的设备形成对等关系。还必须包括 cluster 语句和群集标识符。群集标识符可以是任何 32 位值。此示例使用路由反射器的环路接口 IP 地址。
在设备 B 和设备 C(路由反射器客户端)上,只需要一个 neighbor 与路由反射器(设备 A)形成对等关系的语句。
在设备 D 和设备 E 上,即非客户端,您需要为每个非客户端设备(D 到 E 和 E-to-D)提供语 neighbor 句。您还需要路由 neighbor 反射器(D-to-A 和 E-to-A)的语句。设备 D 和设备 E 不需要 neighbor 客户端设备(设备 B 和设备 C)的语句。
设备 D 和设备 E 被视为非客户端,因为它们彼此之间已显式配置对等关系。要使它们成为 RRroute 反射器客户端,请从设备 D 上的配置中移除该 neighbor 192.168.5.5 语句,然后从设备 E 上的配置中移除该 neighbor 192.168.0.1 语句。
IBGP 网络
配置
过程
CLI 快速配置
要快速配置此示例,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改详细信息,以便与网络配置匹配,然后将命令复制并粘贴到层次结构级别的 [edit] CLI 中。
此示例使用导出策略将 send-ospf OSPF 获知的路由重新分配到 BGP 中:
set protocols bgp group internal-peers export send-ospf
路由反射器操作通常不需要将 OSPF 重新分配给 BGP。此处仅用于创建路由反射器可以向其客户端通告的 BGP 路由,以便观察路由反射在简单的实验室拓扑中的行为方式。
在生产部署中,路由反射器通常会反映从客户端获知的 BGP 路由,除非特别需要此行为,否则不会将 IGP 路由重新分发到 BGP 中。
在此示例中,路由器 A、D 和 E 是非客户端 IBGP 对等方,配置在全网状中,以确保路由反射器客户端群集外部的路由交换一致。
设备 A
set interfaces fe-0/0/0 unit 1 description to-B set interfaces fe-0/0/0 unit 1 family inet address 10.10.10.1/30 set interfaces fe-0/0/1 unit 3 description to-D set interfaces fe-0/0/1 unit 3 family inet address 10.10.10.9/30 set interfaces lo0 unit 1 family inet address 192.168.6.5/32 set protocols bgp group internal-peers type internal set protocols bgp group internal-peers local-address 192.168.6.5 set protocols bgp group internal-peers export send-ospf set protocols bgp group internal-peers cluster 192.168.6.5 set protocols bgp group internal-peers neighbor 192.163.6.4 set protocols bgp group internal-peers neighbor 192.168.40.4 set protocols bgp group internal-peers neighbor 192.168.0.1 set protocols bgp group internal-peers neighbor 192.168.5.5 set protocols ospf area 0.0.0.0 interface lo0.1 passive set protocols ospf area 0.0.0.0 interface fe-0/0/0.1 set protocols ospf area 0.0.0.0 interface fe-0/0/1.3 set policy-options policy-statement send-ospf term 2 from protocol ospf set policy-options policy-statement send-ospf term 2 then accept set routing-options router-id 192.168.6.5 set routing-options autonomous-system 17
设备 B
set interfaces fe-0/0/0 unit 2 description to-A set interfaces fe-0/0/0 unit 2 family inet address 10.10.10.2/30 set interfaces fe-0/0/1 unit 5 description to-C set interfaces fe-0/0/1 unit 5 family inet address 10.10.10.5/30 set interfaces lo0 unit 2 family inet address 192.163.6.4/32 set protocols bgp group internal-peers type internal set protocols bgp group internal-peers local-address 192.163.6.4 set protocols bgp group internal-peers export send-ospf set protocols bgp group internal-peers neighbor 192.168.6.5 set protocols ospf area 0.0.0.0 interface lo0.2 passive set protocols ospf area 0.0.0.0 interface fe-0/0/0.2 set protocols ospf area 0.0.0.0 interface fe-0/0/1.5 set policy-options policy-statement send-ospf term 2 from protocol ospf set policy-options policy-statement send-ospf term 2 then accept set routing-options router-id 192.163.6.4 set routing-options autonomous-system 17
设备 C
set interfaces fe-0/0/0 unit 6 description to-B set interfaces fe-0/0/0 unit 6 family inet address 10.10.10.6/30 set interfaces lo0 unit 3 family inet address 192.168.40.4/32 set protocols bgp group internal-peers type internal set protocols bgp group internal-peers local-address 192.168.40.4 set protocols bgp group internal-peers export send-ospf set protocols bgp group internal-peers neighbor 192.168.6.5 set protocols ospf area 0.0.0.0 interface lo0.3 passive set protocols ospf area 0.0.0.0 interface fe-0/0/0.6 set policy-options policy-statement send-ospf term 2 from protocol ospf set policy-options policy-statement send-ospf term 2 then accept set routing-options router-id 192.168.40.4 set routing-options autonomous-system 17
设备 D
set interfaces fe-0/0/0 unit 4 description to-A set interfaces fe-0/0/0 unit 4 family inet address 10.10.10.10/30 set interfaces fe-0/0/1 unit 7 description to-E set interfaces fe-0/0/1 unit 7 family inet address 10.10.10.13/30 set interfaces lo0 unit 4 family inet address 192.168.0.1/32 set protocols bgp group internal-peers type internal set protocols bgp group internal-peers local-address 192.168.0.1 set protocols bgp group internal-peers export send-ospf set protocols bgp group internal-peers neighbor 192.168.6.5 set protocols bgp group internal-peers neighbor 192.168.5.5 set protocols ospf area 0.0.0.0 interface lo0.4 passive set protocols ospf area 0.0.0.0 interface fe-0/0/0.4 set protocols ospf area 0.0.0.0 interface fe-0/0/1.7 set policy-options policy-statement send-ospf term 2 from protocol ospf set policy-options policy-statement send-ospf term 2 then accept set routing-options router-id 192.168.0.1 set routing-options autonomous-system 17
设备 E
set interfaces fe-0/0/0 unit 8 description to-D set interfaces fe-0/0/0 unit 8 family inet address 10.10.10.14/30 set interfaces lo0 unit 5 family inet address 192.168.5.5/32 set protocols bgp group internal-peers type internal set protocols bgp group internal-peers local-address 192.168.5.5 set protocols bgp group internal-peers export send-ospf set protocols bgp group internal-peers neighbor 192.168.0.1 set protocols bgp group internal-peers neighbor 192.168.6.5 set protocols ospf area 0.0.0.0 interface lo0.5 passive set protocols ospf area 0.0.0.0 interface fe-0/0/0.8 set policy-options policy-statement send-ospf term 2 from protocol ospf set policy-options policy-statement send-ospf term 2 then accept set routing-options router-id 192.168.5.5 set routing-options autonomous-system 17
分步程序
配置路由反射器
分步程序
下面的示例要求您在各个配置层级中进行导航。有关导航CLI的信息,请参阅《Junos OS CLI 用户指南》中的在配置模式下使用CLI编辑器。
要在使用瞻博网络设备 A 作为路由反射器的网络中配置 IBGP:
-
配置接口。
[edit interfaces] user@A# set fe-0/0/0 unit 1 description to-B user@A# set fe-0/0/0 unit 1 family inet address 10.10.10.1/30 user@A# set fe-0/0/1 unit 3 description to-D user@A# set fe-0/0/1 unit 3 family inet address 10.10.10.9/30 user@A# set lo0 unit 1 family inet address 192.168.6.5/32
-
配置 BGP,包括群集标识符以及与自治系统 (AS) 中所有启用 IBGP 的设备的邻居关系。
还要应用将 OSPF 路由重新分配给 BGP 的策略。
[edit protocols bgp group internal-peers] user@A# set type internal user@A# set local-address 192.168.6.5 user@A# set export send-ospf user@A# set cluster 192.168.6.5 user@A# set neighbor192.163.6.4 user@A# set neighbor 192.168.40.4 user@A# set neighbor 192.168.0.1 user@A# set neighbor 192.168.5.5
-
配置静态路由或内部网关协议 (IGP)。
此示例使用 OSPF。
[edit protocols ospf area 0.0.0.0] user@A# set interface lo0.1 passive user@A# set interface fe-0/0/0.1 user@A# set interface fe-0/0/1.3
-
配置将 OSPF 路由重新分配给 BGP 的策略。
[edit policy-options policy-statement send-ospf term 2] user@A# set from protocol ospf user@A# set then accept
-
配置路由器 ID 和自治系统 (AS) 编号。
[edit routing-options] user@A# set router-id 192.168.6.5 user@A# set autonomous-system 17
结果
在配置模式下,输入 show interfaces、 show protocols、 show policy-options和 show routing-options 命令以确认您的配置。如果输出未显示预期的配置,请重复此示例中的说明以更正配置。
user@A# show interfaces
fe-0/0/0 {
unit 1 {
description to-B;
family inet {
address 10.10.10.1/30;
}
}
}
fe-0/0/1 {
unit 3 {
description to-D;
family inet {
address 10.10.10.9/30;
}
}
}
lo0 {
unit 1 {
family inet {
address 192.168.6.5/32;
}
}
}
user@A# show protocols
bgp {
group internal-peers {
type internal;
local-address 192.168.6.5;
export send-ospf;
cluster 192.168.6.5;
neighbor 192.163.6.4;
neighbor 192.168.40.4;
neighbor 192.168.0.1;
neighbor 192.168.5.5;
}
}
ospf {
area 0.0.0.0 {
interface lo0.1 {
passive;
}
interface fe-0/0/0.1;
interface fe-0/0/1.3;
}
}
user@A# show policy-options
policy-statement send-ospf {
term 2 {
from protocol ospf;
then accept;
}
}
user@A# show routing-options router-id 192.168.6.5; autonomous-system 17;
如果完成设备配置,请从配置模式进入。commit
如果其他非客户端设备来自瞻博网络,则对要配置的群集中的每个非客户端 BGP 对等体重复这些步骤。否则,请参阅设备的文档以获取说明。
配置客户端对等方
分步程序
下面的示例要求您在各个配置层级中进行导航。有关导航CLI的信息,请参阅《Junos OS CLI 用户指南》中的在配置模式下使用CLI编辑器。
要配置客户端对等方:
-
配置接口。
[edit interfaces] user@B# set fe-0/0/0 unit 2 description to-A user@B# set fe-0/0/0 unit 2 family inet address 10.10.10.2/30 user@B# set fe-0/0/1 unit 5 description to-C user@B# set fe-0/0/1 unit 5 family inet address 10.10.10.5/30 user@B# set lo0 unit 2 family inet address 192.163.6.4/32
-
配置与路由反射器的 BGP 邻接方关系。
还要应用将 OSPF 路由重新分配给 BGP 的策略。
[edit protocols bgp group internal-peers] user@B# set type internal user@B# set local-address 192.163.6.4 user@B# set export send-ospf user@B# set neighbor 192.168.6.5
-
配置 OSPF。
[edit protocols ospf area 0.0.0.0] user@B# set interface lo0.2 passive user@B# set interface fe-0/0/0.2 user@B# set interface fe-0/0/1.5
-
配置将 OSPF 路由重新分配给 BGP 的策略。
[edit policy-options policy-statement send-ospf term 2] user@B# set from protocol ospf user@B# set then accept
-
配置路由器 ID 和 AS 编号。
[edit routing-options] user@B# set router-id 192.163.6.4 user@B# set autonomous-system 17
结果
在配置模式下,输入 show interfaces、 show protocols、 show policy-options和 show routing-options 命令以确认您的配置。如果输出未显示预期的配置,请重复此示例中的说明以更正配置。
user@B# show interfaces
fe-0/0/0 {
unit 2 {
description to-A;
family inet {
address 10.10.10.2/30;
}
}
}
fe-0/0/1 {
unit 5 {
description to-C;
family inet {
address 10.10.10.5/30;
}
}
}
lo0 {
unit 2 {
family inet {
address 192.163.6.4/32;
}
}
}
user@B# show protocols
bgp {
group internal-peers {
type internal;
local-address 192.163.6.4;
export send-ospf;
neighbor 192.168.6.5;
}
}
ospf {
area 0.0.0.0 {
interface lo0.2 {
passive;
}
interface fe-0/0/0.2;
interface fe-0/0/1.5;
}
}
user@B# show policy-options
policy-statement send-ospf {
term 2 {
from protocol ospf;
then accept;
}
}
user@B# show routing-options router-id 192.163.6.4; autonomous-system 17;
如果完成设备配置,请从配置模式进入。commit
如果其他客户端设备来自瞻博网络,则对正在配置的群集中的每个客户端 BGP 对等体重复这些步骤。否则,请参阅设备的文档以获取说明。
配置非客户端对等方
分步程序
下面的示例要求您在各个配置层级中进行导航。有关导航CLI的信息,请参阅《Junos OS CLI 用户指南》中的在配置模式下使用CLI编辑器。
要配置非客户端对等方:
-
配置接口。
[edit interfaces] user@D# set fe-0/0/0 unit 4 description to-A user@D# set fe-0/0/0 unit 4 family inet address 10.10.10.10/30 user@D# set fe-0/0/1 unit 7 description to-E user@D# set fe-0/0/1 unit 7 family inet address 10.10.10.13/30 user@D# set lo0 unit 4 family inet address 192.168.0.1/32
-
配置与 RRroute 反射器以及与其他非客户端对等方的 BGP 邻接方关系。
还要应用将 OSPF 路由重新分配给 BGP 的策略。
[edit protocols bgp group internal-peers] user@D# set type internal user@D# set local-address 192.168.0.1 user@D# set export send-ospf user@D# set neighbor 192.168.6.5 user@D# set neighbor 192.168.5.5
-
配置 OSPF。
[edit protocols ospf area 0.0.0.0] user@D# set interface lo0.4 passive user@D# set interface fe-0/0/0.4 user@D# set interface fe-0/0/1.7
-
配置将 OSPF 路由重新分配给 BGP 的策略。
[edit policy-options policy-statement send-ospf term 2] user@D# set from protocol ospf user@D# set then accept
-
配置路由器 ID 和 AS 编号。
[edit routing-options] user@D# set router-id 192.168.0.1 user@D# set autonomous-system 17
结果
在配置模式下,输入 show interfaces、 show protocols、 show policy-options和 show routing-options 命令以确认您的配置。如果输出未显示预期的配置,请重复此示例中的说明以更正配置。
user@D# show interfaces
fe-0/0/0 {
unit 4 {
description to-A;
family inet {
address 10.10.10.10/30;
}
}
}
fe-0/0/1 {
unit 7 {
description to-E;
family inet {
address 10.10.10.13/30;
}
}
}
lo0 {
unit 4 {
family inet {
address 192.168.0.1/32;
}
}
}
user@D# show protocols
bgp {
group internal-peers {
type internal;
local-address 192.168.0.1;
export send-ospf;
neighbor 192.168.6.5;
neighbor 192.168.5.5;
}
}
ospf {
area 0.0.0.0 {
interface lo0.4 {
passive;
}
interface fe-0/0/0.4;
interface fe-0/0/1.7;
}
}
user@D# show policy-options
policy-statement send-ospf {
term 2 {
from protocol ospf;
then accept;
}
}
user@D# show routing-options router-id 192.168.0.1; autonomous-system 17;
如果完成设备配置,请从配置模式进入。commit
如果其他非客户端设备来自瞻博网络,则对正在配置的群集中的每个非客户端 BGP 对等体重复这些步骤。否则,请参阅设备的文档以获取说明。
验证
确认配置工作正常。
验证 BGP 邻接方
目的
验证 BGP 是否在配置的接口上运行,以及是否为每个邻接方地址建立了 BGP 会话。
行动
在操作模式下,输入命令 show bgp neighbor 。
user@A> show bgp neighbor
Peer: 192.163.6.4+179 AS 17 Local: 192.168.6.5+62857 AS 17
Type: Internal State: Established (route reflector client)Flags: <Sync>
Last State: OpenConfirm Last Event: RecvKeepAlive
Last Error: None
Export: [ send-ospf ]
Options: <Preference LocalAddress Cluster Refresh>
Local Address: 192.168.6.5 Holdtime: 90 Preference: 170
Number of flaps: 0
Peer ID: 192.163.6.4 Local ID: 192.168.6.5 Active Holdtime: 90
Keepalive Interval: 30 Peer index: 0
BFD: disabled, down
NLRI for restart configured on peer: inet-unicast
NLRI advertised by peer: inet-unicast
NLRI for this session: inet-unicast
Peer supports Refresh capability (2)
Restart time configured on the peer: 120
Stale routes from peer are kept for: 300
Restart time requested by this peer: 120
NLRI that peer supports restart for: inet-unicast
NLRI that restart is negotiated for: inet-unicast
NLRI of received end-of-rib markers: inet-unicast
NLRI of all end-of-rib markers sent: inet-unicast
Peer supports 4 byte AS extension (peer-as 17)
Peer does not support Addpath
Table inet.0 Bit: 10000
RIB State: BGP restart is complete
Send state: in sync
Active prefixes: 0
Received prefixes: 6
Accepted prefixes: 1
Suppressed due to damping: 0
Advertised prefixes: 6
Last traffic (seconds): Received 5 Sent 3 Checked 19
Input messages: Total 2961 Updates 7 Refreshes 0 Octets 56480
Output messages: Total 2945 Updates 6 Refreshes 0 Octets 56235
Output Queue[0]: 0
Peer: 192.168.0.1+179 AS 17 Local: 192.168.6.5+60068 AS 17
Type: Internal State: Established (route reflector client)Flags: <Sync>
Last State: OpenConfirm Last Event: RecvKeepAlive
Last Error: None
Export: [ send-ospf ]
Options: <Preference LocalAddress Cluster Refresh>
Local Address: 192.168.6.5 Holdtime: 90 Preference: 170
Number of flaps: 0
Peer ID: 192.168.0.1 Local ID: 192.168.6.5 Active Holdtime: 90
Keepalive Interval: 30 Peer index: 3
BFD: disabled, down
NLRI for restart configured on peer: inet-unicast
NLRI advertised by peer: inet-unicast
NLRI for this session: inet-unicast
Peer supports Refresh capability (2)
Restart time configured on the peer: 120
Stale routes from peer are kept for: 300
Restart time requested by this peer: 120
NLRI that peer supports restart for: inet-unicast
NLRI that restart is negotiated for: inet-unicast
NLRI of received end-of-rib markers: inet-unicast
NLRI of all end-of-rib markers sent: inet-unicast
Peer supports 4 byte AS extension (peer-as 17)
Peer does not support Addpath
Table inet.0 Bit: 10000
RIB State: BGP restart is complete
Send state: in sync
Active prefixes: 0
Received prefixes: 6
Accepted prefixes: 1
Suppressed due to damping: 0
Advertised prefixes: 6
Last traffic (seconds): Received 18 Sent 20 Checked 12
Input messages: Total 15 Updates 5 Refreshes 0 Octets 447
Output messages: Total 554 Updates 4 Refreshes 0 Octets 32307
Output Queue[0]: 0
Peer: 192.168.5.5+57458 AS 17 Local: 192.168.6.5+179 AS 17
Type: Internal State: Established (route reflector client)Flags: <Sync>
Last State: OpenConfirm Last Event: RecvKeepAlive
Last Error: None
Export: [ send-ospf ]
Options: <Preference LocalAddress Cluster Refresh>
Local Address: 192.168.6.5 Holdtime: 90 Preference: 170
Number of flaps: 0
Peer ID: 192.168.5.5 Local ID: 192.168.6.5 Active Holdtime: 90
Keepalive Interval: 30 Peer index: 2
BFD: disabled, down
NLRI for restart configured on peer: inet-unicast
NLRI advertised by peer: inet-unicast
NLRI for this session: inet-unicast
Peer supports Refresh capability (2)
Restart time configured on the peer: 120
Stale routes from peer are kept for: 300
Restart time requested by this peer: 120
NLRI that peer supports restart for: inet-unicast
NLRI that restart is negotiated for: inet-unicast
NLRI of received end-of-rib markers: inet-unicast
NLRI of all end-of-rib markers sent: inet-unicast
Peer supports 4 byte AS extension (peer-as 17)
Peer does not support Addpath
Table inet.0 Bit: 10000
RIB State: BGP restart is complete
Send state: in sync
Active prefixes: 0
Received prefixes: 7
Accepted prefixes: 7
Suppressed due to damping: 0
Advertised prefixes: 6
Last traffic (seconds): Received 17 Sent 3 Checked 9
Input messages: Total 2967 Updates 7 Refreshes 0 Octets 56629
Output messages: Total 2943 Updates 6 Refreshes 0 Octets 56197
Output Queue[0]: 0
Peer: 192.168.40.4+53990 AS 17 Local: 192.168.6.5+179 AS 17
Type: Internal State: Established (route reflector client)Flags: <Sync>
Last State: OpenConfirm Last Event: RecvKeepAlive
Last Error: None
Export: [ send-ospf ]
Options: <Preference LocalAddress Cluster Refresh>
Local Address: 192.168.6.5 Holdtime: 90 Preference: 170
Number of flaps: 0
Peer ID: 192.168.40.4 Local ID: 192.168.6.5 Active Holdtime: 90
Keepalive Interval: 30 Peer index: 1
BFD: disabled, down
NLRI for restart configured on peer: inet-unicast
NLRI advertised by peer: inet-unicast
NLRI for this session: inet-unicast
Peer supports Refresh capability (2)
Restart time configured on the peer: 120
Stale routes from peer are kept for: 300
Restart time requested by this peer: 120
NLRI that peer supports restart for: inet-unicast
NLRI that restart is negotiated for: inet-unicast
NLRI of received end-of-rib markers: inet-unicast
NLRI of all end-of-rib markers sent: inet-unicast
Peer supports 4 byte AS extension (peer-as 17)
Peer does not support Addpath
Table inet.0 Bit: 10000
RIB State: BGP restart is complete
Send state: in sync
Active prefixes: 0
Received prefixes: 7
Accepted prefixes: 7
Suppressed due to damping: 0
Advertised prefixes: 6
Last traffic (seconds): Received 5 Sent 23 Checked 52
Input messages: Total 2960 Updates 7 Refreshes 0 Octets 56496
Output messages: Total 2943 Updates 6 Refreshes 0 Octets 56197
Output Queue[0]: 0
验证 BGP 组
目的
验证 BGP 组配置是否正确。
行动
在操作模式下,输入命令 show bgp group 。
user@A> show bgp group Group Type: Internal AS: 17 Local AS: 17 Name: internal-peers Index: 0 Flags: <> Export: [ send-ospf ] Options: <Cluster> Holdtime: 0 Total peers: 4 Established: 4 192.163.6.4+179 192.168.40.4+53990 192.168.0.1+179 192.168.5.5+57458 inet.0: 0/26/16/0 Groups: 1 Peers: 4 External: 0 Internal: 4 Down peers: 0 Flaps: 0 Table Tot Paths Act Paths Suppressed History Damp State Pending inet.0 26 0 0 0 0 0
验证 BGP 汇总信息
目的
验证 BGP 配置是否正确。
行动
在操作模式下,输入命令 show bgp summary 。
user@A> show bgp summary Groups: 1 Peers: 4 Down peers: 0 Table Tot Paths Act Paths Suppressed History Damp State Pending inet.0 26 0 0 0 0 0 Peer AS InPkt OutPkt OutQ Flaps Last Up/Dwn State|#Active/Received/Accepted/Damped... 192.163.6.4 17 2981 2965 0 0 22:19:15 0/6/1/0 0/0/0/0 192.168.0.1 17 36 575 0 0 13:43 0/6/1/0 0/0/0/0 192.168.5.5 17 2988 2964 0 0 22:19:10 0/7/7/0 0/0/0/0 192.168.40.4 17 2980 2964 0 0 22:19:14 0/7/7/0 0/0/0/0
验证路由表信息
目的
验证路由表是否包含 IBGP 路由。
行动
在操作模式下,输入命令 show route 。
user@A> show route
inet.0: 12 destinations, 38 routes (12 active, 0 holddown, 10 hidden)
+ = Active Route, - = Last Active, * = Both
10.10.10.0/30 *[Direct/0] 22:22:03
> via fe-0/0/0.1
[BGP/170] 22:20:55, MED 2, localpref 100, from 192.168.40.4
AS path: I
> to 10.10.10.2 via fe-0/0/0.1
[BGP/170] 22:20:51, MED 3, localpref 100, from 192.168.5.5
AS path: I
> to 10.10.10.10 via fe-0/0/1.3
10.10.10.1/32 *[Local/0] 22:22:03
Local via fe-0/0/0.1
10.10.10.4/30 *[OSPF/10] 22:21:13, metric 2
> to 10.10.10.2 via fe-0/0/0.1
[BGP/170] 22:20:51, MED 4, localpref 100, from 192.168.5.5
AS path: I
> to 10.10.10.10 via fe-0/0/1.3
10.10.10.8/30 *[Direct/0] 22:22:03
> via fe-0/0/1.3
[BGP/170] 22:20:51, MED 2, localpref 100, from 192.168.5.5
AS path: I
> to 10.10.10.10 via fe-0/0/1.3
[BGP/170] 22:20:55, MED 3, localpref 100, from 192.168.40.4
AS path: I
> to 10.10.10.2 via fe-0/0/0.1
10.10.10.9/32 *[Local/0] 22:22:03
Local via fe-0/0/1.3
10.10.10.12/30 *[OSPF/10] 22:21:08, metric 2
> to 10.10.10.10 via fe-0/0/1.3
[BGP/170] 22:20:55, MED 4, localpref 100, from 192.168.40.4
AS path: I
> to 10.10.10.2 via fe-0/0/0.1
192.163.6.4/32 *[OSPF/10] 22:21:13, metric 1
> to 10.10.10.2 via fe-0/0/0.1
[BGP/170] 22:20:55, MED 1, localpref 100, from 192.168.40.4
AS path: I
> to 10.10.10.2 via fe-0/0/0.1
[BGP/170] 22:20:51, MED 3, localpref 100, from 192.168.5.5
AS path: I
> to 10.10.10.10 via fe-0/0/1.3
192.168.0.1/32 *[OSPF/10] 22:21:08, metric 1
> to 10.10.10.10 via fe-0/0/1.3
[BGP/170] 22:20:51, MED 1, localpref 100, from 192.168.5.5
AS path: I
> to 10.10.10.10 via fe-0/0/1.3
[BGP/170] 22:20:55, MED 3, localpref 100, from 192.168.40.4
AS path: I
> to 10.10.10.2 via fe-0/0/0.1
192.168.5.5/32 *[OSPF/10] 22:21:08, metric 2
> to 10.10.10.10 via fe-0/0/1.3
[BGP/170] 00:15:24, MED 1, localpref 100, from 192.168.0.1
AS path: I
> to 10.10.10.10 via fe-0/0/1.3
[BGP/170] 22:20:55, MED 4, localpref 100, from 192.168.40.4
AS path: I
> to 10.10.10.2 via fe-0/0/0.1
192.168.6.5/32 *[Direct/0] 22:22:04
> via lo0.1
[BGP/170] 22:20:51, MED 2, localpref 100, from 192.168.5.5
AS path: I
> to 10.10.10.10 via fe-0/0/1.3
[BGP/170] 22:20:55, MED 2, localpref 100, from 192.168.40.4
AS path: I
> to 10.10.10.2 via fe-0/0/0.1
192.168.40.4/32 *[OSPF/10] 22:21:13, metric 2
> to 10.10.10.2 via fe-0/0/0.1
[BGP/170] 22:20:55, MED 1, localpref 100, from 192.163.6.4
AS path: I
> to 10.10.10.2 via fe-0/0/0.1
[BGP/170] 22:20:51, MED 4, localpref 100, from 192.168.5.5
AS path: I
> to 10.10.10.10 via fe-0/0/1.3
224.0.0.5/32 *[OSPF/10] 22:22:07, metric 1
MultiRecv
了解属于两个不同群集的路由反射器
路由反射的目的是在内部 BGP (IBGP) 路由设备未完全网状化时防止环路。为了实现这一点,RR 打破了正常 BGP 操作的规则之一:它们将从内部 BGP 对等体获知的路由重新播发到其他内部 BGP 对等方。
通常,单个 RR 仅是一个群集的成员。例如,假设在分层 RR 设计中,第 2 层 RR 可以是第 1 层 RR 的客户端,但它们不能是彼此的客户端。
但是,当两个 RR 彼此是彼此的客户端,并且路由从一个群集反射到另一个群集时,群集列表中仅包含一个群集 ID。这是因为在这种情况下,在群集列表中有一个群集 ID 足以满足循环预防。
表 1 总结了路由反射器在使用群集 ID 填充反射路由的群集列表时使用的规则。
路由反射方案 |
配置 |
|---|---|
将从其中一个客户端的路由反射到非客户端路由器时 客户端 -> RR -> 非客户端 |
RR 在反射路由的群集列表中填充与该客户端关联的群集 ID。 |
将从非客户端路由器的路由反射到客户端路由器时 非客户端 -> RR ->客户端 |
RR 在反射路由的群集列表中填充与该客户端关联的群集 ID。 |
将从客户端路由器的路由反射到不同群集中的另一个客户端路由器时 client1 -> RR -> client2(不同群集) |
RR 在将 群集 ID 反映给 client2 之前,先填写群集列表中与 client1 关联的群集 ID。未添加与客户端 2 关联的群集 ID。 |
将路由从客户端路由器反射到位于不同自治系统中的非客户端路由器时。 例如,如果配置了第 2 层 RR 和 2 个 BGP 组(一个用于 RR 客户端,另一个用于第 1 层 RR),并且要反映从一个自治系统到另一个自治系统的路由。 客户端 -> RR -> 非客户端(不同AS) |
在将路由反映到非客户端设备之前,RR 不会使用群集 ID 填充群集列表,因为群集 ID 特定于一个自治系统。 |
也可以看看
示例:配置属于两个不同集群的路由反射器
此示例说明如何配置属于两个不同群集的路由反射器 (RR)。这不是一个常见的情况,但在某些情况下可能很有用。
要求
配置设备接口和内部网关协议 (IGP)。有关包含接口和 IGP 配置的 RR 设置示例,请参阅 示例:配置路由反射器。
概述
在此示例中,设备 RR1 是设备 R3 和设备 RR2 的路由反射器。路由反射器 RR1 分配了两个不同的群集 ID,一个是 RR1-R3 的 10.13.1.3,RR1-RR2 的 10.12.1.2。
设备 RR2 是设备 R4 的路由反射器。
考虑图 5。
的路由反射器
此示例显示了设备 RR1 和设备 RR2 上的 BGP 配置。
配置
先决条件
在多个群集中配置 BGP 路由反射器之前,请确保所有 BGP 对等方之间存在 IP 可达性。在此示例中,内部网关协议 (IGP)(例如 OSPF 或 IS-IS)提供用于 IBGP 会话的环路接口之间的可达性。假定接口和 IGP 配置已就位,此处未显示。
过程
CLI 快速配置
要快速配置此示例,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改详细信息,以便与网络配置匹配,然后将命令复制并粘贴到层次结构级别的 [edit] CLI 中。
设备 RR1
set protocols bgp group RR1_client type internal set protocols bgp group RR1_client local-address 192.168.20.1 set protocols bgp group RR1_client cluster 10.13.1.3 set protocols bgp group RR1_client neighbor 192.168.48.1 set protocols bgp group Non_client type internal set protocols bgp group Non_client local-address 192.168.20.1 set protocols bgp group Non_client neighbor 192.168.16.1 set protocols bgp group RR1_to_RR2 type internal set protocols bgp group RR1_to_RR2 local-address 192.168.20.1 set protocols bgp group RR1_to_RR2 cluster 10.12.1.2 set protocols bgp group RR1_to_RR2 neighbor 192.168.40.1
设备 RR2
set protocols bgp group RR2_client type internal set protocols bgp group RR2_client local-address 192.168.40.1 set protocols bgp group RR2_client cluster 10.24.2.4 set protocols bgp group RR2_client neighbor 192.168.32.1 set protocols bgp group RR2_to_RR1 type internal set protocols bgp group RR2_to_RR1 local-address 192.168.40.1 set protocols bgp group RR2_to_RR1 neighbor 192.168.20.1
配置设备 RR1
分步程序
下面的示例要求您在各个配置层级中进行导航。有关导航CLI的信息,请参阅《Junos OS CLI 用户指南》中的在配置模式下使用CLI编辑器。
要配置设备 RR1:
-
配置与设备 R3 的对等关系。
[edit protocols bgp group RR1_client] user@RR1# set type internal user@RR1# set local-address 192.168.20.1 user@RR1# set cluster 10.13.1.3 user@RR1# set neighbor 192.168.48.1
-
配置与设备 R0 的对等关系。
[edit protocols bgp group Non_client] user@RR1# set type internal user@RR1# set local-address 192.168.20.1 user@RR1# set neighbor 192.168.16.1
-
配置与设备 RR2 的对等关系。
[edit protocols bgp group RR1_to_RR2] user@RR1# set type internal user@RR1# set local-address 192.168.20.1 user@RR1# set cluster 10.12.1.2 user@RR1# set neighbor 192.168.40.1
结果
在配置模式下,输入 show protocols 命令以确认您的配置。如果输出未显示预期的配置,请重复此示例中的说明以更正配置。
user@RR1# show protocols
bgp {
group RR1_client {
type internal;
local-address 192.168.20.1;
cluster 10.13.1.3;
neighbor 192.168.48.1;
}
group Non_client {
type internal;
local-address 192.168.20.1;
neighbor 192.168.16.1;
}
group RR1_to_RR2 {
type internal;
local-address 192.168.20.1;
cluster 10.12.1.2;
neighbor 192.168.40.1;
}
}
如果完成设备配置,请从配置模式进入。commit
配置设备 RR2
分步程序
下面的示例要求您在各个配置层级中进行导航。有关导航CLI的信息,请参阅《Junos OS CLI 用户指南》中的在配置模式下使用CLI编辑器。
要配置设备 RR2:
-
配置与设备 R4 的对等关系。
[edit protocols bgp group RR2_client] user@RR2# set type internal user@RR2# set local-address 192.168.40.1 user@RR2# set cluster 10.24.2.4 user@RR2# set neighbor 192.168.32.1
-
配置与设备 RR1 的对等关系。
[edit protocols bgp group RR2_to_RR1] user@RR2# set type internal user@RR2# set local-address 192.168.40.1 user@RR2# set neighbor 192.168.20.1
结果
在配置模式下,输入 show protocols 命令以确认您的配置。如果输出未显示预期的配置,请重复此示例中的说明以更正配置。
user@RR2# show protocols
bgp {
group RR2_client {
type internal;
local-address 192.168.40.1;
cluster 10.24.2.4;
neighbor 192.168.32.1;
}
group RR2_to_RR1 {
type internal;
local-address 192.168.40.1;
neighbor 192.168.20.1;
}
}
如果完成设备配置,请从配置模式进入。commit
验证
确认配置工作正常。
检查为路由 10.3.3.3 播发的群集 ID
目的
验证 BGP 是否在配置的接口上运行,以及是否为每个邻接方地址建立了 BGP 会话。
行动
在操作模式下,输入命令 show route advertising-protocol bgp neighbor-address 。
user@RR1> show route advertising-protocol bgp 192.168.40.1 active-path 10.3.3.3 extensive
inet.0: 61 destinations, 61 routes (60 active, 0 holddown, 1 hidden)
* 10.3.3.3/32 (1 entry, 1 announced)
BGP group RR1_to_RR2 type Internal
Nexthop: 192.168.48.1
Localpref: 100
AS path: [100] I
Cluster ID: 10.13.1.3
Originator ID: 192.168.48.1
意义
10.3.3.3/32 路由源自设备 RR1 的客户端对等方设备 R3。当此路由发送到 RR1 的客户端设备 RR2 时,路由附加了 10.13.1.3 群集 ID,即 RR1-R3 的群集 ID。
检查为路由 10.1.0.1 播发的群集 ID
目的
检查从设备 RR1 到设备 RR2 的路由播发。
行动
在操作模式下,输入命令 show route advertising-protocol bgp neighbor-address 。
user@RR1> show route advertising-protocol bgp 192.168.40.1 active-path 10.1.0.1/32 extensive
inet.0: 61 destinations, 61 routes (60 active, 0 holddown, 1 hidden)
* 10.1.0.1/32 (1 entry, 1 announced)
BGP group RR1_to_RR2 type Internal
Nexthop: 192.168.16.1
Localpref: 100
AS path: [100] I
Cluster ID: 10.12.1.2
Originator ID: 192.168.16.1
意义
10.1.0.1/32 路由源自设备 RR1 的非客户端对等方设备 R0。将此路由发送至 RR1 的客户端设备 RR2 时,路由附加了 10.12.1.2 群集 ID,即 RR1-RR2 的群集 ID。
当向不同群集中的另一个客户端(设备 R4)播发时,设备 RR1 会保留设备 RR2 的入站群集 ID。
AS 边界路由器上的路由反射
在大多数部署中,BGP 路由反射器专门作为内部 BGP (IBGP) 路由器运行。但是,在某些网络设计中,路由反射器也可以充当自治系统边界路由器 (ASBR) 并维护外部 BGP (EBGP) 对等会话。
当 Junos OS 路由器同时执行这两个角色并从 EBGP 对等方接收路由时,如果路由器使用该 cluster 选项将路由播发至配置为路由反射器客户端的 IBGP 对等方,则需要特别注意事项。在这种情况下,Junos OS 在将路由反映到 IBGP 客户端时附加ORIGINATOR_ID和CLUSTER_LIST路径属性。
RFC 4456 定义了 BGP 路由反射,但对于通过 EBGP 获知并随后通过双角色 ASBR 和路由反射器反射到 IBGP 客户端的路由,其预期行为并未明确指定。在此场景中,Junos OS 会一致地应用路由反射属性,以防止路由环路,并在自治系统中保留确定性路径选择。
在 AS 边界路由器上部署路由反射时,请仔细考虑路由策略、路径选择和故障场景,以确保反射路由不会引入意外路由行为。
变更历史表
是否支持某项功能取决于您使用的平台和版本。使用 功能资源管理器 确定您的平台是否支持某个功能。
no-install 语句消除了路由协议守护程序 (rpd) 与 Junos 系统中其他组件(如内核或分布式防火墙守护程序 (DFWD))之间的交互。