summaryrefslogtreecommitdiff
path: root/roles/uvok_bird/templates
diff options
context:
space:
mode:
authoruvok cheetah2024-06-25 18:43:58 +0200
committeruvok cheetah2024-06-25 18:43:58 +0200
commit3690ccbe4a7eb6b4e79591b07905813112fe9d49 (patch)
treeedc19372daebab8dcdbaaa5a5899e89478f9d93c /roles/uvok_bird/templates
parent8221d0341c45a1cc7db978256e3574a215b85dcf (diff)
bird: Fixup default route selection
Diffstat (limited to 'roles/uvok_bird/templates')
-rw-r--r--roles/uvok_bird/templates/clearnet.conf.j216
1 files changed, 14 insertions, 2 deletions
diff --git a/roles/uvok_bird/templates/clearnet.conf.j2 b/roles/uvok_bird/templates/clearnet.conf.j2
index ff6674b..87ae8d8 100644
--- a/roles/uvok_bird/templates/clearnet.conf.j2
+++ b/roles/uvok_bird/templates/clearnet.conf.j2
@@ -29,6 +29,7 @@ protocol static myprefix {
protocol static default6 {
route ::/0 reject;
ipv6 {
+ preference 10;
table t_myas_trs;
import all;
export none;
@@ -99,7 +100,14 @@ template bgp pt_rc from pt_clearnet {
protocol babel p_myas_babel {
ipv6 {
table t_myas_babel;
- import where source ~ [RTS_DEVICE, RTS_BABEL];
+ import filter {
+{% if uvok_bird_opts.babel_accept_default %}
+ # accept also default route
+{% else %}
+ if is_default_route() then reject;
+{% endif %}
+ accept;
+ };
export where source ~ [RTS_DEVICE, RTS_BABEL, RTS_STATIC];
};
@@ -168,10 +176,14 @@ protocol kernel pk_myas_out {
if (source = RTS_BGP) then {
accept;
}
- # default route
+ # static default route
if (source = RTS_STATIC) then {
accept;
}
+{% if uvok_bird_opts.babel_accept_default %}
+ # add babel default route
+ if is_default_route() then accept;
+{% endif %}
reject;
};
};