BGP network statements

Answered Question
Jun 25th, 2007

if I have the below config for BGP is the whole 10.1.0.0/16 prefix advertised to bgp enighbours or 10.1.2.0/24 and 10.1.3.0/24 advertised but not 10.1.4.0/24 if its next hop outgoing interface is down i.e. the static route is currently not valid.

Regards

Kev


router bgp 100

bgp router-id 10.1.1.1

bgp log-neighbor-changes

neighbor 10.5.1.1 remote-as 2

!

address-family ipv4

no auto-summary

no synchronization

network 10.1.0.0 mask 255.255.0.0

exit address fam

!

ip route 10.1.2.0 255.255.255.0 10.1.5.1

ip route 10.1.3.0 255.255.255.0 10.1.5.1

ip route 10.1.4.0 255.255.255.0 10.1.5.2

Correct Answer by mohammedmahmoud about 9 years 8 months ago

Hi,


The network command in BGP needs an exact route in the routing table, thus in your example no route will be advertised.


For example:


network 10.1.0.0 mask 255.255.0.0


needs:

ip route 10.1.0.0 255.255.0.0 10.1.5.1



To advertise /24s, you'll need exact network commands and ip routes.


HTH,

Mohammed Mahmoud.

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (1 ratings)
Loading.
Correct Answer
mohammedmahmoud Mon, 06/25/2007 - 04:22

Hi,


The network command in BGP needs an exact route in the routing table, thus in your example no route will be advertised.


For example:


network 10.1.0.0 mask 255.255.0.0


needs:

ip route 10.1.0.0 255.255.0.0 10.1.5.1



To advertise /24s, you'll need exact network commands and ip routes.


HTH,

Mohammed Mahmoud.

kjbarrass Mon, 06/25/2007 - 04:31

thankyou for the fast reply I understand why it works here now we have a route to null0 for 10.1.0.0 then static routes for each subnet.

Regards

Kev

mohammedmahmoud Mon, 06/25/2007 - 04:40

Hi,


You are absolutely correct, having a route for the /16 to null will advertise the /16 as it is /16 no /24 would be advertised, but when packets using the /16 arrives they'll use the more specific static routes to the next hop.



HTH,

Mohammed Mahmoud.

royalblues Mon, 06/25/2007 - 04:33

Friend,


The configuration will not advertise any prefix. BGP requires that exact prefix entries be in the routing table.


In your case, the network statement is advertising 10.1.0.0/16 for which you do not have an exact route in the routing table.

Similarly for advertising 10.1.2.0/24 and 10.1.3.0/24 you should have a corresponding network statement in the BGP configuration or a redistribute static under the BGP


address-family ipv4

no auto-summary

no synchronization

network 10.1.0.0 mask 255.255.0.0

network 10.2.0.0 mask 255.255.0.0

network 10.3.0.0 mask 255.255.0.0


ip route 10.1.0.0 255.255.0.0 10.1.5.1


or

address-family ipv4

no auto-summary

no synchronization

redistribute static


You can check the same using sh ip bgp command


HTH, rate if it does

Narayan


Actions

This Discussion