In diagram above R1 has got a loopback with 1.1.1.1/24 ip address, both R1 and R2 advertise out this network 1.1.1.0/24 to other AS using this router bgp
network
config: network 1.1.1.0 mask 255.255.255.0
R1 and R2 are iBGP peers
R1 is peer with R3 in AS 200
R2 is peer with R4 in As 200
The problem is R2 advertises 1.1.1.0/24 as this:
* i1.1.1.0/24 10.1.12.1 0 100 0 i
*> 10.1.12.1 11 32768 i
R2# sh ip bgp 1.1.1.0 255.255.255.0
BGP routing table entry for 1.1.1.0/24, version 9
Paths: (2 available, best #2, table Default-IP-Routing-Table)
Advertised to update-groups:
1 2
Local
10.1.12.1 from 10.1.12.1 (1.1.1.1)
Origin IGP, metric 0, localpref 100, valid, internal
Local
10.1.12.1 from 0.0.0.0 (2.2.2.2)
Origin IGP, metric 11, localpref 100, weight 32768, valid, sourced, local, best
It sees itself as the nexthop and uses that as best route:
Local
10.1.12.1 from 0.0.0.0 (2.2.2.2)
Origin IGP, metric 11, localpref 100, weight 32768, valid, sourced, local, best
So why is this happening? Why does R2 advertise 1.1.1.0/24 back to R1? Why should R2 do that?
The same outputs from R1 in the case you need to check them out:
*> 1.1.1.0/24 0.0.0.0 0 32768 i
* i 10.1.12.2 11 100 0 i
R1#sh ip bgp 1.1.1.0 255.255.255.0
BGP routing table entry for 1.1.1.0/24, version 11
Paths: (2 available, best #1, table Default-IP-Routing-Table)
Advertised to update-groups:
1 2
Local
0.0.0.0 from 0.0.0.0 (1.1.1.1)
Origin IGP, metric 0, localpref 100, weight 32768, valid, sourced, local, best
Local
10.1.12.2 from 10.1.12.2 (2.2.2.2)
Origin IGP, metric 11, localpref 100, valid, internal
sh ip route
It looks like it is coming from your IGP (100 = IGRP) Ideally you would: 1. setup your Lo interfaces 2. announce your Lo into your IGP 3. run iBGP between your Lo's 4. advertise any subnets into your iBGP 5. set nexthop self if needed as well