static null 0 with BGP

I see this command " ip route Null0" after the BGP config with "network mask". I googled around for the static Null0 and I am getting more confused. Can the experts shed some light on this? Thanks
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jan SpringerCommented:
Before a prefix can be picked and announced via BGP, it must first be in the routing table.  I always null route with a distance:

ip route null0 255 (cisco)

ip route null0 distance 255 (brocade)

This is usually because you need to announce a supernet and only its subnets are in your routing table.
leblancAccountingAuthor Commented:
Thanks for the reply.
"Before a prefix can be picked and announced via BGP, it must first be in the routing table" That could be accomplish by any IGP. That does not necessarily why we need the null route. Correct?

I am still confused looking at many different answers including

I just want to know why we need a null static route with BGP and what if I don't use it.
Jan SpringerCommented:
As long as the prefix which you want to announce is in the routing table, then no, you don't need the null route.

If I want stable BGP, I might still null route it with a distance in case the internal route is dropped just to keep my prefixes from withdrawing and announcing causing a possible dampened state.
leblancAccountingAuthor Commented:
" in case the internal route is dropped just to keep my prefixes from withdrawing and announcing" Can you give me an example on this?
In order for BGP to advertise the network, the route for that network needs to be in the routing table. Correct?
So let say I in my BGP process network and and it is in the table with static routes. Then to keep the BGP stable, do I need 2 static null0 statements?

I found some answers that say the null0 is to avoid loop. I don't understand.
Jan SpringerCommented:
The null0 plus distance is to avoid thrashing your prefixes and getting you dampened by your upstreams.

For example:  if your switch is announcing via OSPF the two prefixes up to your BGP speaking router and that switch becomes unreachable, the null0 routes will keep the routes in the routing table until the switch is back on-line causing your BGP neighbor announcements to *not* be withdrawn.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Network Architecture

From novice to tech pro — start learning today.