I currently have a router that is receiving 400+ eBGP routes from our parent company and none of them are summarized. I would like to take a summary of these routes and advertise them on my OSPF process on the same router. What is the best way to accomplish this as I have looked at several different ways to do this, but I know there is always that 1 best way to do it. If you need further clarification, please just ask. Thanks for your assistance!!
I am not sure - are you asking about how to summarize distinct IP ranges, or are you asking how to technically perform the summarization in the best way when redistributing these networks from eBGP to OSPF?
I really don't want to distribute these routes into OSPF. What I would like to do is setup
advertising from OSPF 1 (running on this router as well as BGP) for a summary list that I have for all the routes
that I am learning from my eBGP neighbor. Since none of the interfaces on this router are setup for any of these networks, I just can't add network statements in there to advertise to OSPF. However, I was thinking about setting setting up null routes for all the summary networks and then redistribute static route-map to make sure that I only redistribute the summary networks into OSPF and not any other networks that exist through static means. However, if there was a way to take all the BGP routes and put them in a filter and redistribute the summary networks from that filter, that would be good too. Just thinking of the best way to accomplish this as there are many ways to do this. Thanks!!
First a word of caution: Always be careful with redistribution.
What you need to be sure of first is how the current redistribution between OSPF and BGP is set up.
Before you realize it, you might be importing routes back into bgp and cause big trouble.
A relatively safe way to advertise summarized routes in OSPF is as below:
router ospf 1
no auto-summary << don't let ospf summarize to classfull networks.
redistribute static metric 130 << you will redistribute the summary as a static route. please use a relatively high metric.
network 10.1.1.0 0.0.0.255 area 0 (this is the network where ospf is active, i.e. your lan)
ip route 18.104.22.168 255.0.0.0 Null0 << this summarized route will be advertized via ospf.
No direct redistribution from BGP into OSPF.
YOU create the summary routes by means of static routes to null0.
If you have other static routes in place, you must filter them out by means of a route map or distribute list.
Note: Always test this kind of config in a simulator (GNS3) before putting it into production.
Thanks for the reply Leo. I do have a route-map to filter out the static routes I don't want to redistribute. For the metric 130, I don't have any other means of getting to these networks except via this circuit that I am learning these routes, and since I have static routes right now for them, what is the benefit of using 130 and not keeping the static metric and just use default or just 1?
Here's what I have so far:
ip route 172.16.32.0 255.255.224.0 null 0
ip route 172.17.64.0 255.255.192.0 null 0
ip route 172.17.128.0 255.255.192.0 null 0
ip route 172.17.192.0 255.255.192.0 null 0
ip route 172.18.0.0 255.255.128.0 null 0
ip route 172.18.128.0 255.255.224.0 null 0
ip route 172.18.224.0 255.255.224.0 null 0
ip route 172.22.0.0 255.255.0.0 null 0
ip route 172.29.0.0 255.255.0.0 null 0
ip route 172.31.0.0 255.255.0.0 null 0
ip prefix-list OSPF_Redist seq 10 permit 172.16.32.0/19
ip prefix-list OSPF_Redist seq 20 permit 172.17.64.0/18
ip prefix-list OSPF_Redist seq 30 permit 172.17.128.0/18
ip prefix-list OSPF_Redist seq 40 permit 172.17.192.0/18
ip prefix-list OSPF_Redist seq 50 permit 172.18.0.0/17
ip prefix-list OSPF_Redist seq 60 permit 172.18.128.0/19
ip prefix-list OSPF_Redist seq 70 permit 172.18.224.0/19
ip prefix-list OSPF_Redist seq 80 permit 172.22.0.0/16
ip prefix-list OSPF_Redist seq 90 permit 172.29.0.0/16
ip prefix-list OSPF_Redist seq 100 permit 172.31.0.0/16
ip prefix-list OSPF_Redist seq 110 deny 0.0.0.0/0 le 32
route-map STATIC_OSPF permit 10
match ip add prefix-list OSPF_Redist
router ospf 1
redistribute static route-map STATIC_OSPF
I did put in these 400+ routes in GNS3. I setup a eBGP neighborship b/t 2 routers and this appears to work fine. My goal is to make sure that what I doing is the best and recommended way of approaching this situation. Thanks so far for everyone's contribution.