Network Requirements
- Set up EBGP neighbors between Device1 and Device2.
- Device1 introduces two direct-connect routes 2001:1::/64 and 2001:2::/64 to BGP in network mode, and set different community properties for two routes that are advertised to Device2.
- When Device2 receives routes from Device1, it applies community properties in the incoming direction of a neighbor to filter route 2001:1::/64 and allow route 2001:2::/64.
Network Topology
![Networking for configuring IPv6 BGP community properties](/storage/images/Document/Maipu/unicast-routing/config-ipv6-bgp-community.jpg)
Figure 13–3 Networking for configuring IPv6 BGP community properties
Configuration Steps
Step 1: Configure the IPv6 global unicast addresses of the interfaces. (Omitted)
Step 2: Configure the IPv6 BGP basic functions.
#Configure Device1.
Device1#configure terminal
Device1(config)#router bgp 100
Device1(config-bgp)#bgp router-id 1.1.1.1
Device1(config-bgp)#address-family ipv6
Device1(config-bgp-af)#neighbor 2001:3::2 remote-as 200
Device1(config-bgp-af)#network 2001:1::/64
Device1(config-bgp-af)#network 2001:2::/64
Device1(config-bgp-af)#exit-address-family
Device1(config-bgp)#exit
|
#Configure Device2.
Device2#configure terminal
Device2(config)#router bgp 200
Device2(config-bgp)#bgp router-id 2.2.2.2
Device2(config-bgp)#address-family ipv6
Device2(config-bgp-af)#neighbor 2001:3::1 remote-as 100
Device2(config-bgp-af)#exit-address-family
Device2(config-bgp)#exit
|
#On Device1, check the IPv6 BGP neighbor status.
Device1#show bgp ipv6 unicast summary
BGP router identifier 1.1.1.1, local AS number 100 BGP table version is 1
1 BGP AS-PATH entries 0 BGP community entries
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
2001:3::2 4 200 3 4 1 0 0 00:01:02 0
Total number of neighbors 1
IPv6 BGP neighbors have been successfully set up between Device1 and Device2.
#Query the route table of Device2.
Device2#show ipv6 route
Codes: C - Connected, L - Local, S - static, R - RIP, B - BGP, i-ISIS
U - Per-user Static route
O - OSPF, OE-OSPF External, M - Management
L ::1/128 [0/0]
via ::, 1w2d:05:45:34, lo0
B 2001:1::/64 [20/0]
via 2001:3::1, 00:01:35, vlan2
B 2001:2::/64 [20/0]
via 2001:3::1, 00:01:35, vlan2
C 2001:3::/64 [0/0]
via ::, 00:04:09, vlan2
L 2001:3::2/128 [0/0]
via ::, 00:04:08, lo0
According to the queried information, Device2 has successfully learnt routes 2001:1::/64 and 2001:2::/64.
Step 3: Configure the ACL and routing policy, and set IPv6 BGP community properties.
#Configure Device1.
Device1(config)#ipv6 access-list extended 7001
Device1(config-v6-list)#permit ipv6 2001:1::/64 any
Device1(config-v6-list)#commit
Device1(config-v6-list)#exit
Device1(config)#ipv6 access-list extended 7002
Device1(config-v6-list)#permit ipv6 2001:2::/64 any
Device1(config-v6-list)#commit
Device1(config-v6-list)#exit
Device1(config)#route-map CommunitySet 10
Device1(config-route-map)#match ipv6 address 7001
Device1(config-route-map)#set community 100:1
Device1(config-route-map)#exit
Device1(config)#route-map CommunitySet 20
Device1(config-route-map)#match ipv6 address 7002
Device1(config-route-map)#set community 100:2
Device1(config-route-map)#exit
|
Set different community properties for routes 2001:1::/64 and 2001:2::/64 respectively by configuring an ACL and routing policy.
Step 4: Configure a routing policy for IPv6 BGP.
#Configure Device1.
Device1(config)#router bgp 100
Device1(config-bgp)#address-family ipv6
Device1(config-bgp-af)#neighbor 2001:3::2 route-map CommunitySet out
Device1(config-bgp-af)#neighbor 2001:3::2 send-community
Device1(config-bgp-af)#exit-address-family
Device1(config-bgp)#exit
|
#View the IPv6 BGP route table of Device2.
Device2#show bgp ipv6 unicast 2001:1::/64
BGP routing table entry for 2001:1::/64
Paths: (1 available, best #1, table Default-IP-Routing-Table)
Not advertised to any peer
100
2001:3::1 (metric 10) from 2001:3::1 (1.1.1.1)
Origin IGP, metric 0, localpref 100, valid, external, best
Community: 100:1
Last update: 00:00:24 ago
Device2#show bgp ipv6 unicast 2001:2::/64
BGP routing table entry for 2001:2::/64
Paths: (1 available, best #1, table Default-IP-Routing-Table)
Not advertised to any peer
100
2001:3::1 (metric 10) from 2001:3::1 (1.1.1.1)
Origin IGP, metric 0, localpref 100, valid, external, best
Community: 100:2
Last update: 00:00:30 ago
According to the IPv6 BGP route table of Device2, the community property of route 2001:1::/64 is set to 100:1, and the community properties of route 2001:2::/64 is set to 100:2.
Step 5: Configure IPv6 BGP route filtration.
#Configure Device2.
Device2(config)#ip community-list 1 permit 100:2
Device2(config)#route-map CommunityFilter
Device2(config-route-map)#match community 1
Device2(config-route-map)#exit
Device2(config)#router bgp 200
Device2(config-bgp)#address-family ipv6
Device2(config-bgp-af)#neighbor 2001:3::1 route-map CommunityFilter in
Device2(config-bgp-af)#exit-address-family
Device2(config-bgp)#exit
|
Step 6: Check the result.
#View the route table of Device2.
Device2#show ipv6 route
Codes: C - Connected, L - Local, S - static, R - RIP, B - BGP, i-ISIS
U - Per-user Static route
O - OSPF, OE-OSPF External, M - Management
L ::1/128 [0/0]
via ::, 1w2d:05:58:57, lo0
B 2001:2::/64 [20/0]
via 2001:3::1, 00:00:05, vlan2
C 2001:3::/64 [0/0]
via ::, 00:17:32, vlan2
L 2001:3::2/128 [0/0]
via ::, 00:17:30, lo0
According to the IPv6 BGP route table of Device2, route 2001:1::/64 has been filtered in the incoming direction, and route 2001:2::/64 has been allowed.
![note](/storage/images/Document/Maipu/note-icon.jpg)
-
After a routing policy is configured on the IPv6 BGP neighbor, the IPv6 BGP must be reset to make the configuration take effect.
- You must configure the send-community command to advertise the community property to the peer.