12-22-2010 09:59 AM - edited 03-04-2019 10:52 AM
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
12-22-2010 10:04 AM
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
12-22-2010 10:11 AM
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?
12-22-2010 10:17 AM
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
12-22-2010 10:47 AM
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
12-22-2010 11:12 AM
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
12-22-2010 11:26 AM
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?
12-22-2010 11:33 AM
Yes
12-22-2010 07:24 PM
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
12-22-2010 10:45 PM
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
12-22-2010 11:33 PM
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
11-12-2018 04:02 PM
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?
11-12-2018 06:01 PM
11-13-2018 02:23 AM
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide