From 0303b904ad0149cb0cb56d507a6f58f3776827ae Mon Sep 17 00:00:00 2001 From: uvok cheetah Date: Sun, 28 Apr 2024 20:21:36 +0200 Subject: bird: Add function to accept default route hard to do properly with templates. need to do copy/paste anyway. blergh. --- roles/uvok_bird/templates/clearnet.conf.j2 | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'roles/uvok_bird') diff --git a/roles/uvok_bird/templates/clearnet.conf.j2 b/roles/uvok_bird/templates/clearnet.conf.j2 index 2c99411..bb057d1 100644 --- a/roles/uvok_bird/templates/clearnet.conf.j2 +++ b/roles/uvok_bird/templates/clearnet.conf.j2 @@ -55,6 +55,18 @@ define BOGON_PREFIXES = [ ::/0, # Default route ff00::/8+ # RFC 4291 multicast ]; +function is_default_route() -> bool { + case net.type { + NET_IP4: return net = 0.0.0.0/0; + NET_IP6: return net = ::/0; + else: return false; + } +} + +function accept_default_route() { + if is_default_route() then accept; +} + function reject_bogon_asns() int set bogon_asns; { -- cgit v1.2.3