Alexander, thank you for your feedback.
Here is a diagram:
[ ISP1 ] [ ISP2 ] [ ISP3 ] [ ISP4 ]
| | | |
| | | |
[ Router 1 ] [ Router 2 ]
| |
| |
[ Layer 2 Switch ]
|
|
[ Bird Route Server ]
Router 1 and 2 do not peer directly. There is OSPF running, so all nodes learn a route to other nodes connected interfaces.
Both routers peer to route-server and are route reflection clients.
There is a route x.y.z.0/24 coming from from each ISP. Router 1 chooses ISP2 (because of as-path), what path Router 2 is choosing doesn't matter.
I need to force traffic to x.y.z.0/24 via ISP1.
In order to do that, I'm matching the route x.y.z.0/24 in the import filter on the route-server (maching a route itself and also ISP1 ASN in the path) and setting the local preference to 150.
Then this route is re-advertised to Router 2, which will select it as best, because of iBGP and high local-preference. The route is not announced back to Router 1, because it came from there.
An alternative way, to do that is to mach a route on Router 1, increase a local-pref there and that route will be leared by router 2 through the route-server. But I'd like to do that on route-server to use a centralized place for these kinds of things.
Here is a show route output from a route server:
bird> show route for x.y.z.0/24 all
x.y.z.0/24 via 10.1.1.65 on em2 [edge_r1 18:25:09] * (100/11) [AS123i]
Type: BGP unicast univ
BGP.origin: IGP
BGP.as_path: 111 888 333 999
BGP.next_hop: 1.1.1.1
BGP.med: 0
BGP.local_pref: 150
via 10.1.1.65 on em2 [edge_r1 2019-01-17] (100/11) [AS123i]
Type: BGP unicast univ
BGP.origin: IGP
BGP.as_path: 222 777 999
BGP.next_hop: 2.2.2.2
BGP.med: 0
BGP.local_pref: 100
via 10.1.1.66 on em2 [edge_r2 2019-01-16] (100/11) [AS123i]
Type: BGP unicast univ
BGP.origin: IGP
BGP.as_path: 333 666 999
BGP.next_hop: 3.3.3.3
BGP.med: 0
BGP.local_pref: 100
via 10.1.1.67 on em2 [edge_r2 2019-01-17] (100/11) [AS123i]
Type: BGP unicast univ
BGP.origin: IGP
BGP.as_path: 444 555 999
BGP.next_hop: 4.4.4.4
BGP.med: 0
BGP.local_pref: 100
bird>