I have a subnet 192.168.1.x/24 which is in AS : 64512. Find below the network topology :
( AS :64512 ) ----------------------- ( ISP AS : XXXX) -----------------------(AS:64513)
Branch 1 | Branch 2
| ( AS : 64514)
|__ OSPF______________ Head Office 3
There is a backup link running ospf which carries 192.168.1.x/24. Normally the traffic flows via ISP. When the ISP link goes down we normally advertise this subnet ( of AS 64512) from Branch 3 ( AS 64514) for rechability from AS 64513.
Is it possible to do AS path prepend from AS 64514 for this subnet instead of manually advertising in BGP?
I have another option where I can do conditional advertising but not sure if the subnet list is long enough then it will work.
Is there any reason prevents you from redistributing from
OSPF into BGP & BGP into OSPF. at AS 64514?
Or if redistribution is not an option, you could have static route pointing to null 0 with Higer AD value than the OSPF in order not to drop the traffic, but you will have also to advertise The network in AS:64513 to AS: 64512 through IBGP or normal bgp to ospf redistribution in order for the return traffic to pass successfuly.
At this point, I dont see any reason for having conditional advertisment configured, as routing decision is handled by AS 64512 and the ISP has a single path to AS 64513. and the outgoing and return traffic is alwways going to prefer the EBGP link over the OSPF.
static route to null0 is not needed and would create problems (a routing black hole !)
BGP network command can be used to advertise a route learned by OSPF.
>> The route is showing to be advertised to the ISP peer but unavailable any other branches.
This can mean two different things:
a) ISP does not accept prepended routes on the eBGP session. check with them
b) ISP PE accepts the route but the route is not visible until primary route fails.
The second is more probable.
if this is a L3 MPLS VPN each CE router peers with the directly connected PE,
PE connected to Branch2 advertises only best path that is the advertisement coming from Branch1 CE.
To verify if this is true you should shut the Link branch1 to ISP and to wait some time to see if a different BGP route appears at Branch2 CE router.
That is the route can be seen only when primary route disappears.
I would expect this.
Hope to help