cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
21189
Views
10
Helpful
3
Replies

Fundamental BGP "network x.x.x.x" command question

suelange
Level 1
Level 1

I am really confused about a sample BGP config I set up with Dynamips.  I set up 4 routers, all in a straight line so say you have R1 at the top, connected to R2, connected to R3, then finally R4.  Each one obviously shares a common network between himself and his neighbor, and there are no redundanct connections.

So something like this:

R1  Loopback  10.10.1.1 255.255.0.0

R1  S1/0 172.16.1.1 255.255.0.0

R2 S1/0 172.16.1.2  255.255.0.0

R2 s1/1 172.17.1.2  255.255.0.0

R3 S1/0 172.17.1.3 255.255.0.0

R3 S1/1 172.18.1.3 255.255.0.0

R4 S1/0 172.18.1.4 255.255.0.0

Now, R1 BGP config looks like this:

BGP 1001

  Network 10.10.0.0 255.255.0.0

  Network 172.16.0.0 255.255.0.0

  Neighbor 172.16.1.2 remote_as 2001

  Neighbor 172.16.1.2 timers 12 20

no synchronization

bgp log-neighbor-changes

no auto-summary 

Likewise each router has BGP configured and is advertising only the networks it has attached (i.e. the 172.x nets).

How is it then, when I get to R4 and everythign is converged, and I look at the routing table, there is a route for  10.10.0.0 in there, allowing me to ping and trace the loop back on R1?   (similarly R1 contains routes to various 172 networks, allowing it to find R4 interfaces and all those in between).

This indicates a misunderstanding somewhere of what BGP network statment does.  I thought  In internal protocols like OSPF and EIGRP the "network" command basically indicated which interface would participate, and in BGP it indicated which networks to advertise.  So if I don't include 10.10.0.0 in all the BGP configs on each router, how is that path passed along to R4?  Or is it the case that the network command just "adds" to the list of what BGP knows about, and everthing gets passed along (baring filters)...

So confused....

3 Accepted Solutions

Accepted Solutions

Giuseppe Larosa
Hall of Fame
Hall of Fame

Hello Suelange,

the network command for net 10.10/16 on R1 is enough to have it propagated all down to R4 over the eBGP sessions

if you do show ip bgp 10.10.0.0 on R4

you will see something

like

10.10.0.0    via R3 next-hop   1003 1002 1001 i

to be noted with no auto-summary an exact match is needed with the subnet mask configured on the interface to have BGP to advertise

R2,R3 don't need to have a network statement for 10.10/16 to propagate it downstream to R4

Hope to help

Giuseppe

View solution in original post

John Blakley
VIP Alumni
VIP Alumni

In your case, you are advertising the 10.10.0.0/16 network on R1. If all of these are eBGP connections (all different AS), then the other routers will seamlessly pass the route to all of their ebgp neighbors. If all of these routers were in the same AS (iBGP), then R1 would advertise to R2, but R3 and R4 would not have the route unless you had confederations or RR configured.

In short, what you're seeing is normal. When you advertise a route in bgp, all peers will pass the route unless you have route-maps that deny it, filter lists, etc.

HTH,

John

HTH, John *** Please rate all useful posts ***

View solution in original post

The original poster correctly points out a key difference between the Interior routing protocols like OSPF and EIGRP and the Exterior routing protocol of BGP. In the IGPs the network statement only identifies the interfaces to participate and the decision about what to advertise is separate from the network statement.

In BGP the network statement does identify what network prefixes should be advertised. But the original poster has an overly restrictive assumption about how that is implemented. They seem to assume that every router should have a network statement for every network to advertise. But that is impractical for large networks. What they need to understand is that the network statement is only to control what local networks should be advertised. The other part of BGP advertisement is that any route that you learn from an EBGP neighbor will be advertised to any other EBGP neighbor.

So once R1 advertises to R2 then network 10.0.0.0 is advertised to all other External peers without needing any additional network statements.

HTH

Rick

HTH

Rick

View solution in original post

3 Replies 3

Giuseppe Larosa
Hall of Fame
Hall of Fame

Hello Suelange,

the network command for net 10.10/16 on R1 is enough to have it propagated all down to R4 over the eBGP sessions

if you do show ip bgp 10.10.0.0 on R4

you will see something

like

10.10.0.0    via R3 next-hop   1003 1002 1001 i

to be noted with no auto-summary an exact match is needed with the subnet mask configured on the interface to have BGP to advertise

R2,R3 don't need to have a network statement for 10.10/16 to propagate it downstream to R4

Hope to help

Giuseppe

John Blakley
VIP Alumni
VIP Alumni

In your case, you are advertising the 10.10.0.0/16 network on R1. If all of these are eBGP connections (all different AS), then the other routers will seamlessly pass the route to all of their ebgp neighbors. If all of these routers were in the same AS (iBGP), then R1 would advertise to R2, but R3 and R4 would not have the route unless you had confederations or RR configured.

In short, what you're seeing is normal. When you advertise a route in bgp, all peers will pass the route unless you have route-maps that deny it, filter lists, etc.

HTH,

John

HTH, John *** Please rate all useful posts ***

The original poster correctly points out a key difference between the Interior routing protocols like OSPF and EIGRP and the Exterior routing protocol of BGP. In the IGPs the network statement only identifies the interfaces to participate and the decision about what to advertise is separate from the network statement.

In BGP the network statement does identify what network prefixes should be advertised. But the original poster has an overly restrictive assumption about how that is implemented. They seem to assume that every router should have a network statement for every network to advertise. But that is impractical for large networks. What they need to understand is that the network statement is only to control what local networks should be advertised. The other part of BGP advertisement is that any route that you learn from an EBGP neighbor will be advertised to any other EBGP neighbor.

So once R1 advertises to R2 then network 10.0.0.0 is advertised to all other External peers without needing any additional network statements.

HTH

Rick

HTH

Rick