BIRD2 for anycast announcing - Update - Wed, Nov 11, 2020
BIRD2 for anycast announcing IPs
Here is an update to the post from yesterday after we moved to using Equal Cost Multi Pathing. Each server had dual interfaces paired up to the routers, in seperate subnets (like in normal routers). Then we stuck these interfaces in another routing table (number 10 in the Linux OS). Lets say we have a local link subnet with the router as 192.168.100.0/24 on device ens224, with an anycast address at 192.168.250.10, we would run these commands to setup the alternate routing table.
nmcli con mod ens224 ipv4.addresses 192.168.100.3/24 ipv4.method manual ipv6.method ignore ipv4.route-table 10
nmcli con mod ens224 ipv4.routing-rules "priority 100 iif ens224 table 10"
nmcli con mod ens224 +ipv4.routing-rules "priority 110 from 192.168.100.0/24 table 10"
nmcli con mod ens224 +ipv4.routing-rules "priority 120 to 192.168.100.0/24 table 10"
nmcli con mod ens224 +ipv4.routing-rules "priority 130 from 192.168.250.0/24 table 10"
nmcli con mod ens224 +ipv4.routing-rules "priority 140 to 192.168.250.0/24 table 10"
If you down ens224 and the anycast device, then bring them back up, they will show up in another routing table. They wont be inside the ip r output anymore. You would only see them in ip r show table 10.
We also have an updated bird.conf.
log syslog all;
router id <ip address>;
protocol device {
}
protocol bfd {
}
protocol direct {
ipv4;
interface "anycast0";
}
protocol kernel {
learn;
scan time 20;
kernel table 10;
ipv4 {
import none;
export filter {
if proto = "direct1" then reject;
accept;
};
};
merge paths yes limit 5;
}
protocol bgp peer1 {
description "Peer1 Name";
local <source ip> as 65515;
neighbor <uplinkrouter> as 65500;
bfd graceful;
ipv4 {
import all;
export filter {
print "route: ", net, ", ", from, ", ", proto, ", ", bgp_next_hop;
accept;
};
};
graceful restart;
}
protocol bgp peer2 {
description "Peer2 Name";
local <source ip> as 65515;
neighbor <uplinkrouter2> as 65500;
bfd graceful;
ipv4 {
import all;
export filter {
print "route: ", net, ", ", from, ", ", proto, ", ", bgp_next_hop;
accept;
};
};
graceful restart;
}