Configure BGP Route Target Filtering on Router PE2
This section describes how to enable BGP route target filtering on router PE2 for this example.
Configure the routing options on router PE2 as follows:
[edit]routing-options {route-distinguisher-id 10.255.14.176;autonomous-system 200;}Configure the BGP protocol on router PE2 as follows:
[edit]protocols {bgp {group to_vpn04 {type internal;local-address 10.255.14.176;peer-as 200;neighbor 10.255.14.174 {family inet-vpn {unicast;}family route-target;}}}}Configure the
vpn1routing instance on router PE2 as follows:[edit]routing-instances {vpn1 {instance-type vrf;interface t3-0/0/0.0;vrf-target target:200:101;protocols {bgp {group vpn1 {type external;peer-as 101;as-override;neighbor 10.49.11.2;}}}}}Configure the
vpn2routing instance on router PE2 as follows:[edit]routing-instances {vpn2 {instance-type vrf;interface t3-0/0/0.1;vrf-target target:200:102;protocols {bgp {group vpn2 {type external;peer-as 102;as-override;neighbor 10.49.21.2;}}}}}Configure the
vpn3routing instance on router PE2 as follows:[edit]routing-instances {vpn3 {instance-type vrf;interface t3-0/0/0.2;vrf-import vpn3-import;vrf-export vpn3-export;protocols {bgp {group vpn3 {type external;peer-as 103;as-override;neighbor 10.49.31.2;}}}}}Once you have configured router PE2 in this manner, you should see the following when you issue the
show route table bgp.rtarget.0command:user@host>show route table bgp.rtarget.0bgp.rtarget.0: 4 destinations, 7 routes (4 active, 0 holddown, 0 hidden)+ = Active Route, - = Last Active, * = Both200:200:101/96*[RTarget/5] 00:28:15Local[BGP/170] 00:28:03, localpref 100, from10.255.14.174AS path: I> via t1-0/1/0.0200:200:102/96*[RTarget/5] 00:28:15Local[BGP/170] 00:28:03, localpref 100, from10.255.14.174AS path: I> via t1-0/1/0.0200:200:103/96*[RTarget/5] 00:28:15Local[BGP/170] 00:28:03, localpref 100, from10.255.14.174AS path: I> via t1-0/1/0.0200:200:104/96*[BGP/170] 00:28:03, localpref 100, from10.255.14.174AS path: I> via t1-0/1/0.0