I have a network setup that looks like this
https://tinyurl.com/ydx8e6db
With Orange being OSPF, and Blue being eBGP.
BGP has a cost of 20, and OSPF 110
I can use a variety of BGP tricks to force traffic from R11 to prefer going via R1 or R2 (local pref, med, ASpath prepend, etc)
The link between R1 and R11 is 1G, the link from R2 to R11 is 100M, so I'd prefer to use the R1 link normally, which means I don't want R2 to advertise a route unless R1 isn't connected - indeed R2 should use OSPF to route via R1.
The problem I get is that both R1 and R2 will route directly to AS65011, and both advertise the route into OSPF.
Is this what is supposed to happen, or is it because I'm not running iBGP between the two border gateways (R1 and R2)?
One option i think would be to change the cost of the BGP on R2 to be higher than OSPF, meaning that if R1 is advertising into OSPF, R2 will see this, and route via OSPF rather than direct.
That doesn't feel right though, feels like a hack. Is there a proper way I'm supposed to do it?
Thanks