Background and goal
Am setting up high availability DNS servers based on Unbound. Both DNS servers has in reality twelve BGP sessions against different routers but to make this easier only one router is showed below.
Both DNS servers are configured with the same two addresses on localhost (10.100.0.1
, 10.100.0.2
) and they both advertise these addresses with BGP. Problem is that if the DNS server that is preferred by other routers hangs, there is a timeout before BGP switches over to the second DNS server for both addresses. My goal is to have each DNS server have a primary responsibility for one of these two addresses so DNS clients do not have to wait for BGP timeout but instead handle failover as they know best. I do not want to add configurations to other routers, only on the DNS servers.
+------------+
| |
+---+ Router 1 +---+
| | | |
| +------------+ |
| |
+-----+----+ +----+-----+
| | | |
| DNS 1 | | DNS 2 |
| | | |
+----------+ +----------+
(primary) 10.100.0.1 10.100.0.1
10.100.0.2 10.100.0.2 (primary)
Problem and question
In the configuration below, how can I make DNS 1 announce 10.100.0.1
with a higher local preference so other routers choose this server instead of DNS 2 that is also announcing this IP but with lower priority?
router bgp 65002
bgp router-id 10.0.0.1
bgp confederation identifier 42xxx
bgp confederation peers 65001 65002
network 10.100.0.1/32
network 10.100.0.2/32
neighbor 10.0.0.10 remote-as 65001
neighbor 10.0.0.10 route-map only-local-ASes out
!
ip as-path access-list only-local-ASes permit ^$
!
route-map only-local-ASes permit 10
match as-path only-local-ASes
Should I create a route-map that adds local preference 200 for only matched prefix 10.100.0.1? Problem am having is that this makes the router only announce 10.100.0.1 prefix and not both (also 10.100.0.2) at the same time with different preference.
Software
Linux kernel 4.4.0
Ubuntu 16.04 server
Quagga 0.99.24.1