cRPD 中的多拓扑路由
cRPD 中的多拓扑
cRPD 支持 BGP 多 RIB 功能,以支持基于具有 Linux FIB(转发平面中的路由)的路由策略的多拓扑路由 (MTR)。应用程序可以根据 cRPD 中 Linux FIB 中的路由策略为不同类型的流量选择所需的路由表。每种类型的流量都由一个拓扑定义,该拓扑用于为该拓扑创建新的路由表。每个拓扑都使用统一的控制平面来为与该拓扑关联的流量做出路由决策。此外,每个拓扑都有一个单独的转发表,实际上,每个拓扑都有一个专用的转发平面。
服务提供商和企业可以使用多拓扑路由 (MTR) 来设计网络中的流量。MTR 可用于直接和静态路由、IS-IS、OSPF 和 BGP。在承载多种流量类型的网络中,您通常需要根据应用流量的链路特性,将不同类型的应用流量引导到多个链路上。将路由导出为多拓扑时,使用社区进行 BGP。OSPFv3 不支持 MTR。MTR 可发现 IGP 路由,并能够根据使用静态和 OSPF 的自定义拓扑解析 BGP 路由。
您可以根据需要配置单独的拓扑来共享相同的网络链路。MTR 结合使用控制平面(路由)和转发平面过滤器。
MTR 提供了根据您创建的拓扑的路由表中的已解析条目生成转发表的能力。MTR 和转发仅在主路由实例上可用。将创建专用 RIB 来存储多拓扑路由。拓扑上未启用 BGP 多路径。
当路由拓扑配置在 下 routing-options时,将为每个拓扑创建一个新的路由表。每个路由协议都会根据拓扑名称、实例名称和表的用途创建一个路由表。
示例:在 cRPD 中使用 BGP 配置多拓扑路由
此示例说明如何在 cRPD 中使用 BGP 配置基于社区的多拓扑,以及如何使用网络路径上的多拓扑路由 (MTR) 对流量进行单播。
要求
此示例需要以下软件版本:
-
cRPD 19.4R1 或更高版本。
概述
BGP 支持的多拓扑路由基于 BGP 路由中的社区值。此配置确定拓扑与一个或多个社区值之间的关联,并填充拓扑路由表。具有匹配社区值的到达 BGP 更新将复制到关联的拓扑路由表中。
使用 BGP inet 系列配置拓扑,并验证将 BGP 导入匹配路由到拓扑 RIB(也称为路由表)中。对于每个拓扑,必须提供社区对象列表,以便路由软件可以设置内部 ribgroup 和相应的辅助表导入策略。
配置
要为 BGP 配置多拓扑路由,请执行以下作:
CLI 快速配置
set routing-options topologies family inet topology red table-id 40
set routing-options topologies family inet topology blue table-id 41
set routing-options topologies family inet topology green table-id 42
set routing-options router-id 10.2.2.2
set routing-options autonomous-system 65500
set routing-options rib :red.inet.0 static route 10.1.1.1/32 next-hop 10.15.0.2
set routing-options rib :green.inet.0 static route 10.1.1.1/32 next-hop 10.13.0.2
set routing-options rib :blue.inet.0 static route 10.1.1.1/32 next-hop 10.17.0.2
set protocols bgp group ibgp-app-rr-ser type internal
set protocols bgp group ibgp-app-rr-ser traceoptions file bgp size 100m
set protocols bgp group ibgp-app-rr-ser traceoptions flag update
set protocols bgp group ibgp-app-rr-ser traceoptions flag state
set protocols bgp group ibgp-app-rr-ser local-address 10.77.1.1
set protocols bgp group ibgp-app-rr-ser family inet unicast add-path send path-count 6
set protocols bgp family inet unicast topology red community 1:1
set protocols bgp family inet unicast topology green community 1:2
set protocols bgp family inet unicast topology blue community 1:3
通过多拓扑路由配置 BGP
分步过程
-
配置多个拓扑结构。
[edit routing-options topologies] user@crpd# set family inet topology red table-id 40 user@crpd# set family inet topology blue table-id 41 user@crpd# set family inet topology green table-id 42 -
配置静态路由。
[edit routing-options] user@crpd# set router-id 10.2.2.2 user@crpd# set autonomous-system 65500 user@crpd# set rib :red.inet.0 static route 10.1.1.1/32 next-hop 10.15.0.2 user@crpd# set rib :green.inet.0 static route 10.1.1.1/32 next-hop 10.13.0.2 user@crpd# set rib :blue.inet.0 static route 10.1.1.1/32 next-hop 10.17.0.2 -
配置 BGP 组参数,将匹配的路由导入到拓扑路由表中。BGP 使用目标社区标识符将它学习的路由安装在相应的路由表中。
[edit protocols bgp] user@crpd# set group ibgp-app-rr-ser type internal user@crpd# set group ibgp-app-rr-ser traceoptions file bgp size 100m user@crpd# set group ibgp-app-rr-ser traceoptions flag update user@crpd# set group ibgp-app-rr-ser traceoptions flag state user@crpd# set group ibgp-app-rr-ser local-address 10.77.1.1 user@crpd# set group ibgp-app-rr-ser family inet unicast add-path send path-count 6 user@crpd# set family inet unicast topology red community 1:1 user@crpd# set family inet unicast topology green community 1:2 user@crpd# set family inet unicast topology blue community 1:3
结果
在配置模式下,输入 show protocols bgp 和 show routing-options 命令,以确认您的配置。如果输出未显示预期的配置,请重复此示例中的说明以更正配置。
show routing-options
topologies {
family inet {
topology red {
table-id 40;
}
topology blue {
table-id 41;
}
topology green {
table-id 42;
}
}
}
rib :red.inet.0 {
static {
route 10.1.1.1/32 next-hop 10.15.0.2;
}
}
rib :green.inet.0 {
static {
route 10.1.1.1/32 next-hop 10.13.0.2;
}
}
rib :blue.inet.0 {
static {
route 10.1.1.1/32 next-hop 10.17.0.2;
}
}
user@crpd# show protocols bgp
family inet {
unicast {
topology red {
community 1:1;
}
topology green {
community 1:2;
}
topology blue {
community 1:3;
}
}
group ibgp-app-rr-ser {
type internal;
traceoptions {
file bgp size 100m;
flag update;
}
local-address 10.77.1.1;
family inet {
unicast {
add-path {
send {
path-count 6;
}
}
}
}
}
}
如果完成设备配置,请在配置模式下输入 commit 命令。
验证
验证 BGP 路由
目的
要验证 BGP 匹配的路由,请执行以下作:
行动
在作模式下,输入 show route protocol bgp all table 命令:
user@crpd> show route protocol bgp all table
:red.inet.0: 11 destinations, 11 routes (8 active, 0 holddown, 3 hidden)
+ = Active Route, - = Last Active, * = Both
10.99.9.1/32 [BGP/170] 00:05:07, localpref 100, from 10.49.114.118
AS path: I, validation-state: unverified
> to 10.15.0.2 via ens4f1
10.99.9.2/32 [BGP/170] 00:05:07, localpref 100, from 10.49.114.118
AS path: I, validation-state: unverified
> to 10.15.0.2 via ens4f1
10.99.9.5/32 [BGP/170] 00:05:07, localpref 100, from 10.49.114.118
AS path: I, validation-state: unverified
> to 10.15.0.2 via ens4f1
:green.inet.0: 10 destinations, 10 routes (8 active, 0 holddown, 2 hidden)
+ = Active Route, - = Last Active, * = Both
10.9.9.1/32 [BGP/170] 00:05:07, localpref 100, from 10.49.114.118
AS path: I, validation-state: unverified
> to 10.13.0.2 via ens4f1
10.9.9.4/32 [BGP/170] 00:05:07, localpref 100, from 10.49.114.118
AS path: I, validation-state: unverified
> to 10.13.0.2 via ens4f1
:blue.inet.0: 11 destinations, 11 routes (8 active, 0 holddown, 3 hidden)
+ = Active Route, - = Last Active, * = Both
10.99.9.3/32 [BGP/170] 00:05:07, localpref 100, from 10.49.114.118
AS path: I, validation-state: unverified
> to 10.17.0.2 via ens4f1
10.99.9.4/32 [BGP/170] 00:05:07, localpref 100, from 10.49.114.118
AS path: I, validation-state: unverified
> to 10.17.0.2 via ens4f1
10.99.9.5/32 [BGP/170] 00:05:07, localpref 100, from 10.49.114.118
AS path: I, validation-state: unverified
> to 10.17.0.2 via ens4f1
在作模式下,输入 show route protocol bgp all table inet.0 命令:
user@crpd> show route protocol bgp all table inet.0
inet.0: 20 destinations, 20 routes (20 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
10.99.9.1/32 *[BGP/170] 00:00:14, localpref 100, from 10.49.114.118
AS path: I, validation-state: unverified
> to 1.15.0.2 via ens4f1
10.99.9.2/32 *[BGP/170] 00:00:14, localpref 100, from 10.49.114.118
AS path: I, validation-state: unverified
> to 1.15.0.2 via ens4f1
10.99.9.3/32 *[BGP/170] 00:00:14, localpref 100, from 10.49.114.118
AS path: I, validation-state: unverified
> to 1.15.0.2 via ens4f1
10.99.9.4/32 *[BGP/170] 00:00:14, localpref 100, from 10.49.114.118
AS path: I, validation-state: unverified
> to 1.15.0.2 via ens4f1
10.99.9.5/32 *[BGP/170] 00:00:14, localpref 100, from 10.49.114.118
AS path: I, validation-state: unverified
> to 1.15.0.2 via ens4f1
意义
您可以查看安装到路由表的 BGP 匹配路由,以及没有社区目标的路由仅在路由表中 inet.0 可用时。
