Above is the simple topology based on which I have the scenario which I would like to resolve:
1. BGP running between routers
2. Networks behind each ISP can transit into each other using DC1 and DC2.
3. Site 1 - has TPG IPVPN connection
4. Site - has OPTUS IPVPN connection.
Issue: Site 1 when reaching Site 2 uses the path : Site1->TPG Core->DC2->OPTUS Core->Site 2
Reason: The AS Path via DC2 is lower.
I want the preferred path to be Site1-TPG Core -> DC1 OPTUS Core -> Site 2
DC2 only to be used as transit if transit via DC1 is not available.
Note: We have control of the CEs.
Is there any possible configuration that can be applied to the CE routers at the DC that can help achieve the preferred transit to be DC1.
If you have control of OPTUS CORE (Site 1) and TPG CORE (Site 2), you can play with BGP attributes to choose which path to take. As of now, Site 1 -> Site 2 traffic goes through DC2 because of shorter AS-path (as you mentioned). If you want to change the path so that Site 1 -> Site 2 traffic passes through DC1, change local preference on TPG CORE for Site 2 paths learned through DC1 to a higher value. You will need to do the same on OPTUS CORE.
You mention CE rtrs so I am assuming this is a MPLS l3 vpn topology as such I would expect there to be MP-BGP between the core rtrs which would be your PE rtrs and in that case your CE rtr would just be peering with their related PE rtr (single peer) if this is correct I am not so sure you have any control on this TBH - Can you confirm?
TBH I cannot think of a way how you would be able personally manipulate the mpls path with a single CE peering, maybe others on this forum could assist.
In fact I have come to the same conclusion that its not possible to control the preferred path for site with single connection when going from Site 1 to Site 2.
The default path is being decided by the BGP using the lower AS-Path.
I guess I will just have to go with that for now unless someone here knows otherwise.