cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
20622
Views
9
Helpful
13
Replies

Advertising static routes in BGP (MPLS)

msv
Level 1
Level 1

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 10.0.3.1

bgp log-neighbor-changes

network 10.0.3.0 mask 255.255.255.0

network 11.0.0.0 mask 255.255.255.0

network 11.0.1.0 mask 255.255.255.0

network 11.0.2.0 mask 255.255.255.0

network 12.0.0.0 mask 255.255.255.0

network 12.0.1.0 mask 255.255.255.0

network 12.0.2.0 mask 255.255.255.0

timers bgp 15 45

neighbor 10.0.3.2 remote-as 64444

neighbor 10.0.3.2 next-hop-self

neighbor 192.168.10.50 remote-as 13979

neighbor 192.168.10.50 send-community

neighbor 192.168.10.50 route-map AVPN-OUTBOUND out

no auto-summary

What is the best way of doing it?

Thanks

13 Replies 13

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.

Dan

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.

Dan

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?

Thanks

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.

Dan

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?

Hello,

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

like

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

Regards

Mahesh

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

Thanks

Hi,

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

neighbor

redistribute

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

Regards

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 10.10.10.10 can be reached via my firewall 5.5.5.5. In this case, if the configuration below accomplishe what I want?

 

router bgp 65501

     network 10.10.10.0 mask 255.255.255.0

 

and under configuration mode:

 

ip route 10.10.10.0 255.255.255.0 5.5.5.5

 

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

Hi,
In this case, you would not need a redistribution command.
Regards,
Deepak Kumar
Regards,
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:

Review Cisco Networking products for a $25 gift card