示例:配置 BGP 的累积 IGP 属性
此示例演示如何为 BGP 配置累积 IGP (AIGP)指标属性。
要求
此示例使用以下硬件和软件组件:
七个 BGP 网络设备。
12.1 或更高版本 Junos OS。
概述
AIGP 属性支持这样的部署,其中单个管理可运行多个连续 BGP 自治系统(As)。此类部署允许 BGP 根据 IGP 指标做出路由决策。启用 AIGP 后,BGP 可以根据 IGP 指标选择路径。这使 BGP 可以选择两个节点之间的最短路径,即使节点可能在不同的 As 中也是如此。AIGP 属性在使用隧道将数据包传送至其 BGP 下一跳跃的网络中特别有用。此示例显示 AIGP 配置了标签交换路径 MPLS。
要启用 AIGP,请在协议aigp系列的基础上包括 BGP 配置中的语句。在特定系列上配置 AIGP 可在该系列上发送和接收 AIGP 属性。默认情况下,AIGP 处于禁用状态。AIGP 禁用的相邻节点不会发送 AIGP 属性,并以静默方式丢弃收到的 AIGP 属性。
Junos OS 支持和family inet labeled-unicast的family inet6 labeled-unicast AIGP。可aigp在全局 BGP、组或邻居级别为给定系列配置该语句。
默认情况下,本地前缀的 AIGP 属性值为零。支持 AIGP 的相邻节点可通过导出策略为给定前缀产生 AIGP 属性,方法是使用aigp-originate策略操作。AIGP 属性的值反映了前缀 IGP 距离。或者,您也可以通过使用aigp-originate distance distance策略操作来指定值。可配置的范围为0到4294967295。只有一个节点需要发起一个 AIGP 属性。如果使用 BGP 配置中的aigp语句 AIGP 启用邻居,则 AIGP 属性将保留并 readvertised。
发起 AIGP 属性的策略操作具有以下要求:
相邻节点必须启用 AIGP。
策略必须作为导出策略应用。
前缀必须没有当前 AIGP 属性。
前缀必须使用下一跳自我导出。
前缀必须位于 AIGP 域内。通常,回传 IP 地址是发起的前缀。
如果不满足这些要求,则该策略将被忽略。
拓扑图
图 1显示了此示例中使用的拓扑。OSPF 用作内部网关协议(IGP)。在设备 PE1 和设备 PE4 之间配置内部 BGP (IBGP)。外部 BGP (EBGP)在设备 PE7 和设备 PE1 之间、设备 PE4 与设备 PE3 之间以及设备 PE4 与设备 PE2 之间配置。设备 PE4、PE2 和 PE3 配置为多跳。设备 PE4 基于 AIGP 值选择路径,然后根据 AIGP 和策略配置 readvertises AIGP 值。Device PE1 readvertises 设备 PE7 (位于另一个管理域中)的 AIGP 值。每个设备都有两个回传接口地址:10.9.9 用于 BGP 对等互连和路由器 ID,而 BGP 10.100.1 用于下一跳跃。
设备 PE1 与 PE3 之间的网络具有 IBGP 对等互连和多个 OSPF 区域。设备 PE7 的外部链路配置为显示 AIGP 属性 readvertised 到管理域外的相邻节点,前提是该邻接方已被 AIGP 启用。

