4

enter image description here

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
1
  • Can you post your full configs? And full a 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
    – nzspambot
    Aug 4, 2014 at 0:39

1 Answer 1

6

Because you are telling R2 to originate the route. Upon origination the weight is set to 32768 as you can see, which beats the route from R1 which has a weight of 0. This allows R2 to advertise it back to R1 as it is R2's bestpath. If you remove the network statement on R2 it will receive the route as a BGP route via R1 only.

Check out the bestpath selection procedure for more info http://www.cisco.com/c/en/us/support/docs/ip/border-gateway-protocol-bgp/13753-25.html

2
  • ok I got it u saying cause I have utilized Network 1.1.1.0/24 command on R2, R2 looks at its routing table and realize it got route to 1.1.1.0/24 so that generates the route itself and advertise it back to R1 but why it is using itself as next hop "10.1.12.1 from 0.0.0.0 (2.2.2.2)" I mean it's not advertise the route back to R1 just with the next-hop set to R1's address?
    – user7741
    Aug 4, 2014 at 16:42
  • Again, due to the fact that R2 is originating the route so the nexthop will be itself. The IGP nexthop doesn't affect the BGP nexthop
    – Guest
    Aug 6, 2014 at 11:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.