summaryrefslogtreecommitdiff
path: root/roles/uvok_bird/templates
diff options
context:
space:
mode:
authoruvok cheetah2024-04-28 20:21:36 +0200
committeruvok cheetah2024-04-28 20:21:36 +0200
commit0303b904ad0149cb0cb56d507a6f58f3776827ae (patch)
tree4f093fae77fc89f793868f392793e21fb393d3aa /roles/uvok_bird/templates
parent08a6cd50e5360acedc33515fa294b3a12ec240d1 (diff)
bird: Add function to accept default route
hard to do properly with templates. need to do copy/paste anyway. blergh.
Diffstat (limited to 'roles/uvok_bird/templates')
-rw-r--r--roles/uvok_bird/templates/clearnet.conf.j212
1 files changed, 12 insertions, 0 deletions
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;
{