IPv6 BGP synchronization
November 21, 2012 1 Comment
If you have been dealing with BGP under IOS < 12.0, you know something about BGP synchronization.
This post is driven by three reasons…nostalgia is not one of them : )
- BGP synchronization illustrates the difference of BGP with the traditional concept of interior routing protocols like OSPF, RIP or EIGRP.
- With ever-growing transition to IPv6, I wanted to test the concept of synchronization with IPv6.
- You need to work out your brain muscles and be ready to deal with anything in the CCIE exam where your problem-solving skills will be tested more than your knowledge of best practices.
So let’s brush up our knowledge of the concept with a brief definition of BGP:
BGP is used to advertise NLRI (Network Layer reachability information) between ASs (Autonomous Systems) and it relies on TCP (179) for reliability of the communications. BGP is an attribute-based path-vector protocol.
BGP synchronization states that, if your autonomous system passes traffic from another AS to a third AS (transit), eBGP speaker should not advertise a route before all the routers in your AS have learned about the NLRI via IGP. So BGP will wait until IGP has propagated the route within the AS.
If not done properly, the transit AS will turn into a route black hole.
Here is a small animation illustrating the concept:
Animation
The solution is mutual redistribution of routes between BGP and the IGP.
Nowadays, BGP is running on all routers in autonomous system transit paths, so synchronization is disabled by default.
This allows you to carry fewer routes in your IGP and allow BGP to converge more quickly.
IPv6 configuration
Topology
Router R1:
Redistribution from OSPF TO BGP
router bgp 65012 address-family ipv6 unicastredistribute ospf 125!route-map RM6_OSPF_TO_BGP match external 2route-map RM6_OSPF_TO_BGP
permit 10 match ipv6 address ACL6_OSPF_TO_BGP
!
ipv6 access-list ACL6_OSPF_TO_BGP
permit ipv6 2001:db8:209::/64 any log
permit ipv6 2001:db8:23::/64 any log
Redistribution from BGP to OSPF
route-map RM6_BGP_TO_OSPF permit 10 match ip address ACL6_BGP_TO_OSPF ! ip access-list standard ACL6_BGP_TO_OSPF permit ipv6 2001:db8:14::/64 any log ! ipv6 router ospf 125redistribute bgp 65012 subnets route-map RM6_BGP_TO_OSPF
Redistribution from BGP to OSPF
R1# sh ipv6 route IPv6 Routing Table - 8 entries … C 2001:DB8:14::/64 [0/0] via ::, FastEthernet0/1 L 2001:DB8:14::1/128 [0/0] via ::, FastEthernet0/1 C 2001:DB8:15::/64 [0/0] via ::, FastEthernet0/0 L 2001:DB8:15::1/128 [0/0] via ::, FastEthernet0/0 O 2001:DB8:25::/64 [110/20] via FE80::15:5, FastEthernet0/0 B 2001:DB8:40::/64 [20/0] via FE80::14:4, FastEthernet0/1OE2 2001:DB8:209::/64 [110/1] via FE80::15:5, FastEthernet0/0L FF00::/8 [0/0] via ::, Null0
R1#
R2:
Redistribution from BGP to OSPF
route-map RM6_BGP_TO_OSPF permit 10 match ipv6 address ACL6_BGP_TO_OSPF ! ipv6 access-list ACL6_BGP_TO_OSPF permit 2001:db8:209::/64 any log permit 2001:db8:23::/64 any log ! ipv6 router ospf 125redistribute bgp 65012 route-map RM6_BGP_TO_OSPF
Redistribution from OSPF to BGP
router bgp 65012 address-family ipv6 unicastredistribute ospf 125 route-map RM6_OSPF_TO_BGP match external 2route-map RM6_OSPF_TO_BGP permit 10 match ipv6 address ACL6_OSPF_TO_BGP ! ipv6 access-list ACL6_OSPF_TO_BGP permit 2001:db8:14::/64 any log
The presence of prefix 2001:DB8:40::/64 originated in AS 65040 (iBGP administrative distance = 200) in the IGP table (OSPFv3 administrative distance =110) means that the core IGP has synchronized the prefix.
R2#sh bgp ipv6 unicast 2001:DB8:40::/64 BGP routing table entry for 2001:DB8:40::/64, version 4 Paths: (2 available, best #1, table Global-IPv6-Table) Advertised to update-groups: 1 2 Local :: from 0.0.0.0 (2.2.2.23) Origin incomplete, metric 1, localpref 100, weight 32768, valid, sourced, best 65040 2001:DB8:15::1 (metric 20) from 2001:DB8:15::1 (1.1.1.14) Origin IGP, metric 0, localpref 100, valid, internal,synchronizedR2# R2# sh ipv6 route IPv6 Routing Table - 8 entries … O 2001:DB8:15::/64 [110/20] via FE80::25:5, FastEthernet0/0 C 2001:DB8:23::/64 [0/0] via ::, FastEthernet0/1 L 2001:DB8:23::2/128 [0/0] via ::, FastEthernet0/1 C 2001:DB8:25::/64 [0/0] via ::, FastEthernet0/0 L 2001:DB8:25::2/128 [0/0] via ::, FastEthernet0/0OE2 2001:DB8:40::/64 [110/1]via FE80::25:5, FastEthernet0/0 B 2001:DB8:209::/64 [20/0] via FE80::23:3, FastEthernet0/1 L FF00::/8 [0/0] via ::, Null0 R2#
From R5 core IGP router you can notice that OSPFv3 is synchronized with transit route prefixes from AS 64030 and AS 64040.
R5:
R5#sh ipv6 route IPv6 Routing Table - 7 entries … C 2001:DB8:15::/64 [0/0] via ::, FastEthernet0/0 L 2001:DB8:15::5/128 [0/0] via ::, FastEthernet0/0 C 2001:DB8:25::/64 [0/0] via ::, FastEthernet0/1 L 2001:DB8:25::5/128 [0/0] via ::, FastEthernet0/1OE2 2001:DB8:40::/64 [110/1] via FE80::15:1, FastEthernet0/0 OE2 2001:DB8:209::/64 [110/1] via FE80::25:2, FastEthernet0/1L FF00::/8 [0/0] via ::, Null0 R5#
Offline lab
With the offline lab you will have an idea about the network behavior its states in different test cases.
An extensive range of commands is provided. Both IPv6 and IPv4 BGP synchronization are configured in the offline lab.
I hope you will find it useful. Suggestions and critics are welcome.