cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
990
Views
0
Helpful
6
Replies

BGP network statements

kjbarrass
Level 1
Level 1

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

1 Accepted Solution

Accepted Solutions

mohammedmahmoud
Level 11
Level 11

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.

View solution in original post

6 Replies 6

mohammedmahmoud
Level 11
Level 11

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.

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

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
Level 10
Level 10

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

Mohammed,

Never saw your reply :-)

Narayan

Hi Narayan,

Never mind my friend, this always happens :)

BR,

Mohammed Mahmoud.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Innovations in Cisco Full Stack Observability - A new webinar from Cisco