I have a carrier's MPLS network with multiple CE's each with their own OSPF areas (non area 0) on LAN side. I also plan on running BGP from the CE's to the MPLS PE's to share routing info across WAN. I need to ensure reachability amongst all OSPF areas (interconnected via MPLS).
I want to let OSPF learn routes dynamically on the CE and redistribute these routes into BGP rather than "hard coding" defined routes via the BGP "networks" statement to advertise (if I can help it) - that way I can let OSPF take care of any routes automatically without changing BGP setting on the CE (managed by a telco) each time a route needs to be added on the LAN side. However I am mindful of mutual/2-way redistribution issues and needing to filter routes learnt dynamically from OSPF being redistributed back into OSPF from BGP the other way. My query is if there is a way to filter such routes that were learnt dynamically originally from OSPF from re-entering OSPF again? Or does this need explicit definition in a distribute list say?
Otherwise, what's the best way to achieve this bearing in mind potential mutual redistribution issues?
Is the best way to use BGP "networks" command on the local CE to explicitly advertise routes into MPLS then use distribute lists to filter/prevent these networks from re-entering OSPF again due to BGP to OSPF redistribution when coming back the other way? Also, I guess under this method, OSPF on the CE would learn the routes set by the BGP "networks" statements automatically (and therefore we won't need to explicitly redistribute BGP into OSPF and thus keep redistributing one way which is better practice)?
Hope it makes sense!! :)