Showing results for 
Search instead for 
Did you mean: 

Advertising static routes in BGP (MPLS)


I need to add a few static route to an MPLS router running BGP, and I would like these static routes be advertised to the rest of the MPLS Network

The current BGP configs are as follows:

router bgp 64444

no synchronization

bgp router-id

bgp log-neighbor-changes

network mask

network mask

network mask

network mask

network mask

network mask

network mask

timers bgp 15 45

neighbor remote-as 64444

neighbor next-hop-self

neighbor remote-as 13979

neighbor send-community

neighbor route-map AVPN-OUTBOUND out

no auto-summary

What is the best way of doing it?


13 Replies 13

Dan-Ciprian Cicioiu
Rising star
Rising star

Hi ,

Best way is using network command under bgp configuration mode.

router bgp 64444

network $network-ip mask $netmask

replace the $network-ip and $netmask with your case.

The network command should  be the exact match of the static route ( network and netmask  )

Later edit : you will have to check also the route-map that is set on out direction (AVPN-OUTBOUND)

This route-map should permit the new added prefixes.


Thank for the reply Dan.

If I understand what you suggested, that would advertise the Networks out into BGP, but I still to point these networks to a firewall interface since they are behind it.  I would still need the static route, right?

Would it be possible to just add the static routes, and then add “redistribute static” under the BGP session?

Yes , that s correct.

You will add the static route with the next-hop of your connected equipement , in your case firewall , but i think that the best way will still be network command.

Or if you definitely want to go with redistribute static , i suggest that you set a filter to the redistributed routes, in case of some unwanted static routes in the mpls network.


So i can just add static routes, and issue the redistribute static without the need to advertise the Neworks?

Also, this router has iBGP Peer, so I am assuming I need to do the same on the Peer router as well?


Yes you will have to do the same.

Redistribute static , will take all the static routes installed on the routing table and advertised them into BGP ,

The prefixes will be advertised to the eBGP peer if the route-map permits this.

Still i'll go will network cmd.


I think I asked you this before, but If I do go with the Network statements, I still need the actual static route as well, right?


Putting redistribute static will advertise all the static routes to bgp.

Sometimes you do not want all your static routes to advt. in bgp

The best way is to put some control with redistribute static


redistribute static route-map

route-map TEST permit 10
match ip prefix-list LAN-ROUTES

ip prefix-list seq 5 permit x.x.x.x/x   <<

router bgp

Address-family <>

redistribute static route-map TEST



Thanks for your reply Mahesh.

Can you explain what Address-family is?

Also, and in my case, I assume I need to add this to both routers?  There are two routers with iBGP between them



Address-family is used if you are using mpls and you cater customer via. vrf or if you are running ipv6 service

then in that case also you have to create address-family

router bgp

address-family ipv4 vrf

neighbor x.x.x.x remote-as <>

redistribute static route-map TEST

for ipv6 you create something like this

router bgp <>

address-family ipv6



In short if you want your peer configuration other than ipv4 then you need to create address-family.

But in your case i can see there is plain ipv4 service so you can do it like

router bgp

neighbor x.x.x.x remote-as <>

redistribute static route-map TEST

Hope this helps


Hi Dan,


I'm having the same scenario.

I want to advertise static routes with nex hope, so let's say for example I'd like my ISP knows that can be reached via my firewall In this case, if the configuration below accomplishe what I want?


router bgp 65501

     network mask


and under configuration mode:


ip route


With this configuration I don't need the redistribute command right?

In this case, you would not need a redistribution command.
Deepak Kumar
Deepak Kumar,
Don't forget to vote and accept the solution if this comment will help you!

You needn't.

redistribute XOR network
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:

Recognize Your Peers