diff options
author | uvok cheetah | 2024-06-25 18:43:58 +0200 |
---|---|---|
committer | uvok cheetah | 2024-06-25 18:43:58 +0200 |
commit | 3690ccbe4a7eb6b4e79591b07905813112fe9d49 (patch) | |
tree | edc19372daebab8dcdbaaa5a5899e89478f9d93c | |
parent | 8221d0341c45a1cc7db978256e3574a215b85dcf (diff) |
bird: Fixup default route selection
-rw-r--r-- | roles/uvok_bird/defaults/main.yml | 1 | ||||
-rw-r--r-- | roles/uvok_bird/templates/clearnet.conf.j2 | 16 |
2 files changed, 15 insertions, 2 deletions
diff --git a/roles/uvok_bird/defaults/main.yml b/roles/uvok_bird/defaults/main.yml index 4934326..8bf0ef3 100644 --- a/roles/uvok_bird/defaults/main.yml +++ b/roles/uvok_bird/defaults/main.yml @@ -11,3 +11,4 @@ uvok_bird_opts: clear_as: "64496" rpki1: "127.0.0.1" rpki2: "127.0.0.2" + babel_accept_default: false 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; }; }; |