示例:基于 MBGP MVPN 地址族配置 BGP 路由抖动阻尼
此示例说明如何配置具有 BGP 路由抖动抑制的多协议 BGP 组播 VPN(也称为下一代 MVPN)。
要求
此示例使用 Junos OS 12.2 版。Junos OS 12.2 版中引入了对 MBGP MVPN 的 BGP 路由抖动阻尼支持,特别是在地址族的基础上。
概述
BGP 路由抖动阻尼有助于减少在链路间歇性故障时反复撤销和重新播发路由而导致的路由不稳定。
此示例使用默认阻尼参数,并演示了具有三个提供商边缘 (PE) 路由设备、三个客户边缘 (CE) 路由设备和一个提供商 (P) 路由设备的 MBGP MVPN 方案。
配置
CLI 快速配置
要快速配置此示例,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改与您的网络配置匹配所需的任何详细信息,然后将命令复制并粘贴到层次结构级别的 CLI [edit]
中。
设备 R1
set interfaces ge-1/2/0 unit 1 family inet address 10.1.1.1/30 set interfaces ge-1/2/0 unit 1 family mpls set interfaces lo0 unit 1 family inet address 172.16.1.1/32 set protocols ospf area 0.0.0.0 interface lo0.1 passive set protocols ospf area 0.0.0.0 interface ge-1/2/0.1 set protocols pim rp static address 172.16.100.1 set protocols pim interface all set routing-options router-id 172.16.1.1
设备 R2
set interfaces ge-1/2/0 unit 2 family inet address 10.1.1.2/30 set interfaces ge-1/2/0 unit 2 family mpls set interfaces ge-1/2/1 unit 5 family inet address 10.1.1.5/30 set interfaces ge-1/2/1 unit 5 family mpls set interfaces vt-1/2/0 unit 2 family inet set interfaces lo0 unit 2 family inet address 172.16.1.2/32 set interfaces lo0 unit 102 family inet address 172.16.100.1/32 set protocols mpls interface ge-1/2/1.5 set protocols bgp group ibgp type internal set protocols bgp group ibgp local-address 172.16.1.2 set protocols bgp group ibgp family inet-vpn any set protocols bgp group ibgp family inet-mvpn signaling set protocols bgp group ibgp neighbor 172.16.1.4 set protocols bgp group ibgp neighbor 172.16.1.5 set protocols ospf area 0.0.0.0 interface lo0.2 passive set protocols ospf area 0.0.0.0 interface ge-1/2/1.5 set protocols ldp interface ge-1/2/1.5 set protocols ldp p2mp set policy-options policy-statement parent_vpn_routes from protocol bgp set policy-options policy-statement parent_vpn_routes then accept set routing-instances vpn-1 instance-type vrf set routing-instances vpn-1 interface ge-1/2/0.2 set routing-instances vpn-1 interface vt-1/2/0.2 set routing-instances vpn-1 interface lo0.102 set routing-instances vpn-1 route-distinguisher 100:100 set routing-instances vpn-1 provider-tunnel ldp-p2mp set routing-instances vpn-1 vrf-target target:1:1 set routing-instances vpn-1 protocols ospf export parent_vpn_routes set routing-instances vpn-1 protocols ospf area 0.0.0.0 interface lo0.102 passive set routing-instances vpn-1 protocols ospf area 0.0.0.0 interface ge-1/2/0.2 set routing-instances vpn-1 protocols pim rp static address 172.16.1.2 with 172.16.4.1100.1 set routing-instances vpn-1 protocols pim interface ge-1/2/0.2 mode sparse set routing-instances vpn-1 protocols mvpn set routing-options router-id 172.16.1.2 set routing-options autonomous-system 1001
设备 R3
set interfaces ge-1/2/0 unit 6 family inet address 10.1.1.6/30 set interfaces ge-1/2/0 unit 6 family mpls set interfaces ge-1/2/1 unit 9 family inet address 10.1.1.9/30 set interfaces ge-1/2/1 unit 9 family mpls set interfaces ge-1/2/2 unit 13 family inet address 10.1.1.13/30 set interfaces ge-1/2/2 unit 13 family mpls set interfaces lo0 unit 3 family inet address 172.16.1.3/32 set protocols mpls interface ge-1/2/0.6 set protocols mpls interface ge-1/2/1.9 set protocols mpls interface ge-1/2/2.13 set protocols ospf area 0.0.0.0 interface lo0.3 passive set protocols ospf area 0.0.0.0 interface ge-1/2/0.6 set protocols ospf area 0.0.0.0 interface ge-1/2/1.9 set protocols ospf area 0.0.0.0 interface ge-1/2/2.13 set protocols ldp interface ge-1/2/0.6 set protocols ldp interface ge-1/2/1.9 set protocols ldp interface ge-1/2/2.13 set protocols ldp p2mp set routing-options router-id 172.16.1.3
设备 R4
set interfaces ge-1/2/0 unit 10 family inet address 10.1.1.10/30 set interfaces ge-1/2/0 unit 10 family mpls set interfaces ge-1/2/1 unit 17 family inet address 10.1.1.17/30 set interfaces ge-1/2/1 unit 17 family mpls set interfaces vt-1/2/0 unit 4 family inet set interfaces lo0 unit 4 family inet address 172.16.1.4/32 set interfaces lo0 unit 104 family inet address 172.16.100.1/32 set protocols rsvp interface all aggregate set protocols mpls interface all set protocols mpls interface ge-1/2/0.10 set protocols bgp group ibgp type internal set protocols bgp group ibgp local-address 172.16.1.4 set protocols bgp group ibgp family inet-vpn unicast set protocols bgp group ibgp family inet-vpn any set protocols bgp group ibgp family inet-mvpn signaling damping set protocols bgp group ibgp neighbor 172.16.1.2 import dampPolicy set protocols bgp group ibgp neighbor 172.16.1.5 set protocols ospf traffic-engineering set protocols ospf area 0.0.0.0 interface all set protocols ospf area 0.0.0.0 interface lo0.4 passive set protocols ospf area 0.0.0.0 interface ge-1/2/0.10 set protocols ldp interface ge-1/2/0.10 set protocols ldp p2mp set policy-options policy-statement dampPolicy term term1 from family inet-mvpn set policy-options policy-statement dampPolicy term term1 from nlri-route-type 3 set policy-options policy-statement dampPolicy term term1 from nlri-route-type 4 set policy-options policy-statement dampPolicy term term1 from nlri-route-type 5 set policy-options policy-statement dampPolicy term term1 then accept set policy-options policy-statement dampPolicy then damping no-damp set policy-options policy-statement dampPolicy then accept set policy-options policy-statement parent_vpn_routes from protocol bgp set policy-options policy-statement parent_vpn_routes then accept set policy-options damping no-damp disable set routing-instances vpn-1 instance-type vrf set routing-instances vpn-1 interface vt-1/2/0.4 set routing-instances vpn-1 interface ge-1/2/1.17 set routing-instances vpn-1 interface lo0.104 set routing-instances vpn-1 route-distinguisher 100:100 set routing-instances vpn-1 vrf-target target:1:1 set routing-instances vpn-1 protocols ospf export parent_vpn_routes set routing-instances vpn-1 protocols ospf area 0.0.0.0 interface lo0.104 passive set routing-instances vpn-1 protocols ospf area 0.0.0.0 interface ge-1/2/1.17 set routing-instances vpn-1 protocols pim rp static address 172.16.100.1 set routing-instances vpn-1 protocols pim interface ge-1/2/1.17 mode sparse set routing-instances vpn-1 protocols mvpn set routing-options router-id 172.16.1.4 set routing-options autonomous-system 64501
设备 R5
set interfaces ge-1/2/0 unit 14 family inet address 10.1.1.14/30 set interfaces ge-1/2/0 unit 14 family mpls set interfaces ge-1/2/1 unit 21 family inet address 10.1.1.21/30 set interfaces ge-1/2/1 unit 21 family mpls set interfaces vt-1/2/0 unit 5 family inet set interfaces lo0 unit 5 family inet address 172.16.1.5/32 set interfaces lo0 unit 105 family inet address 172.16.100.5/32 set protocols mpls interface ge-1/2/0.14 set protocols bgp group ibgp type internal set protocols bgp group ibgp local-address 172.16.1.5 set protocols bgp group ibgp family inet-vpn any set protocols bgp group ibgp family inet-mvpn signaling set protocols bgp group ibgp neighbor 172.16.1.2 set protocols bgp group ibgp neighbor 172.16.1.4 set protocols ospf area 0.0.0.0 interface lo0.5 passive set protocols ospf area 0.0.0.0 interface ge-1/2/0.14 set protocols ldp interface ge-1/2/0.14 set protocols ldp p2mp set policy-options policy-statement parent_vpn_routes from protocol bgp set policy-options policy-statement parent_vpn_routes then accept set routing-instances vpn-1 instance-type vrf set routing-instances vpn-1 interface vt-1/2/0.5 set routing-instances vpn-1 interface ge-1/2/1.21 set routing-instances vpn-1 interface lo0.105 set routing-instances vpn-1 route-distinguisher 100:100 set routing-instances vpn-1 vrf-target target:1:1 set routing-instances vpn-1 protocols ospf export parent_vpn_routes set routing-instances vpn-1 protocols ospf area 0.0.0.0 interface lo0.105 passive set routing-instances vpn-1 protocols ospf area 0.0.0.0 interface ge-1/2/1.21 set routing-instances vpn-1 protocols pim rp static address 172.16.100.2 set routing-instances vpn-1 protocols pim interface ge-1/2/1.21 mode sparse set routing-instances vpn-1 protocols mvpn set routing-options router-id 172.16.1.5 set routing-options autonomous-system 1001
设备 R6
set interfaces ge-1/2/0 unit 18 family inet address 10.1.1.18/30 set interfaces ge-1/2/0 unit 18 family mpls set interfaces lo0 unit 6 family inet address 172.16.1.6/32 set protocols sap listen 233.1.1.1 set protocols ospf area 0.0.0.0 interface lo0.6 passive set protocols ospf area 0.0.0.0 interface ge-1/2/0.18 set protocols pim rp static address 172.16.100.2 set protocols pim interface all set routing-options router-id 172.16.1.6
设备 R7
set interfaces ge-1/2/0 unit 22 family inet address 10.1.1.22/30 set interfaces ge-1/2/0 unit 22 family mpls set interfaces lo0 unit 7 family inet address 172.16.1.7/32 set protocols ospf area 0.0.0.0 interface lo0.7 passive set protocols ospf area 0.0.0.0 interface ge-1/2/0.22 set protocols pim rp static address 172.16.100.2 set protocols pim interface all set routing-options router-id 172.16.1.7
配置设备 R4
分步过程
下面的示例要求您在各个配置层级中进行导航。有关导航 CLI 的信息,请参阅《Junos OS CLI 用户指南》中的在配置模式下使用 CLI 编辑器。
要配置设备 R4:
配置接口。
[edit interfaces] user@R4# set ge-1/2/0 unit 10 family inet address 10.1.1.10/30 user@R4# set ge-1/2/0 unit 10 family mpls user@R4# set ge-1/2/1 unit 17 family inet address 10.1.1.17/30 user@R4# set ge-1/2/1 unit 17 family mpls user@R4# set vt-1/2/0 unit 4 family inet user@R4# set lo0 unit 4 family inet address 172.16.1.4/32 user@R4# set lo0 unit 104 family inet address 172.16.100.4/32
在接口上配置 MPLS 和信令协议。
[edit protocols] user@R4# set mpls interface all user@R4# set mpls interface ge-1/2/0.10 user@R4# set rsvp interface all aggregate user@R4# set ldp interface ge-1/2/0.10 user@R4# set ldp p2mp
配置 BGP。
BGP 配置可为地址族启用
inet-mvpn
BGP 路由抖动阻尼。BGP 配置还会将名为 的dampPolicy
路由策略导入到路由表中。此策略应用于邻接方 PE 设备 R2。[edit protocols bgp group ibgp] user@R4# set type internal user@R4# set local-address 172.16.1.4 user@R4# set family inet-vpn unicast user@R4# set family inet-vpn any user@R4# set family inet-mvpn signaling damping user@R4# set neighbor 172.16.1.2 import dampPolicy user@R4# set neighbor 172.16.1.5
配置内部网关协议。
[edit protocols ospf] user@R4# set traffic-engineering [edit protocols ospf area 0.0.0.0] user@R4# set interface all user@R4# set interface lo0.4 passive user@R4# set interface ge-1/2/0.10
配置使用
nlri-route-type
匹配条件的阻尼策略,以仅抑制 MVPN 路由类型 3、4 和 5。[edit policy-options policy-statement dampPolicy term term1] user@R4# set from family inet-mvpn user@R4# set from nlri-route-type 3 user@R4# set from nlri-route-type 4 user@R4# set from nlri-route-type 5 user@R4# set then accept
配置策略以
damping
禁用 BGP 路由抖动抑制。no-damp
策略 (damping no-damp disable
) 会导致删除路由表中存在的任何阻尼状态。该then damping no-damp
语句将no-damp
策略作为操作应用,并且没有from
匹配条件。因此,所有不匹配term1
的路由都将与此术语匹配,结果所有其他 MVPN 路由类型都不会被阻尼。[edit policy-options policy-statement dampPolicy] user@R4# set then damping no-damp user@R4# set then accept [edit policy-options] user@R4# set damping no-damp disable
将 配置为
parent_vpn_routes
接受不属于地址族的inet-mvpn
所有其他 BGP 路由。此策略作为路由实例中的 OSPF 导出策略应用。
[edit policy-options policy-statement parent_vpn_routes] user@R4# set from protocol bgp user@R4# set then accept
配置 VPN 路由和转发 (VRF) 实例。
[edit routing-instances vpn-1] user@R4# set instance-type vrf user@R4# set interface vt-1/2/0.4 user@R4# set interface ge-1/2/1.17 user@R4# set interface lo0.104 user@R4# set route-distinguisher 100:100 user@R4# set vrf-target target:1:1 user@R4# set protocols ospf export parent_vpn_routes user@R4# set protocols ospf area 0.0.0.0 interface lo0.104 passive user@R4# set protocols ospf area 0.0.0.0 interface ge-1/2/1.17 user@R4# set protocols pim rp static address 172.16.100.2 user@R4# set protocols pim interface ge-1/2/1.17 mode sparse user@R4# set protocols mvpn
配置路由器 ID 和自治系统 (AS) 编号。
[edit routing-options] user@R4# set router-id 172.16.1.4 user@R4# set autonomous-system 1001
如果完成设备配置,请提交配置。
user@R4# commit
结果
在配置模式下,输入 show interfaces
、 show protocols
、 show routing-instances
show policy-options
和show routing-options
命令来确认您的配置。如果输出未显示预期的配置,请重复此示例中的说明,以便进行更正。
user@R4# show interfaces ge-1/2/0 { unit 10 { family inet { address 10.1.1.10/30; } family mpls; } } ge-1/2/1 { unit 17 { family inet { address 10.1.1.17/30; } family mpls; } } vt-1/2/0 { unit 4 { family inet; } } lo0 { unit 4 { family inet { address 172.16.1.4/32; } } unit 104 { family inet { address 172.16.100.4/32; } } }
user@R4# show protocols rsvp { interface all { aggregate; } } mpls { interface all; interface ge-1/2/0.10; } bgp { group ibgp { type internal; local-address 172.16.1.4; family inet-vpn { unicast; any; } family inet-mvpn { signaling { damping; } } neighbor 172.16.1.2 { import dampPolicy; } neighbor 172.16.1.5; } } ospf { traffic-engineering; area 0.0.0.0 { interface all; interface lo0.4 { passive; } interface ge-1/2/0.10; } } ldp { interface ge-1/2/0.10; p2mp; }
user@R4# show policy-options policy-statement dampPolicy { term term1 { from { family inet-mvpn; nlri-route-type [ 3 4 5 ]; } then accept; } then { damping no-damp; accept; } } policy-statement parent_vpn_routes { from protocol bgp; then accept; } damping no-damp { disable; }
user@R4# show routing-instances vpn-1 { instance-type vrf; interface vt-1/2/0.4; interface ge-1/2/1.17; interface lo0.104; route-distinguisher 100:100; vrf-target target:1:1; protocols { ospf { export parent_vpn_routes; area 0.0.0.0 { interface lo0.104 { passive; } interface ge-1/2/1.17; } } pim { rp { static { address 172.16.100.2; } } interface ge-1/2/1.17 { mode sparse; } } mvpn; } }
user@R4# show routing-optons router-id 172.16.1.4; autonomous-system 1001;
验证
确认配置工作正常。
验证是否禁用了路由抖动阻尼
目的
no-damp
验证是否存在该策略,该策略将禁用 3、4 和 5 以外的 MVPN 路由类型的阻尼。
操作
在操作模式下,输入 show policy damping
命令。
user@R4> show policy damping Default damping information: Halflife: 15 minutes Reuse merit: 750 Suppress/cutoff merit: 3000 Maximum suppress time: 60 minutes Computed values: Merit ceiling: 12110 Maximum decay: 6193 Damping information for "no-damp": Damping disabled
意义
输出显示默认阻尼参数已生效, no-damp
并且策略对指定的路由类型也有效。
验证路由抖动阻尼
目的
检查 BGP 路由是否已阻尼。
操作
在操作模式下,输入 show bgp summary
命令。
user@R4> show bgp summary Groups: 1 Peers: 2 Down peers: 0 Table Tot Paths Act Paths Suppressed History Damp State Pending bgp.l3vpn.0 6 6 0 0 0 0 bgp.l3vpn.2 0 0 0 0 0 0 bgp.mvpn.0 2 2 0 0 0 0 Peer AS InPkt OutPkt OutQ Flaps Last Up/Dwn State|#Active/Received/Accepted/Damped... 172.16.1.2 1001 3159 3155 0 0 23:43:47 Establ bgp.l3vpn.0: 3/3/3/0 bgp.l3vpn.2: 0/0/0/0 bgp.mvpn.0: 1/1/1/0 vpn-1.inet.0: 3/3/3/0 vpn-1.mvpn.0: 1/1/1/0 172.16.1.5 1001 3157 3154 0 0 23:43:40 Establ bgp.l3vpn.0: 3/3/3/0 bgp.l3vpn.2: 0/0/0/0 bgp.mvpn.0: 1/1/1/0 vpn-1.inet.0: 3/3/3/0 vpn-1.mvpn.0: 1/1/1/0
意义
“潮湿状态”字段显示 bgp.mvpn.0 路由表中的零路由已被抑制。再往下看,状态字段中的最后一个数字显示 BGP 对等方 172.16.1.2 的路由已阻尼零。