示例:为 VPN 的 BGP 路由目标过滤配置导出策略
此示例说明如何为 BGP 路由目标过滤(也称为路由目标约束或 RTC)配置导出路由策略。
要求
此示例使用以下硬件和软件组件:
支持 BGP 路由目标过滤的四个瞻博网络设备。
为代理 BGP 路由过滤配置的一个或多个设备上的 Junos OS 12.2 或更高版本。在此示例中,您可以在路由反射器上显式配置代理 BGP 路由过滤。
为 BGP 路由目标过滤配置导出策略之前,请确保您熟悉并理解以下概念:
概述
BGP 路由目标过滤允许您通过在整个网络中分发路由目标成员资格(RT 成员资格)通告来减少网络资源消耗。BGP 使用 RT 成员身份信息仅将 VPN 路由发送到网络中需要这些路由的设备。与其他类型的 BGP 可访问性类似,您可以将路由策略应用于路由目标过滤路由以影响网络。配置路由目标过滤后,限制路由目标过滤路由的流也会限制可能受此 RT 成员资格所吸引的 VPN 路由。配置此策略涉及:
创建定义路由目标前缀列表的过滤器。
创建策略以选择要用于 BGP 路由目标过滤的路由目标过滤器子集。
要定义路由目标前缀列表:
您可以在层次结构级别配置
rtf-prefix-list
语句[edit policy-options]
,以指定路由目标前缀列表的名称以及一个或多个路由目标前缀。您可以通过此配置指定设备将使用的传入路由目标过滤路由,然后在整个网络中分发。
要配置路由策略并将路由目标前缀列表应用于该策略,可以指定以下策略选项:
-
family route-target
-(可选)路由目标家族匹配条件用于指定匹配的 BGP 路由目标过滤路由。您可以在语句中from
定义此标准。此示例说明如何使用匹配条件创建导出策略family route-target
。注意:配置后
family route-target
,瞻博网络使用 inet.3 表解析下一跃点地址。 protocol route-target
-(可选)路由目标协议匹配条件定义了传入路由必须匹配的标准。您可以在语句中from
定义此标准。此语句主要用于限制策略为本地生成的路由目标过滤路由。注意:使用
show route table bgp.rtarget.0
命令查看代理 BGP 路由目标过滤路由时,将会看到接收路由的 BGP 协议和本地路由目标过滤路由的路由目标协议路由。rtf-prefix-list name
-rtf 前缀列表语句将已配置的路由目标前缀列表应用于策略。您可以在语句中from
定义此标准。
拓扑图
图 1 显示了此示例中使用的拓扑。
在此示例中,在路由反射器(设备 RR1 和设备 RR2)和提供商边缘 (PE) 设备 PE2 上配置了 BGP 路由目标过滤。另一个 PE 设备 PE1 不支持 BGP 路由目标过滤。还在路由反射器和设备 PE1 之间的对等会话上配置了代理 BGP 路由目标过滤,以最大限度地减少设备 PE1 处理的 VPN 路由更新数量。设备 PE2 配置了四个 VPN(vpn1、vpn2、vpn3 和 vpn4),设备 PE1 配置了两个 VPN(vpn1 和 vpn2)。在示例拓扑中,所有设备都参与自治系统 (AS) 203,OSPF 是已配置的内部网关协议 (IGP),LDP 是 VPN 使用的信令协议。在此示例中,我们使用 VPN 路由和转发 (VRF) 实例中的静态路由来生成 VPN 路由。这是为了取代使用 PE 到客户边缘 (CE) 协议,如 OSPF 或 BGP。
在此示例中,您可以在设备 PE2 上配置导出策略以防止 vpn3 路由播发到设备 RR1,从而进一步控制从设备 PE2 播发至设备 PE1 的路由。您可以创建一个策略来 family route-target
指定匹配条件,定义路由目标前缀列表,并通过定义 rtf-prefix-list
标准应用路由目标前缀列表。
配置
CLI 快速配置
要快速配置此示例,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改详细信息,以便与网络配置匹配,然后将命令复制并粘贴到层级的 [edit]
CLI 中。
设备 PE1
set interfaces ge-1/0/0 unit 0 description PE1-to-RR1 set interfaces ge-1/0/0 unit 0 family inet address 10.49.0.1/30 set interfaces ge-1/0/0 unit 0 family mpls set interfaces ge-1/0/1 unit 0 description PE1-to-RR2 set interfaces ge-1/0/1 unit 0 family inet address 10.49.10.1/30 set interfaces ge-1/0/1 unit 0 family mpls set protocols ldp interface ge-1/0/0 set protocols ldp interface ge-1/0/1 set protocols bgp group internal type internal set protocols bgp group internal local-address 10.255.163.58 set protocols bgp group internal neighbor 10.255.165.220 family inet-vpn unicast set protocols bgp group internal neighbor 10.255.165.28 family inet-vpn unicast set protocols ospf area 0.0.0.0 interface ge-1/0/0 set protocols ospf area 0.0.0.0 interface ge-1/0/1 set protocols ospf area 0.0.0.0 interface lo0.0 passive set routing-options route-distinguisher-id 10.255.163.58 set routing-options autonomous-system 203 set routing-instances vpn1 instance-type vrf set routing-instances vpn1 vrf-target target:203:100 set routing-instances vpn1 routing-options static route 203.0.113.1/24 discard set routing-instances vpn2 instance-type vrf set routing-instances vpn2 vrf-target target:203:101 set routing-instances vpn2 routing-options static route 203.0.113.2/24 discard
设备 RR1
set interfaces ge-1/0/0 unit 0 description RR1-to-PE1 set interfaces ge-1/0/0 unit 0 family inet address 10.49.0.2/30 set interfaces ge-1/0/0 unit 0 family mpls set interfaces ge-1/0/1 unit 0 description RR1-to-PE2 set interfaces ge-1/0/1 unit 0 family inet address 10.50.0.2/30 set interfaces ge-1/0/1 unit 0 family mpls set protocols ldp interface ge-1/0/0 set protocols ldp interface ge-1/0/1 set protocols bgp group internal type internal set protocols bgp group internal local-address 198.51.100.0 set protocols bgp group internal cluster 198.51.100.1 set protocols bgp group internal neighbor 10.255.163.58 description vpn1-to-pe1 family inet-vpn unicast set protocols bgp group internal neighbor 10.255.163.58 family route-target proxy-generate set protocols bgp group internal neighbor 10.255.168.42 description vpn1-to-pe2 family inet-vpn unicast set protocols ospf area 0.0.0.0 interface ge-1/0/0 set protocols ospf area 0.0.0.0 interface ge-1/0/1 set protocols ospf area 0.0.0.0 interface lo0.0 passive set routing-options route-distinguisher-id 10.255.165.220 set routing-options autonomous-system 203
设备 RR2
set interfaces ge-1/0/0 unit 0 description RR2-to-PE1 set interfaces ge-1/0/0 unit 0 family inet address 10.49.10.2/30 set interfaces ge-1/0/0 unit 0 family mpls set interfaces ge-1/0/1 unit 0 description RR2-to-PE2 set interfaces ge-1/0/1 unit 0 family inet address 10.50.10.2/30 set interfaces ge-1/0/1 unit 0 family mpls set protocols ldp interface ge-1/0/0 set protocols ldp interface ge-1/0/1 set protocols bgp group internal type internal set protocols bgp group internal local-address 10.255.165.28 set protocols bgp group internal cluster 198.51.100.1 set protocols bgp group internal neighbor 10.255.163.58 description vpn2-to-pe1 family inet-vpn unicast set protocols bgp group internal neighbor 10.255.163.58 family route-target proxy-generate set protocols bgp group internal neighbor 10.255.168.42 description vpn2-to-pe2 family inet-vpn unicast set protocols bgp group internal neighbor 10.255.163.58 family route-target set protocols ospf area 0.0.0.0 interface ge-1/0/0 set protocols ospf area 0.0.0.0 interface ge-1/0/1 set protocols ospf area 0.0.0.0 interface lo0.0 passive set routing-options route-distinguisher-id 10.255.165.28 set routing-options autonomous-system 203
设备 PE2
set interfaces ge-1/0/0 unit 0 description PE2-to-RR1 set interfaces ge-1/0/0 unit 0 family inet address 10.50.0.1/30 set interfaces ge-1/0/0 unit 0 family mpls set interfaces ge-1/0/1 unit 0 description PE2-to-RR2 set interfaces ge-1/0/1 unit 0 family inet address 10.50.10.2/30 set interfaces ge-1/0/1 unit 0 family mpls set protocols ldp interface ge-1/0/0 set protocols ldp interface ge-1/0/1 set protocols bgp group internal type internal set protocols bgp group internal local-address 10.255.168.42 set protocols bgp group internal family inet-vpn unicast set protocols bgp group internal family route-target set protocols bgp group internal neighbor 10.255.165.220 export filter-rtc set protocols bgp group internal neighbor 10.255.165.28 set protocols ospf area 0.0.0.0 interface ge-1/0/0 set protocols ospf area 0.0.0.0 interface ge-1/0/1 set protocols ospf area 0.0.0.0 interface lo0.0 passive set policy-options rtf-prefix-list exclude-103 203:203:103/96 set policy-options policy-statement filter-rtc from family route-target set policy-options policy-statement filter-rtc from rtf-prefix-list exclude-103 set policy-options policy-statement filter-rtc then reject set routing-options route-distinguisher-id 10.255.168.42 set routing-options autonomous-system 203 set routing-instances vpn1 instance-type vrf set routing-instances vpn1 vrf-target target:203:100 set routing-instances vpn1 routing-options static route 203.0.113.1/24 discard set routing-instances vpn2 instance-type vrf set routing-instances vpn2 vrf-target target:203:101 set routing-instances vpn2 routing-options static route 203.0.113.2/24 discard set routing-instances vpn3 instance-type vrf set routing-instances vpn3 vrf-target target:203:103 set routing-instances vpn3 routing-options static route 203.0.113.3/24 discard set routing-instances vpn4 instance-type vrf set routing-instances vpn4 vrf-target target:203:104 set routing-instances vpn4 routing-options static route 203.0.113.4/24 discard
配置设备 PE1
逐步过程
以下示例要求您在配置层次结构中的各个级别上导航。有关导航 CLI 的信息,请参阅 在配置模式下使用 CLI 编辑器。
要配置设备 PE1:
配置接口。
[edit interfaces] user@PE1# set ge-1/0/0 unit 0 description PE1-to-RR1 user@PE1# set ge-1/0/0 unit 0 family inet address 10.49.0.1/30 user@PE1# set ge-1/0/0 unit 0 family mpls user@PE1#set ge-1/0/1 unit 0 description PE1-to-RR2 user@PE1#set ge-1/0/1 unit 0 family inet address 10.49.10.1/30 user@PE1# set ge-1/0/1 unit 0 family mpls
配置路由识别码和 AS 编号。
[edit routing-options] user@PE1# set route-distinguisher-id 10.255.163.58 user@PE1# set autonomous-system 203
将 LDP 配置为 VPN 使用的信令协议。
[edit protocols ldp] user@PE1# set interface ge-1/0/0 user@PE1# set interface ge-1/0/1
配置 BGP。
[edit protocols bgp group internal] user@PE1# set type internal user@PE1# set local-address 10.255.163.58 user@PE1# set neighbor 10.255.165.220 family inet-vpn unicast user@PE1# set neighbor 10.255.165.28 family inet-vpn unicast
配置 OSPF。
[edit protocols ospf area 0.0.0.0] user@PE1# set interface ge-1/0/0 user@PE1# set interface ge-1/0/1 user@PE1# set interface lo0.0 passive
配置 VPN 路由实例。
[edit routing-instances vpn1] user@PE1# set instance-type vrf user@PE1# set vrf-target target:203:100 user@PE1# set routing-options static route 203.0.113.1/24 discard
[edit routing-instances vpn2] user@PE1# set instance-type vrf user@PE1# set vrf-target target:203:101 user@PE1# set routing-options static route 203.0.113.2/24 discard
完成设备配置后,提交配置。
[edit] user@PE1# commit
结果
在配置模式下,输入 show interfaces
、 show protocols
、 show routing-options
和 show routing-instances
命令,以确认您的配置。如果输出未显示预期的配置,请重复此示例中的说明,以更正配置。
user@PE1# show interfaces ge-1/0/0 { unit 0 { description PE1-to-RR1; family inet { address 10.49.0.1/30; } family mpls; } } ge-1/0/1 { unit 0 { description PE1-to-RR2; family inet { address 10.49.10.1/30; } family mpls; } }
user@PE1# show protocols bgp { group internal { type internal; local-address 10.255.163.58; neighbor 10.255.165.220 { family inet-vpn { unicast; } } neighbor 10.255.165.28 { family inet-vpn { unicast; } } } } ospf { area 0.0.0.0 { interface ge-1/0/0.0; interface ge-1/0/1.0; interface lo0.0 { passive; } } } ldp { interface ge-1/0/0.0; interface ge-1/0/1.0; }
user@PE1# show routing-options route-distinguisher-id 10.255.14.182; autonomous-system 203;
user@PE1# show routing-instances vpn1 { instance-type vrf; vrf-target target:203:100; routing-options { static { route 203.0.113.1/24 discard; } } } vpn2 { instance-type vrf; vrf-target target:203:101; routing-options { static { route 203.0.113.2/24 discard; } } }
配置设备 RR1
逐步过程
以下示例要求您在配置层次结构中的各个级别上导航。有关导航 CLI 的信息,请参阅 在配置模式下使用 CLI 编辑器。
要配置设备 RR1:
配置接口。
[edit interfaces] user@RR1# set ge-1/0/0 unit 0 description RR1-to-PE1 user@RR1# set ge-1/0/0 unit 0 family inet address 10.49.0.2/30 user@RR1# set ge-1/0/0 unit 0 family mpls user@RR1# set ge-1/0/1 unit 0 description RR1-to-PE2 user@RR1# set ge-1/0/1 unit 0 family inet address 10.50.0.2/30 user@RR1# set ge-1/0/1 unit 0 family mpls
配置路由识别码和 AS 编号。
[edit routing-options] user@RR1# set route-distinguisher-id 10.255.165.220 user@RR1# set autonomous-system 203
将 LDP 配置为 VPN 使用的信令协议。
[edit protocols ldp] user@RR1# set interface ge-1/0/0 user@RR1# set interface ge-1/0/1
配置 BGP。
[edit protocols bgp group internal] user@RR1# set type internal user@RR1# set local-address 10.255.165.220 user@RR1# set cluster 198.51.100.1 user@RR1# set neighbor 10.255.163.58 description vpn1-to-pe1 family inet-vpn unicast user@RR1# set neighbor 10.255.168.42 description vpn1-to-pe2 family inet-vpn unicast
在与设备 PE2 的对等会话上配置 BGP 路由目标过滤。
[edit protocols bgp group internal] user@RR1# set neighbor 10.255.168.42 family route-target
在与设备 PE1 的对等会话上配置代理 BGP 路由目标过滤。
[edit protocols bgp group internal] user@RR1# set neighbor 10.255.163.58 family route-target proxy-generate
配置 OSPF。
[edit protocols ospf area 0.0.0.0] user@RR1# set interface ge-1/0/0 user@RR1# set interface ge-1/0/1 user@RR1# set interface lo0.0 passive
完成设备配置后,提交配置。
[edit] user@RR1# commit
结果
在配置模式下,输入 、 show protocols
和show routing-options
命令,show interfaces
以确认您的配置。如果输出未显示预期的配置,请重复此示例中的说明,以更正配置。
user@RR1# show interfaces ge-1/0/0 { unit 0 { description RR1-to-PE1; family inet { address 10.49.0.2/30; } family mpls; } } ge-1/0/1 { unit 0 { description RR1-to-PE2; family inet { address 10.50.0.2/30; } family mpls; } }
user@RR1# show protocols bgp { group internal { type internal; local-address 198.51.100.0; cluster 198.51.100.1; neighbor 10.255.163.58 { description vpn1-to-pe1; family inet-vpn { unicast; } family route-target { proxy-generate; } } neighbor 10.255.168.42 { description vpn1-to-pe2; family inet-vpn { unicast; } family route-target; } } } ospf { area 0.0.0.0 { interface ge-1/0/0.0; interface ge-1/0/1.0; interface lo0.0 { passive; } } } ldp { interface ge-1/0/0.0; interface ge-1/0/1.0; } ospf { area 0.0.0.0 { interface ge-1/0/0.0; interface ge-1/0/1.0; interface lo0.0 { passive; } } } ldp { interface ge-1/0/0.0; interface ge-1/0/1.0; }
user@RR1# show routing-options route-distinguisher-id 10.255.165.220; autonomous-system 203;
配置设备 RR2
逐步过程
以下示例要求您在配置层次结构中的各个级别上导航。有关导航 CLI 的信息,请参阅 在配置模式下使用 CLI 编辑器。
要配置设备 RR2:
配置接口。
[edit interfaces] user@RR2# set ge-1/0/0 unit 0 description RR2-to-PE1 user@RR2# set ge-1/0/0 unit 0 family inet address 10.49.10.2/30 user@RR2# set ge-1/0/0 unit 0 family mpls user@RR2# set ge-1/0/1 unit 0 description RR2-to-PE2 user@RR2# set ge-1/0/1 unit 0 family inet address 10.50.10.2/30 user@RR2# set ge-1/0/1 unit 0 family mpls
配置路由识别码和 AS 编号。
[edit routing-options] user@RR2# set route-distinguisher-id 10.255.165.28 user@RR2# set autonomous-system 203
将 LDP 配置为 VPN 使用的信令协议。
[edit protocols ldp] user@RR2# set interface ge-1/0/0 user@RR2# set interface ge-1/0/1
配置 BGP。
[edit protocols bgp group internal] user@RR2# set type internal user@RR2# set local-address 10.255.165.28 user@RR2# set cluster 198.51.100.1 user@RR2# set neighbor 10.255.163.58 description vpn2-to-pe1 family inet-vpn unicast user@RR2# set neighbor 10.255.168.42 description vpn2-to-pe2 family inet-vpn unicast
在与设备 PE2 的对等会话上配置 BGP 路由目标过滤。
[edit protocols bgp group internal] user@RR2# set neighbor 10.255.168.42 family route-target
在与设备 PE1 的对等会话上配置代理 BGP 路由目标过滤。
[edit protocols bgp group internal] user@RR2# set neighbor 10.255.163.58 family route-target proxy-generate
配置 OSPF。
[edit protocols ospf area 0.0.0.0] user@RR2# set interface ge-1/0/0 user@RR2# set interface ge-1/0/1 user@RR2# set interface lo0.0 passive
完成设备配置后,提交配置。
[edit] user@RR2# commit
结果
在配置模式下,输入 、 show protocols
和show routing-options
命令,show interfaces
以确认您的配置。如果输出未显示预期的配置,请重复此示例中的说明,以更正配置。
user@RR2# show interfaces ge-1/0/0 { unit 0 { description RR2-to-PE1; family inet { address 10.49.10.2/30; } family mpls; } } ge-1/0/1 { unit 0 { description RR2-to-PE2; family inet { address 10.50.10.2/30; } family mpls; } }
user@RR2# show protocols bgp { group internal { local-address 10.255.165.28; cluster 198.51.100.1; neighbor 10.255.163.58 { description vpn2-to-pe1; family inet-vpn { unicast; } family route-target { proxy-generate; } } neighbor 10.255.168.42 { description vpn2-to-pe2; family inet-vpn { unicast; } family route-target; } } } ospf { area 0.0.0.0 { interface ge-1/0/0.0; interface ge-1/0/1.0; interface lo0.0 { passive; } } } ldp { interface ge-1/0/0.0; interface ge-1/0/1.0; }
user@RR2# show routing-options route-distinguisher-id 10.255.165.28; autonomous-system 203;
配置设备 PE2
逐步过程
以下示例要求您在配置层次结构中的各个级别上导航。有关导航 CLI 的信息,请参阅 在配置模式下使用 CLI 编辑器。
要配置设备 PE2:
配置接口。
[edit interfaces] user@PE2# set ge-1/0/0 unit 0 description PE2-to-RR1 user@PE2# set ge-1/0/0 unit 0 family inet address 10.50.0.1/30 user@PE2# set ge-1/0/0 unit 0 family mpls user@PE2#set ge-1/0/1 unit 0 description PE2-to-RR2 user@PE2#set ge-1/0/1 unit 0 family inet address 10.50.10.2/30 user@PE2# set ge-1/0/1 unit 0 family mpls
配置路由识别码和 AS 编号。
[edit routing-options] user@PE2# set route-distinguisher-id 10.255.168.42 user@PE2# set autonomous-system 203
将 LDP 配置为 VPN 使用的信令协议。
[edit protocols ldp] user@PE2# set interface ge-1/0/0 user@PE2# set interface ge-1/0/1
配置 BGP。
[edit protocols bgp group internal] user@PE2# set type internal user@PE2# set local-address 10.255.168.42 user@PE2# set family inet-vpn unicast user@PE2# set family route-target user@PE2# set neighbor 10.255.165.220 user@PE2# set neighbor 10.255.165.28
配置 OSPF。
[edit protocols ospf area 0.0.0.0] user@PE2# set interface ge-1/0/0 user@PE2# set interface ge-1/0/1 user@PE2# set interface lo0.0 passive
配置 VPN 路由实例。
[edit routing-instances vpn1] user@PE2# set instance-type vrf user@PE2# set vrf-target target:203:100 user@PE2# set routing-options static route 203.0.113.1/24 discard
[edit routing-instances vpn2] user@PE2# set instance-type vrf user@PE2# set vrf-target target:203:101 user@PE2# set routing-options static route 203.0.113.2/24 discard
[edit routing-instances vpn3] user@PE2# set instance-type vrf user@PE2# set vrf-target target:203:103 user@PE2# set routing-options static route 203.0.113.3/24 discard
[edit routing-instances vpn4] user@PE2# set instance-type vrf user@PE2# set vrf-target target:203:104 user@PE2# set routing-options static route 203.0.113.4/24 discard
配置并应用导出路由策略。
[edit policy-options] user@PE2# set rtf-prefix-list exclude-103 203:203:103/96 [edit policy-options policy-statement filter-rtc] user@PE2# set from family route-target user@PE2# set from rtf-prefix-list exclude-103 user@PE2# set then reject [edit protocols bgp group internal] user@PE2# set neighbor 10.255.165.220 export filter-rtc
完成设备配置后,提交配置。
[edit] user@PE2# commit
结果
在配置模式下,输入 、 show interfaces
show protocols
、 show policy-options
、 show routing-options
和show routing-instances
命令,以确认您的配置。如果输出未显示预期的配置,请重复此示例中的说明,以更正配置。
user@PE2# show interfaces ge-1/0/0 { unit 0 { description PE2-to-RR1; family inet { address 10.50.0.1/30; } family mpls; } } ge-1/0/1 { unit 0 { description PE2-to-RR2; family inet { address 10.50.10.2/30; } family mpls; } }
user@PE2# show protocols bgp { group internal { type internal; local-address 10.255.168.42; family inet-vpn { unicast; } family route-target; neighbor 10.255.165.220 { export filter-rtc; } neighbor 10.255.165.28; } } ospf { area 0.0.0.0 { interface ge-1/0/0.0; interface ge-1/0/1.0; interface lo0.0 { passive; } } } ldp { interface ge-1/0/0.0; interface ge-1/0/1.0; }
user@PE2# show routing-options route-distinguisher-id 10.255.168.42; autonomous-system 203;
user@PE2# show policy-options policy-statement filter-rtc { from { family route-target; rtf-prefix-list exclude-103; } then reject; } rtf-prefix-list exclude-103 { 203:203:103/96; }
user@PE2# show routing-instances vpn1 { instance-type vrf; vrf-target target:203:100; routing-options { static { route 203.0.113.1/24 discard; } } } vpn2 { instance-type vrf; vrf-target target:203:101; routing-options { static { route 203.0.113.2/24 discard; } } } vpn3 { instance-type vrf; vrf-target target:203:103; routing-options { static { route 203.0.113.3/24 discard; } } } vpn4 { instance-type vrf; vrf-target target:203:104; routing-options { static { route 203.0.113.4/24 discard; } } }
验证
确认配置工作正常。
验证设备 RR1 bgp.rtarget.0 路由表中的路由目标过滤路由
目的
验证 vpn3 的路由前缀不在设备 RR1 的 bgp.rtarget.0 表中。由于应用了设备 PE2 上的导出策略以防止将 vpn3 路由播发到设备 RR1,设备 RR1 不应接收这些播发。
行动
在操作模式下,输入 show route advertising-protocol bgp 10.255.165.220 table bgp.rtarget.0
命令。
user@PE2# show route advertising-protocol bgp 10.255.165.220 table bgp.rtarget.0
bgp.rtarget.0: 4 destinations, 11 routes
(4 active, 0 holddown, 0 hidden)
Prefix Nexthop MED Lclpref AS path
203:203:100/96 * Self 100 I
203:203:101/96 * Self 100 I
203:203:104/96 * Self 100 I
意义
bgp.rtartget.0 表不显示 203:203:103/96,即 vpn3 的路由前缀。这意味着导出策略应用正确。
验证设备 RR2 bgp.rtarget.0 路由表中的路由目标过滤路由
目的
验证 vpn3 的路由前缀是否在设备 RR2 的 bgp.rtarget.0 表中。由于未在设备 PE2 上应用导出策略以防止将 vpn3 路由播发到设备 RR2,设备 RR2 应接收来自所有 VPN 的播发。
行动
在操作模式下,输入 show route advertising-protocol bgp 10.255.165.28 table bgp.rtarget.0
命令。
user@PE2# show route advertising-protocol bgp 10.255.165.28 table bgp.rtarget.0
bgp.rtarget.0: 4 destinations, 11 routes (4 active, 0 holddown, 0 hidden)
(4 active, 0 holddown, 0 hidden)
Prefix Nexthop MED Lclpref AS path
203:203:100/96 * Self 100 I
203:203:101/96 * Self 100 I
203:203:103/96 * Self 100 I
203:203:104/96 * Self 100 I
意义
bgp.rtartget.0 表显示所有 VPN 的路由前缀。