对于 AIGP 属性的发放,BGP 下一个跳跃必须为自身。如果 BGP 下一跳跃保持不变,则收到的 AIGP 属性 readvertised 为另一个 AIGP 邻居。如果下一跳跃发生变化,收到的 AIGP 属性将 readvertised,并将值增加到另一个 AIGP 邻居。值的增加反映了上一次 BGP 下一跳跃的 IGP 距离。为了证明,此示例使用与设备 PE2 和设备 PE3’的设备 PE4 s EBGP 对等会话的回传接口地址。在这些会话上启用多跳,以便执行递归查找以确定点对点接口。由于下一跳跃发生变化,IGP 距离将添加到 AIGP 距离。
配置
CLI 快速配置
要快速配置此示例,请复制以下命令,将其粘贴到文本文件中,删除任何换行符,更改与网络配置匹配的必要详细信息,然后将命令复制并粘贴到[edit]层次结构级别的 CLI 中。
设备 P1
设备 P2
设备 PE4
设备 PE1
设备 PE2
设备 PE3
设备 PE7
配置设备 P1
分步过程
下面的示例要求您在配置层次结构中导航各个级别。有关导航 CLI 的信息,请参阅中的CLI 用户指南在配置模式中使用 CLI 编辑器。
要配置设备 P1:
配置接口。
[edit interfaces]user@P1# set fe-1/2/0 unit 1 description P1-to-PE1user@P1# set fe-1/2/0 unit 1 family inet address 10.0.0.2/30user@P1# set fe-1/2/0 unit 1 family mplsuser@P1# set fe-1/2/1 unit 4 description P1-to-P2user@P1# set fe-1/2/1 unit 4 family inet address 10.0.0.29/30user@P1# set fe-1/2/1 unit 4 family mplsuser@P1# set fe-1/2/2 unit 8 description P1-to-PE4user@P1# set fe-1/2/2 unit 8 family inet address 10.0.0.17/30user@P1# set fe-1/2/2 unit 8 family mplsuser@P1# set lo0 unit 3 family inet address 10.9.9.2/32user@P1# set lo0 unit 3 family inet address 10.100.1.2/32配置 MPLS 和信号协议,例如 RSVP 或 LDP。
[edit protocols]user@P1# set rsvp interface fe-1/2/0.1user@P1# set rsvp interface fe-1/2/2.8user@P1# set rsvp interface fe-1/2/1.4user@P1# set mpls label-switched-path P1-to-P2 to 10.9.9.3user@P1# set mpls label-switched-path P1-to-PE1 to 10.9.9.1user@P1# set mpls label-switched-path P1-to-PE4 to 10.9.9.4user@P1# set mpls interface fe-1/2/0.1user@P1# set mpls interface fe-1/2/2.8user@P1# set mpls interface fe-1/2/1.4配置 BGP。
[edit protocols bgp group internal]user@P1# set type internaluser@P1# set local-address 10.9.9.2user@P1# set neighbor 10.9.9.1user@P1# set neighbor 10.9.9.3user@P1# set neighbor 10.9.9.4启用 AIGP。
[edit protocols bgp group internal]user@P1# set family inet labeled-unicast aigp配置 IGP,例如 OSPF、RIP 或 IS-IS。
[edit protocols ospf]user@P1# set area 0.0.0.1 interface fe-1/2/0.1 metric 1user@P1# set area 0.0.0.1 interface fe-1/2/1.4 metric 1user@P1# set area 0.0.0.0 interface fe-1/2/2.8 metric 1user@P1# set area 0.0.0.0 interface 10.9.9.2 passiveuser@P1# set area 0.0.0.0 interface 10.9.9.2 metric 1user@P1# set area 0.0.0.0 interface 10.100.1.2 passiveuser@P1# set area 0.0.0.0 interface 10.100.1.2 metric 1配置路由器 ID 和自治系统编号。
[edit routing-options]user@P1# set router-id 10.9.9.2user@P1# set autonomous-system 13979如果您完成了设备配置,请提交配置。
user@P1# commit
结果
从配置模式,输入show interfaces、 show protocols和show routing-options命令以确认您的配置。如果输出未显示预期的配置,请重复此示例中的说明以更正配置。
配置设备 P2
分步过程
下面的示例要求您在配置层次结构中导航各个级别。有关导航 CLI 的信息,请参阅中的CLI 用户指南在配置模式中使用 CLI 编辑器。
要配置设备 P2:
配置接口。
[edit interfaces]user@P2# set fe-1/2/0 unit 3 description P2-to-PE1user@P2# set fe-1/2/0 unit 3 family inet address 10.0.0.6/30user@P2# set fe-1/2/0 unit 3 family mplsuser@P2# set fe-1/2/1 unit 5 description P2-to-P1user@P2# set fe-1/2/1 unit 5 family inet address 10.0.0.30/30user@P2# set fe-1/2/1 unit 5 family mplsuser@P2# set fe-1/2/2 unit 6 description P2-to-PE4user@P2# set fe-1/2/2 unit 6 family inet address 10.0.0.13/30user@P2# set fe-1/2/2 unit 6 family mplsuser@P2# set lo0 unit 5 family inet address 10.9.9.3/32user@P2# set lo0 unit 5 family inet address 10.100.1.3/32配置 MPLS 和信号协议,例如 RSVP 或 LDP。
[edit protocols]user@P2# set rsvp interface fe-1/2/1.5user@P2# set rsvp interface fe-1/2/2.6user@P2# set rsvp interface fe-1/2/0.3user@P2# set mpls label-switched-path P2-to-PE1 to 10.9.9.1user@P2# set mpls label-switched-path P2-to-P1 to 10.9.9.2user@P2# set mpls label-switched-path P2-to-PE4 to 10.9.9.4user@P2# set mpls interface fe-1/2/1.5user@P2# set mpls interface fe-1/2/2.6user@P2# set mpls interface fe-1/2/0.3配置 BGP。
[edit protocols bgp group internal]user@P2# set type internaluser@P2# set local-address 10.9.9.3user@P2# set neighbor 10.9.9.1user@P2# set neighbor 10.9.9.2user@P2# set neighbor 10.9.9.4启用 AIGP。
[edit protocols bgp group internal]user@P2# set family inet labeled-unicast aigp配置 IGP,例如 OSPF、RIP 或 IS-IS。
[edit protocols ospf]user@P2# set area 0.0.0.0 interface fe-1/2/2.6 metric 1user@P2# set area 0.0.0.0 interface 10.9.9.3 passiveuser@P2# set area 0.0.0.0 interface 10.9.9.3 metric 1user@P2# set area 0.0.0.0 interface 10.100.1.3 passiveuser@P2# set area 0.0.0.0 interface 10.100.1.3 metric 1配置路由器 ID 和自治系统编号。
[edit routing-options]user@P2# set router-id 10.9.9.3user@P2# set autonomous-system 13979如果您完成了设备配置,请提交配置。
user@P2# commit
结果
从配置模式,输入show interfaces、 show protocols和show routing-options命令以确认您的配置。如果输出未显示预期的配置,请重复此示例中的说明以更正配置。
配置设备 PE4
分步过程
下面的示例要求您在配置层次结构中导航各个级别。有关导航 CLI 的信息,请参阅中的CLI 用户指南在配置模式中使用 CLI 编辑器。
要配置设备 PE4:
配置接口。
[edit interfaces]user@PE4# set fe-1/2/0 unit 7 description PE4-to-P2user@PE4# set fe-1/2/0 unit 7 family inet address 10.0.0.14/30user@PE4# set fe-1/2/0 unit 7 family mplsuser@PE4# set fe-1/2/1 unit 9 description PE4-to-P1user@PE4# set fe-1/2/1 unit 9 family inet address 10.0.0.18/30user@PE4# set fe-1/2/1 unit 9 family mplsuser@PE4# set fe-1/2/2 unit 10 description PE4-to-PE2user@PE4# set fe-1/2/2 unit 10 family inet address 10.0.0.21/30user@PE4# set fe-1/2/2 unit 10 family mplsuser@PE4# set fe-1/0/2 unit 12 description PE4-to-PE3user@PE4# set fe-1/0/2 unit 12 family inet address 10.0.0.25/30user@PE4# set fe-1/0/2 unit 12 family mplsuser@PE4# set lo0 unit 7 family inet address 10.9.9.4/32user@PE4# set lo0 unit 7 family inet address 10.100.1.4/32配置 MPLS 和信号协议,例如 RSVP 或 LDP。
[edit protocols]user@PE4# set rsvp interface fe-1/2/0.7user@PE4# set rsvp interface fe-1/2/1.9user@PE4# set rsvp interface fe-1/2/2.10user@PE4# set rsvp interface fe-1/0/2.12user@PE4# set mpls label-switched-path PE4-to-PE2 to 10.9.9.5user@PE4# set mpls label-switched-path PE4-to-PE3 to 10.9.9.6user@PE4# set mpls label-switched-path PE4-to-P1 to 10.9.9.2user@PE4# set mpls label-switched-path PE4-to-P2 to 10.9.9.3user@PE4# set mpls interface fe-1/2/0.7user@PE4# set mpls interface fe-1/2/1.9user@PE4# set mpls interface fe-1/2/2.10user@PE4# set mpls interface fe-1/0/2.12配置 BGP。
[edit protocols bgp]user@PE4# set export next-hopuser@PE4# set export aigpuser@PE4# set group internal type internaluser@PE4# set group internal local-address 10.9.9.4user@PE4# set group internal neighbor 10.9.9.1user@PE4# set group internal neighbor 10.9.9.3user@PE4# set group internal neighbor 10.9.9.2user@PE4# set group external type externaluser@PE4# set group external multihop ttl 2user@PE4# set group external local-address 10.9.9.4user@PE4# set group external peer-as 7018user@PE4# set group external neighbor 10.9.9.5user@PE4# set group external neighbor 10.9.9.6启用 AIGP。
[edit protocols bgp]user@PE4# set group external family inet labeled-unicast aigpuser@PE4# set group internal family inet labeled-unicast aigp产生一个前缀,并配置一个 AIGP 距离。
默认情况下,前缀是使用当前 IGP 距离发起的。或者,您可以使用distance选项配置 AIGP 属性的距离,如下所示。
[edit policy-options policy-statement aigp term 10]user@PE4# set from protocol staticuser@PE4# set from route-filter 44.0.0.0/24 exactuser@PE4# set then aigp-originate distance 200user@PE4# set then next-hop 10.100.1.4user@PE4# set then accept启用策略。
[edit policy-options policy-statement next-hop]user@PE4# set term 10 from protocol bgpuser@PE4# set term 10 then next-hop 10.100.1.4user@PE4# set term 10 then acceptuser@PE4# set term 20 from protocol directuser@PE4# set term 20 from route-filter 10.9.9.4/32 exactuser@PE4# set term 20 from route-filter 10.100.1.4/32 exactuser@PE4# set term 20 then next-hop 10.100.1.4user@PE4# set term 20 then accept配置静态路由。
[edit routing-options]user@PE4# set static route 44.0.0.0/24 discard配置 IGP,例如 OSPF、RIP 或 IS-IS。
[edit protocols ospf]user@PE4# set area 0.0.0.0 interface fe-1/2/1.9 metric 1user@PE4# set area 0.0.0.0 interface fe-1/2/0.7 metric 1user@PE4# set area 0.0.0.0 interface 10.9.9.4 passiveuser@PE4# set area 0.0.0.0 interface 10.9.9.4 metric 1user@PE4# set area 0.0.0.0 interface 10.100.1.4 passiveuser@PE4# set area 0.0.0.0 interface 10.100.1.4 metric 1user@PE4# set area 0.0.0.2 interface fe-1/2/2.10 metric 1user@PE4# set area 0.0.0.3 interface fe-1/0/2.12 metric 1配置路由器 ID 和自治系统编号。
[edit routing-options]user@PE4# set router-id 10.9.9.4user@PE4# set autonomous-system 13979如果您完成了设备配置,请提交配置。
user@PE4# commit
结果
从配置模式, show interfaces输入、 show policy-optionsshow protocols、和show routing-options命令以确认您的配置。如果输出未显示预期的配置,请重复此示例中的说明以更正配置。
配置设备 PE1
分步过程
下面的示例要求您在配置层次结构中导航各个级别。有关导航 CLI 的信息,请参阅中的CLI 用户指南在配置模式中使用 CLI 编辑器。
要配置设备 PE1:
配置接口。
[edit interfaces]user@PE1# set fe-1/2/0 unit 0 description PE1-to-P1user@PE1# set fe-1/2/0 unit 0 family inet address 10.0.0.1/30user@PE1# set fe-1/2/0 unit 0 family mplsuser@PE1# set fe-1/2/1 unit 2 description PE1-to-P2user@PE1# set fe-1/2/1 unit 2 family inet address 10.0.0.5/30user@PE1# set fe-1/2/1 unit 2 family mplsuser@PE1# set fe-1/2/2 unit 14 description PE1-to-PE7user@PE1# set fe-1/2/2 unit 14 family inet address 10.0.0.9/30user@PE1# set lo0 unit 1 family inet address 10.9.9.1/32user@PE1# set lo0 unit 1 family inet address 10.100.1.1/32配置 MPLS 和信号协议,例如 RSVP 或 LDP。
[edit protocols]user@PE1# set rsvp interface fe-1/2/0.0user@PE1# set rsvp interface fe-1/2/1.2user@PE1# set rsvp interface fe-1/2/2.14user@PE1# set mpls label-switched-path PE1-to-P1 to 10.9.9.2user@PE1# set mpls label-switched-path PE1-to-P2 to 10.9.9.3user@PE1# set mpls interface fe-1/2/0.0user@PE1# set mpls interface fe-1/2/1.2user@PE1# set mpls interface fe-1/2/2.14配置 BGP。
[edit protocols bgp]user@PE1# set group internal type internaluser@PE1# set group internal local-address 10.9.9.1user@PE1# set group internal export SET_EXPORT_ROUTESuser@PE1# set group internal vpn-apply-exportuser@PE1# set group internal neighbor 10.9.9.4user@PE1# set group internal neighbor 10.9.9.2user@PE1# set group internal neighbor 10.9.9.3user@PE1# set group external type externaluser@PE1# set group external export SET_EXPORT_ROUTESuser@PE1# set group external peer-as 7019user@PE1# set group external neighbor 10.0.0.10启用 AIGP。
[edit protocols bgp]user@PE1# set group internal family inet labeled-unicast aigpuser@PE1# set group external family inet labeled-unicast aigp启用策略。
[edit policy-options policy-statement SET_EXPORT_ROUTES term 10]user@PE1# set from protocol directuser@PE1# set from protocol bgpuser@PE1# set then next-hop 10.100.1.1user@PE1# set then accept配置 IGP,例如 OSPF、RIP 或 IS-IS。
[edit protocols ospf area 0.0.0.1]user@PE1# set interface fe-1/2/0.0 metric 1user@PE1# set interface fe-1/2/1.2 metric 1user@PE1# set interface 10.9.9.1 passiveuser@PE1# set interface 10.9.9.1 metric 1user@PE1# set interface 10.100.1.1 passiveuser@PE1# set interface 10.100.1.1 metric 1配置路由器 ID 和自治系统编号。
[edit routing-options]user@PE1# set router-id 10.9.9.1user@PE1# set autonomous-system 13979如果您完成了设备配置,请提交配置。
user@PE1# commit
结果
从配置模式, show interfaces输入、 show policy-optionsshow protocols、和show routing-options命令以确认您的配置。如果输出未显示预期的配置,请重复此示例中的说明以更正配置。
配置设备 PE2
分步过程
下面的示例要求您在配置层次结构中导航各个级别。有关导航 CLI 的信息,请参阅中的CLI 用户指南在配置模式中使用 CLI 编辑器。
要配置设备 PE2:
配置接口。
[edit interfaces]user@PE2# set fe-1/2/0 unit 11 description PE2-to-PE4user@PE2# set fe-1/2/0 unit 11 family inet address 10.0.0.22/30user@PE2# set fe-1/2/0 unit 11 family mplsuser@PE2# set lo0 unit 9 family inet address 10.9.9.5/32 primaryuser@PE2# set lo0 unit 9 family inet address 10.100.1.5/32配置 MPLS 和信号协议,例如 RSVP 或 LDP。
[edit protocols]user@PE2# set rsvp interface fe-1/2/0.11user@PE2# set mpls label-switched-path PE2-to-PE4 to 10.9.9.4user@PE2# set mpls interface fe-1/2/0.11配置 BGP。
[edit protocols bgp]user@PE2# set group external type externaluser@PE2# set group external multihop ttl 2user@PE2# set group external local-address 10.9.9.5user@PE2# set group external export next-hopuser@PE2# set group external export aigpuser@PE2# set group external export SET_EXPORT_ROUTESuser@PE2# set group external vpn-apply-exportuser@PE2# set group external peer-as 13979user@PE2# set group external neighbor 10.9.9.4启用 AIGP。
[edit protocols bgp]user@PE2# set group external family inet labeled-unicast aigp产生一个前缀,并配置一个 AIGP 距离。
默认情况下,前缀是使用当前 IGP 距离发起的。或者,您可以使用distance选项配置 AIGP 属性的距离,如下所示。
[edit policy-options policy-statement aigp]user@PE2# set term 10 from route-filter 55.0.0.0/24 exactuser@PE2# set term 10 then aigp-originate distance 20user@PE2# set term 10 then next-hop 10.100.1.5user@PE2# set term 10 then acceptuser@PE2# set term 20 from route-filter 99.0.0.0/24 exactuser@PE2# set term 20 then aigp-originate distance 30user@PE2# set term 20 then next-hop 10.100.1.5user@PE2# set term 20 then accept启用策略。
[edit policy-options]user@PE2# set policy-statement SET_EXPORT_ROUTES term 10 from protocol directuser@PE2# set policy-statement SET_EXPORT_ROUTES term 10 from protocol staticuser@PE2# set policy-statement SET_EXPORT_ROUTES term 10 from protocol bgpuser@PE2# set policy-statement SET_EXPORT_ROUTES term 10 then next-hop 10.100.1.5user@PE2# set policy-statement SET_EXPORT_ROUTES term 10 then acceptuser@PE2# set policy-statement next-hop term 10 from protocol bgpuser@PE2# set policy-statement next-hop term 10 then next-hop 10.100.1.5user@PE2# set policy-statement next-hop term 10 then acceptuser@PE2# set policy-statement next-hop term 20 from protocol directuser@PE2# set policy-statement next-hop term 20 from route-filter 10.9.9.5/32 exactuser@PE2# set policy-statement next-hop term 20 from route-filter 10.100.1.5/32 exactuser@PE2# set policy-statement next-hop term 20 then next-hop 10.100.1.5user@PE2# set policy-statement next-hop term 20 then accept启用某些静态路由。
[edit routing-options]user@PE2# set static route 99.0.0.0/24 discarduser@PE2# set static route 55.0.0.0/24 discard配置 IGP,例如 OSPF、RIP 或 IS-IS。
[edit protocols ospf area 0.0.0.2]user@PE2# set interface 10.9.9.5 passiveuser@PE2# set interface 10.9.9.5 metric 1user@PE2# set interface 10.100.1.5 passiveuser@PE2# set interface 10.100.1.5 metric 1user@PE2# set interface fe-1/2/0.11 metric 1配置路由器 ID 和自治系统编号。
[edit routing-options]user@PE2# set router-id 10.9.9.5user@PE2# set autonomous-system 7018如果您完成了设备配置,请提交配置。
user@PE2# commit
结果
从配置模式, show interfaces输入、 show policy-optionsshow protocols、和show routing-options命令以确认您的配置。如果输出未显示预期的配置,请重复此示例中的说明以更正配置。
配置设备 PE3
分步过程
下面的示例要求您在配置层次结构中导航各个级别。有关导航 CLI 的信息,请参阅中的CLI 用户指南在配置模式中使用 CLI 编辑器。
要配置设备 PE3:
配置接口。
[edit interfaces]user@PE3# set fe-1/2/0 unit 13 description PE3-to-PE4user@PE3# set fe-1/2/0 unit 13 family inet address 10.0.0.26/30user@PE3# set fe-1/2/0 unit 13 family mplsuser@PE3# set lo0 unit 11 family inet address 10.9.9.6/32user@PE3# set lo0 unit 11 family inet address 10.100.1.6/32配置 MPLS 和信号协议,例如 RSVP 或 LDP。
[edit protocols]user@PE3# set rsvp interface fe-1/2/0.13user@PE3# set mpls label-switched-path PE3-to-PE4 to 10.9.9.4user@PE3# set mpls interface fe-1/2/0.13配置 BGP。
[edit protocols bgp group external]user@PE3# set type externaluser@PE3# set multihop ttl 2user@PE3# set local-address 10.9.9.6user@PE3# set export next-hopuser@PE3# set export SET_EXPORT_ROUTESuser@PE3# set vpn-apply-exportuser@PE3# set peer-as 13979user@PE3# set neighbor 10.9.9.4启用 AIGP。
[edit protocols bgp group external]user@PE3# set family inet labeled-unicast aigp启用策略。
[edit policy-options]user@PE3# set policy-statement SET_EXPORT_ROUTES term 10 from protocol directuser@PE3# set policy-statement SET_EXPORT_ROUTES term 10 from protocol staticuser@PE3# set policy-statement SET_EXPORT_ROUTES term 10 from protocol bgpuser@PE3# set policy-statement SET_EXPORT_ROUTES term 10 then next-hop 10.100.1.6user@PE3# set policy-statement SET_EXPORT_ROUTES term 10 then acceptuser@PE3# set policy-statement next-hop term 10 from protocol bgpuser@PE3# set policy-statement next-hop term 10 then next-hop 10.100.1.6user@PE3# set policy-statement next-hop term 10 then acceptuser@PE3# set policy-statement next-hop term 20 from protocol directuser@PE3# set policy-statement next-hop term 20 from route-filter 10.9.9.6/32 exactuser@PE3# set policy-statement next-hop term 20 from route-filter 10.100.1.6/32 exactuser@PE3# set policy-statement next-hop term 20 then next-hop 10.100.1.6user@PE3# set policy-statement next-hop term 20 then accept配置 IGP,例如 OSPF、RIP 或 IS-IS。
[edit protocols ospf area 0.0.0.3]user@PE3# set interface 10.9.9.6 passiveuser@PE3# set interface 10.9.9.6 metric 1user@PE3# set interface 10.100.1.6 passiveuser@PE3# set interface 10.100.1.6 metric 1user@PE3# set interface fe-1/2/0.13 metric 1配置路由器 ID 和自治系统编号。
[edit routing-options]user@PE3# set router-id 10.9.9.6user@PE3# set autonomous-system 7018如果您完成了设备配置,请提交配置。
user@PE3# commit
结果
从配置模式, show interfaces输入、 show policy-optionsshow protocols、和show routing-options命令以确认您的配置。如果输出未显示预期的配置,请重复此示例中的说明以更正配置。
配置设备 PE7
分步过程
下面的示例要求您在配置层次结构中导航各个级别。有关导航 CLI 的信息,请参阅中的CLI 用户指南在配置模式中使用 CLI 编辑器。
要配置设备 PE7:
配置接口。
[edit interfaces]user@PE7# set fe-1/2/0 unit 15 description PE7-to-PE1user@PE7# set fe-1/2/0 unit 15 family inet address 10.0.0.10/30user@PE7# set lo0 unit 13 family inet address 10.9.9.7/32user@PE7# set lo0 unit 13 family inet address 10.100.1.7/32配置 BGP。
[edit protocols bgp group external]user@PE7# set type externaluser@PE7# set export SET_EXPORT_ROUTESuser@PE7# set peer-as 13979user@PE7# set neighbor 10.0.0.9启用 AIGP。
[edit protocols bgp group external]user@PE7# set family inet labeled-unicast aigp- 配置路由策略。[edit policy-options policy-statement SET_EXPORT_ROUTES term 10]user@PE7# set from protocol directuser@PE7# set from protocol bgpuser@PE7# set then next-hop 10.100.1.7user@PE7# set then accept
配置路由器 ID 和自治系统编号。
[edit routing-options]user@PE7# set router-id 10.9.9.7user@PE7# set autonomous-system 7019如果您完成了设备配置,请提交配置。
user@PE7# commit
结果
从配置模式, show interfaces输入、 show policy-optionsshow protocols、和show routing-options命令以确认您的配置。如果输出未显示预期的配置,请重复此示例中的说明以更正配置。
针对
确认配置是否正常工作。
验证设备 PE4 是否从其 EBGP 邻居接收 AIGP 属性 PE2
用途
请确保设备 PE2 上的 AIGP 策略正常工作。
操作
user@PE4> show route receive-protocol bgp 10.9.9.5
extensive
* 55.0.0.0/24 (1 entry, 1 announced) Accepted Route Label: 299888 Nexthop: 10.100.1.5 AS path: 7018 I AIGP: 20 * 99.0.0.0/24 (1 entry, 1 announced) Accepted Route Label: 299888 Nexthop: 10.100.1.5 AS path: 7018 I AIGP: 30
含义
在设备 PE2 上, aigp-originate语句的距离配置为20(aigp-originate distance 20)。此语句适用于路由 55.0.0.0/24。同样,该aigp-originate distance 30语句也适用于路由 99.0.0.0/24。因此,当设备 PE4 接收这些路由时,AIGP 属性将与配置的指标相关联。
检查 IGP 指标
用途
从设备 PE4 中检查 BGP 下一跳跃10.100.1.5 的 IGP 指标。
操作
user@PE4> show route 10.100.1.5
inet.0: 30 destinations, 40 routes (30 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 10.100.1.5/32 *[OSPF/10] 05:35:50, metric 2 > to 10.0.0.22 via fe-1/2/2.10 [BGP/170] 03:45:07, localpref 100, from 10.9.9.5 AS path: 7018 I > to 10.0.0.22 via fe-1/2/2.10
含义
此路由的 IGP 指标为2。
验证设备 PE4 是否将 IGP 指标添加到 AIGP 属性
用途
确保在 readvertises 路由到 IBGP 邻居时,设备 PE1 将 IGP 指标添加到 AIGP 属性。
操作
user@PE4> show route advertising-protocol bgp
10.9.9.1 extensive
* 55.0.0.0/24 (1 entry, 1 announced) BGP group internal type Internal Route Label: 300544 Nexthop: 10.100.1.4 Flags: Nexthop Change Localpref: 100 AS path: [13979] 7018 I AIGP: 22 * 99.0.0.0/24 (1 entry, 1 announced) BGP group internal type Internal Route Label: 300544 Nexthop: 10.100.1.4 Flags: Nexthop Change Localpref: 100 AS path: [13979] 7018 I AIGP: 32
含义
将 IGP 指标添加到 AIGP 指标(20 + 2 = 22 和 30 + 2 = 32),因为下一跳跃会更改为这些路由。
验证设备 PE7 是否从其 EBGP 邻居接收 AIGP 属性 PE1
用途
请确保设备 PE1 上的 AIGP 策略正常工作。
操作
user@PE7> show route receive-protocol bgp 10.0.0.9
extensive
* 44.0.0.0/24 (1 entry, 1 announced) Accepted Route Label: 300096 Nexthop: 10.0.0.9 AS path: 13979 I AIGP: 203 * 55.0.0.0/24 (1 entry, 1 announced) Accepted Route Label: 300112 Nexthop: 10.0.0.9 AS path: 13979 7018 I AIGP: 25 * 99.0.0.0/24 (1 entry, 1 announced) Accepted Route Label: 300112 Nexthop: 10.0.0.9 AS path: 13979 7018 I AIGP: 35
含义
44.0.0.0/24 路由源于设备 PE4。55.0.0.0/24 和 99.0.0.0/24 路由源于设备 PE2。IGP 距离将添加到配置的 AIGP 距离。
验证解析 AIGP 指标
用途
确认如果前缀是通过递归解析的,并且递归下一跃点具有 AIGP 指标,则该前缀具有递归 BGP 下一跃点上的 AIGP 值之和。
操作
将静态路由添加至 66.0.0.0/24。
[edit routing-options]user@PE2# set static route 66.0.0.0/24 discard删除设备 PE2 上的aigp策略语句中的现有术语。
[edit policy-options policy-statement aigp]user@PE2# delete term 10user@PE2# delete term 20将路由的递归路由查找配置为66.0.0.0。
该策略显示前缀 66.0.0.0/24 (none)及其递归下一跳跃的 AIGP 指标。前缀 66.0.0.0/24 由55.0.0.1 解析。前缀 66.0.0.0/24 未在生成自己的 AIGP 度量,但其递归下一跳跃55.0.0.1 具有一个 AIGP 值。
[edit policy-options policy-statement aigp]user@PE2# set term 10 from route-filter 55.0.0.1/24 exactuser@PE2# set term 10 then aigp-originate distance 20user@PE2# set term 10 then next-hop 10.100.1.5user@PE2# set term 10 then acceptuser@PE2# set term 20 from route-filter 66.0.0.0/24 exactuser@PE2# set term 20 then next-hop 55.0.0.1user@PE2# set term 20 then accept在设备 PE4 上运行show route 55.0.0.0 extensive 命令。
Metric2 的值是 BGP 下一跳跃的 IGP 指标。当设备 PE4 readvertises 这些路由到其 IBGP 对等方、设备 PE1 时,AIGP 指标是 AIGP + 解析 AIGP 指标 + Metric2 的总和。
前缀55.0.0.0 显示其自己的 IGP 指标20,由设备 PE2 定义和公布。它不显示解析 AIGP 值,因为它没有递归 BGP 下一跳跃。Metric2 的价值为2。
user@PE4> show route 55.0.0.0 extensive
inet.0: 31 destinations, 41 routes (31 active, 0 holddown, 0 hidden) 55.0.0.0/24 (1 entry, 1 announced) TSI: KRT in-kernel 55.0.0.0/24 -> {indirect(262151)} Page 0 idx 0 Type 1 val 928d1b8 Flags: Nexthop Change Nexthop: 10.100.1.4 Localpref: 100 AS path: [13979] 7018 I Communities: AIGP: 22 Path 55.0.0.0 from 10.9.9.5 Vector len 4. Val: 0 *BGP Preference: 170/-101 Next hop type: Indirect Address: 0x925da38 Next-hop reference count: 4 Source: 10.9.9.5 Next hop type: Router, Next hop index: 1004 Next hop: 10.0.0.22 via fe-1/2/2.10, selected Label operation: Push 299888 Label TTL action: prop-ttl Protocol next hop: 10.100.1.5 Push 299888 Indirect next hop: 93514d8 262151 State: <Active Ext> Local AS: 13979 Peer AS: 7018 Age: 22:03:26 Metric2: 2 AIGP: 20 Task: BGP_7018.10.9.9.5+58560 Announcement bits (3): 3-KRT 4-BGP_RT_Background 5-Resolve tree 1 AS path: 7018 I Accepted Route Label: 299888 Localpref: 100 Router ID: 10.9.9.5 Indirect next hops: 1 Protocol next hop: 10.100.1.5 Metric: 2 Push 299888 Indirect next hop: 93514d8 262151 Indirect path forwarding next hops: 1 Next hop type: Router Next hop: 10.0.0.22 via fe-1/2/2.10 10.100.1.5/32 Originating RIB: inet.0 Metric: 2 Node path count: 1 Forwarding nexthops: 1 Nexthop: 10.0.0.22 via fe-1/2/2.10
在设备 PE4 上运行show route 66.0.0.0 extensive 命令。
Prefix 66.0.0.0/24 显示解析 AIGP,它是自己的 AIGP 指标及其递归 BGP 下一个跳跃的总和:
66.0.0.1 = 0, 55.0.0.1 = 20, 0+20 = 20
user@PE4> show route 66.0.0.0 extensive
inet.0: 31 destinations, 41 routes (31 active, 0 holddown, 0 hidden) 66.0.0.0/24 (1 entry, 1 announced) TSI: KRT in-kernel 66.0.0.0/24 -> {indirect(262162)} Page 0 idx 0 Type 1 val 928cefc Flags: Nexthop Change Nexthop: 10.100.1.4 Localpref: 100 AS path: [13979] 7018 I Communities: Path 66.0.0.0 from 10.9.9.5 Vector len 4. Val: 0 *BGP Preference: 170/-101 Next hop type: Indirect Address: 0x925d4e0 Next-hop reference count: 4 Source: 10.9.9.5 Next hop type: Router, Next hop index: 1006 Next hop: 10.0.0.22 via fe-1/2/2.10, selected Label operation: Push 299888, Push 299888(top) Label TTL action: prop-ttl, prop-ttl(top) Protocol next hop: 55.0.0.1 Push 299888 Indirect next hop: 9353e88 262162 State: <Active Ext> Local AS: 13979 Peer AS: 7018 Age: 31:42 Metric2: 2 Resolving-AIGP: 20 Task: BGP_7018.10.9.9.5+58560 Announcement bits (3): 3-KRT 4-BGP_RT_Background 5-Resolve tree 1 AS path: 7018 I Accepted Route Label: 299888 Localpref: 100 Router ID: 10.9.9.5 Indirect next hops: 1 Protocol next hop: 55.0.0.1 Metric: 2 AIGP: 20 Push 299888 Indirect next hop: 9353e88 262162 Indirect path forwarding next hops: 1 Next hop type: Router Next hop: 10.0.0.22 via fe-1/2/2.10 55.0.0.0/24 Originating RIB: inet.0 Metric: 2 Node path count: 1 Indirect nexthops: 1 Protocol Nexthop: 10.100.1.5 Metric: 2 Push 299888 Indirect nexthop: 93514d8 262151 Indirect path forwarding nexthops: 1 Nexthop: 10.0.0.22 via fe-1/2/2.10 10.100.1.5/32 Originating RIB: inet.0 Metric: 2 Node path count: 1 Forwarding nexthops: 1 Nexthop: 10.0.0.22 via fe-1/2/2.10
验证 BGP 更新中是否存在 AIGP 属性
用途
如果 BGP (或groupneighbor层次结构)下未启用 AIGP 属性,AIGP 属性将以静默方式丢弃。通过 traceoptions并包括 packets标志在 detail选项,以确认在 BGP 更新中传输或接收的 AIGP 属性是否存在。这在调试 AIGP 问题时很有用。
操作
为 PE2 配置设备和设备 PE4 traceoptions.
user@host> show protocols bgptraceoptions {file bgp size 1m files 5;flag packets detail;}检查 traceoptions设备 PE2 上的文件。
以下示例显示了设备 PE2 广告前缀 99.0.0.0/24 到设备 PE4 (10.9.9.4),AIGP 指标为20:
user@PE2> show log bgp
Mar 22 09:27:18.982150 BGP SEND 10.9.9.5+49652 -> 10.9.9.4+179 Mar 22 09:27:18.982178 BGP SEND message type 2 (Update) length 70 Mar 22 09:27:18.982198 BGP SEND Update PDU length 70 Mar 22 09:27:18.982248 BGP SEND flags 0x40 code Origin(1): IGP Mar 22 09:27:18.982273 BGP SEND flags 0x40 code ASPath(2) length 6: 7018 Mar 22 09:27:18.982295 BGP SEND flags 0x80 code AIGP(26): AIGP: 20 Mar 22 09:27:18.982316 BGP SEND flags 0x90 code MP_reach(14): AFI/SAFI 1/4 Mar 22 09:27:18.982341 BGP SEND nhop 10.100.1.5 len 4 Mar 22 09:27:18.982372 BGP SEND 99.0.0.0/24 (label 301664) Mar 22 09:27:33.665412 bgp_send: sending 19 bytes to abcd::10:255:170:84 (External AS 13979)
验证是否在设备 PE4 上收到路由,方法是使用 show route receive-protocol命令时,此文件将变成活动配置。
设备 PE4 上未启用 AIGP,因此对于前缀 99.0.0.0/24,不会以静默方式丢弃 AIGP 属性,并且不会出现在以下输出中:
user@PE4> show route receive-protocol bgp 10.9.9.5 extensive | find 55.0.0.0
* 99.0.0.0/24 (2 entries, 1 announced) Accepted Route Label: 301728 Nexthop: 10.100.1.5 AS path: 7018 I
检查 traceoptions设备 PE4 上的文件。
以下输出来自 traceoptions该日志显示附加 AIGP 属性时收到 99.0.0.0/24 前缀:
user@PE4> show log bgp
Mar 22 09:41:39.650295 BGP RECV 10.9.9.5+64690 -> 10.9.9.4+179 Mar 22 09:41:39.650331 BGP RECV message type 2 (Update) length 70 Mar 22 09:41:39.650350 BGP RECV Update PDU length 70 Mar 22 09:41:39.650370 BGP RECV flags 0x40 code Origin(1): IGP Mar 22 09:41:39.650394 BGP RECV flags 0x40 code ASPath(2) length 6: 7018 Mar 22 09:41:39.650415 BGP RECV flags 0x80 code AIGP(26): AIGP: 20 Mar 22 09:41:39.650436 BGP RECV flags 0x90 code MP_reach(14): AFI/SAFI 1/4 Mar 22 09:41:39.650459 BGP RECV nhop 10.100.1.5 len 4 Mar 22 09:41:39.650495 BGP RECV 99.0.0.0/24 (label 301728) Mar 22 09:41:39.650574 bgp_rcv_nlri: 99.0.0.0/24 Mar 22 09:41:39.650607 bgp_rcv_nlri: 99.0.0.0/24 belongs to meshgroup Mar 22 09:41:39.650629 bgp_rcv_nlri: 99.0.0.0/24 qualified bnp->ribact 0x0 l2afcb 0x0
含义
执行此验证有助于 AIGP 故障排除和调试问题。它允许您验证网络中的哪些设备发送和接收 AIGP 属性。