DSCP policy based routing?

Say I want to have different routing for some DSCP value(s) so the chosen path depends on the DSCP (not just a single hop but the entire network).
Currently routing is using eBGP with some routing filters that tweak the local-pref based on community values to prefer some paths.
I would need a second set of routing filters with different local-pref tweaks.

Would the following be feasible:

  • have two distinct BGP instances (say “default” and “lowcost”) with exactly the same AS#, router ID, but different Routing Table (“main” and “lowcost”).
  • for all peers have two peer entries, one for each of the two BGP instances, with same Remote Address, Remote AS, but different In-Filter.
  • in the mangle table set some routing mark depending on DSCP to select the second (“lowcost”) routing table when appropriate.

Would that work? Or would the two BGP instances interfere and would I need to have a completely separate set of local AS, remote address,
remote AS, etc to keep those two BGP instances separate? Anyone with experience doing this?
(the two routing tables each should represent a network-wide convergence according to different filters)

Or is there another way of achieving this objective?

It sounds to me like it ought to work, but I would recommend setting up a test lab in GNS3 or something similar to be sure.

Of course I know I can setup a test, but it would be nice to hear “yes that is OK I use that all the time” or “that is definitely not going to work I tried that” before I spend a lot of effort. I’m not sure if there would be anything that separates the two BGP instances when AS numbers and link addresses are the same on each side, and frankly I would abandon the entire idea when it turns out we would need to assign multiple AS numbers and/or multiple link addresses to each router.