# Summary
**BGP synchronisation** forces the bgp process to accept a prefix received from a ibgp peer only if an igp already installed a route for the same prefix in the routing table.
# Basic Topology

:
# Issue
## Without redistribution of BGP inside IGP
When the topology is stable, the routes to reach the Loopbacks of R1, R2, R4 and R5 are exchanged using the BGP peerings.
* R5 knows the route to reach the loopback of R1 (using R4 as next hop)
* R4 know the route to reach the loopback of R1 using either:
* the loopback of R2 as it next hop if the iBGP is configure with ``next-hop-self``
* this next-hop is learn through igp
* R1 as its next hop if the iBGP doesnt use ``next-hop-self``
* this next-hop may not be reachable , depending on the configuraiton of the IGP
* R3 misses all the routes for the other 4 loopbacks (R1, R2, R3 and R4)
* traffic is blackholed
* R2 know the route to reach the loopback of R1 (using R1 as next hop)
### With synchronisation off(default)
R4#sh ip bgp 1.1.1.1
BGP routing table entry for 1.1.1.1/32, version 2
Paths: (1 available, best #1, table default)
Advertised to update-groups:
8
Refresh Epoch 1
65001
2.2.2.2 (metric 21) from 2.2.2.2 (2.2.2.2)
Origin IGP, metric 0, localpref 100, valid, internal, best
rx pathid: 0, tx pathid: 0x0
R4#sh ip route 1.1.1.1
Routing entry for 1.1.1.1/32
Known via "bgp 65234", distance 200, metric 0
Tag 65001, type internal
Last update from 2.2.2.2 00:00:12 ago
Routing Descriptor Blocks:
* 2.2.2.2, from 2.2.2.2, 00:00:12 ago
Route metric is 0, traffic share count is 1
AS Hops 1
Route tag 65001
MPLS label: none
### With synchronisation on
R4#sh ip bgp 1.1.1.1
BGP routing table entry for 1.1.1.1/32, version 0
Paths: (1 available, no best path)
Flag: 0x820
Not advertised to any peer
Refresh Epoch 1
65001
2.2.2.2 (metric 21) from 2.2.2.2 (2.2.2.2)
Origin IGP, metric 0, localpref 100, valid, internal, **not synchronized**
rx pathid: 0, tx pathid: 0
R4#sh ip route 1.1.1.1
% Network not in table
## Reinjecting the BGP routes inside the IGP.
If we reinject the route to 1.1.1.1 inside de OSPF area 0, R4 learns the route to reach it.
R4#sh ip route 1.1.1.1
Routing entry for 1.1.1.1/32
Known via "ospf 1", distance 110, metric 1
Tag 65001, type extern 2, forward metric 30
Last update from 192.168.34.3 on Ethernet0/1, 00:10:18 ago
Routing Descriptor Blocks:
* 192.168.34.3, from 2.2.2.2, 00:10:18 ago, via Ethernet0/1
Route metric is 1, traffic share count is 1
Route tag 65001
And we can see that the prefix is now accepted by the BGP process and marked as **synchronized, best**
R4#sh ip bgp 1.1.1.1
BGP routing table entry for 1.1.1.1/32, version 2
Paths: (1 available, best #1, table default, RIB-failure(17))
Advertised to update-groups:
10
Refresh Epoch 1
65001
2.2.2.2 (metric 21) from 2.2.2.2 (2.2.2.2)
Origin IGP, metric 0, localpref 100, valid, internal, synchronized, best
rx pathid: 0, tx pathid: 0x0