I guess a picture may help. In the attached drawing everything is peered via BGP from each of the core networks. The blue areas are all connected via OSPF. The OSPF routes are being export into the BGP and the advertised to the Internet. Currently if the connection between Network Core 1 and the Internet goes down traffic is rerouted through the Network Core 2 router and the Internet since the routes from the attached networks of Network Core 1 are also being advertised there. If the connection to Network Core 1 then comes back on line the traffic will continue to travel through Network Core 2 because the weight for the Network Core 1 route has the same weight whether they are going the Core1 or Core2. I need the routes from the attached networks to go through Network Core 1 when that connection comes back up.
How can I do a BGP AS prepend based on the source of the OSPF route?