What is the rule when two routing protocols (ex. BGP, OSPF) are running on a router and they both learn about the same route?
The route learned from BGP is inserted into the routing table since it has a lower admin distance. Will the route learned from OSPF (to the same network as the route learned from BGP) still forward this route to it's neighbor even though it is not in the routing table?
With a slight clarification it will be easier to answer your question. OSPF advertises LSAs and not routes. So whether the route in the routing table came from OSPF or from BGP, yes OSPF will advertise the LSA (from which the route is derived) to its neighbors.
It is an important principle that all OSPF devices within an area must have the same understanding of the topology of the network. So it is important that all OSPF routers within the area all receive exactly the same LSAs. This is true whether the LSA corresponds to a route in the routing table or not.
OSPF speaking routers do not exchange routes as such, they exchange LSA (Link state advertisements) between each other. So it does not matter that the OSPF route is not in the routing table the LSA's will still be exchanged between OSPF routers.
Thanks for the replies. Obviously I have limited OSPF knowledge. Should the networks be listed in the OSPF database?
My situation is this:
I have a backup WAN router connected to two service providers. OSPF is running across one and BGP another. My remote sites are connected the same way (one router two providers, BGP, OSPF).
The WAN router locally is running OSPF to the core.
The wan router learns about the same networks from OSPF and BGP. The routing table uses the routes from BGP.
The OSPF database on the wan router shows these networks. My core, however does not have the OSPF networks in its database.
As already mentioned, it is the link state database that is maintained by all routers in OSPF process. The rule says that database has to be synchronised on all routers participating in ospf process. So if the route is there on one of the router in ospf, it should be synchronised among all other routes to have a similar database.
In case of OSPF routes, the order of preference is:
External route type 1 (E1)
External route type 2 (E2)
But in your case, IF same route is learnt by OSPF & BGP then BGP wins by AD.
So then are you saying that the route will not be syncronized (through the LSA's) if it is not in the routing table (since the route was learned from BGP)?
I do not believe that is what the previous post is saying. If a router running OSPF generates an LSA for some prefix, then that LSA if propagated to all OSPF routers within the area and the Link State Data Base is synchronized for that prefix regardless of whether it appears in the local routing table from some other protocol or not.
Sorry, I guess I'm confused.
So, in my case, BGP wins on the WAN router by AD. Are you saying that the newtork should still be in the OSPF database on all routers within the same area?
Ok, so that's the problem. The network is NOT in the database on all the routers. It is only on the WAN router and stops there.
I looked closer at the config of the WAN router. Area 0 is setup between the WAN router and the provider. Area 1 is setup between the WAN router and the 2 Core's. The networks are learned via OSPF on the WAN router from the provider - Area 0.
These networks were in the OSPF database on the cores before BGP was enabled on the WAN router.