bird: gateway recursive on BGP protocols
Build flock Image / build (push) Has been cancelled

Default is `gateway direct` — BIRD silently rejects kernel routes whose
via address isn't on a directly-connected network interface. Our anycast
host routes use a pod /128 (or /32) as via, which is itself a kernel
route on a flock veth, not a connected network. With `gateway
recursive`, BIRD does a recursive lookup and accepts the kernel route.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Donavan Fritz
2026-04-25 08:09:00 -05:00
parent 2082df37e5
commit 7ac497249f
+7
View File
@@ -64,6 +64,11 @@ protocol kernel kernel4 {
}; };
} }
# gateway recursive is set per BGP protocol below — it controls how
# BIRD resolves a route's next-hop when the gateway isn't on a directly
# connected interface (our case: anycast routes use the pod's /128 eth0
# IP as via, which is itself a host route, not a network).
protocol static static6 { protocol static static6 {
ipv6; ipv6;
{{range $cidr := .CIDR6}}route {{$cidr}} blackhole; {{range $cidr := .CIDR6}}route {{$cidr}} blackhole;
@@ -79,6 +84,7 @@ protocol bgp upstream6_{{$i}} {
local{{if $.LocalV6}} {{$.LocalV6}}{{end}} as {{$.LocalASN}}; local{{if $.LocalV6}} {{$.LocalV6}}{{end}} as {{$.LocalASN}};
neighbor {{$p.Address}} as {{$p.ASN}}; neighbor {{$p.Address}} as {{$p.ASN}};
graceful restart; graceful restart;
gateway recursive;
ipv6 { ipv6 {
import all; import all;
next hop self; next hop self;
@@ -94,6 +100,7 @@ protocol bgp upstream4_{{$i}} {
local{{if $.LocalV4}} {{$.LocalV4}}{{end}} as {{$.LocalASN}}; local{{if $.LocalV4}} {{$.LocalV4}}{{end}} as {{$.LocalASN}};
neighbor {{$p.Address}} as {{$p.ASN}}; neighbor {{$p.Address}} as {{$p.ASN}};
graceful restart; graceful restart;
gateway recursive;
ipv4 { ipv4 {
import all; import all;
next hop self; next hop self;