2024-07-22 08:57:29 +00:00
|
|
|
log "{{ m.logs[0].name }}" all;
|
2024-07-10 10:44:53 +00:00
|
|
|
|
|
|
|
router id 1;
|
2024-07-19 18:10:40 +00:00
|
|
|
define epoch = {{ t.epoch % 2 }};
|
2024-07-10 10:44:53 +00:00
|
|
|
|
|
|
|
ipv6 table master6 sorted;
|
|
|
|
|
2024-07-22 08:57:29 +00:00
|
|
|
#debug tables all;
|
|
|
|
#debug channels all;
|
2024-07-10 10:44:53 +00:00
|
|
|
|
|
|
|
protocol device {
|
|
|
|
scan time 10;
|
|
|
|
}
|
|
|
|
|
|
|
|
protocol kernel kernel6 {
|
|
|
|
scan time 10;
|
|
|
|
ipv6 { export all; };
|
|
|
|
}
|
|
|
|
|
|
|
|
protocol static p200 {
|
|
|
|
ipv6 { import filter { preference = 200; accept; }; };
|
|
|
|
route 2001:db8:eee1::/48 unreachable;
|
|
|
|
route 2001:db8:eee2::/48 unreachable;
|
|
|
|
route 2001:db8:eee3::/48 unreachable;
|
|
|
|
route 2001:db8:eee4::/48 unreachable;
|
|
|
|
route 2001:db8:eee5::/48 unreachable;
|
|
|
|
route 2001:db8:eee6::/48 unreachable;
|
2024-07-19 18:10:40 +00:00
|
|
|
{% if t.epoch == 0 %}
|
2024-07-10 10:44:53 +00:00
|
|
|
disabled;
|
2024-07-19 18:10:40 +00:00
|
|
|
{% endif %}
|
2024-07-10 10:44:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
protocol static p190 {
|
|
|
|
ipv6 { import filter { preference = 190; accept; }; };
|
|
|
|
route 2001:db8:eee1::/48 unreachable;
|
|
|
|
route 2001:db8:eee2::/48 unreachable;
|
|
|
|
route 2001:db8:eee3::/48 unreachable;
|
|
|
|
route 2001:db8:eee4::/48 unreachable;
|
|
|
|
route 2001:db8:eee5::/48 unreachable;
|
|
|
|
route 2001:db8:eee6::/48 unreachable;
|
2024-07-19 18:10:40 +00:00
|
|
|
{%- if t.epoch == 0 -%}
|
2024-07-10 10:44:53 +00:00
|
|
|
disabled;
|
2024-07-19 18:10:40 +00:00
|
|
|
{%- endif -%}
|
2024-07-10 10:44:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
protocol static p180 {
|
|
|
|
ipv6 { import filter { preference = 180; accept; }; };
|
|
|
|
route 2001:db8:eee1::/48 unreachable;
|
|
|
|
route 2001:db8:eee2::/48 unreachable;
|
|
|
|
route 2001:db8:eee3::/48 unreachable;
|
|
|
|
route 2001:db8:eee4::/48 unreachable;
|
|
|
|
route 2001:db8:eee5::/48 unreachable;
|
|
|
|
route 2001:db8:eee6::/48 unreachable;
|
2024-07-19 18:10:40 +00:00
|
|
|
{%- if t.epoch == 0 -%}
|
|
|
|
disabled;
|
|
|
|
{%- endif -%}
|
2024-07-10 10:44:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
protocol static p170 {
|
|
|
|
ipv6 { import filter { preference = 170; accept; }; };
|
|
|
|
route 2001:db8:eee1::/48 unreachable;
|
|
|
|
route 2001:db8:eee2::/48 unreachable;
|
|
|
|
route 2001:db8:eee3::/48 unreachable;
|
|
|
|
route 2001:db8:eee4::/48 unreachable;
|
|
|
|
route 2001:db8:eee5::/48 unreachable;
|
|
|
|
route 2001:db8:eee6::/48 unreachable;
|
2024-07-19 18:10:40 +00:00
|
|
|
{%- if t.epoch == 0 -%}
|
2024-07-10 10:44:53 +00:00
|
|
|
disabled;
|
2024-07-19 18:10:40 +00:00
|
|
|
{%- endif -%}
|
2024-07-10 10:44:53 +00:00
|
|
|
}
|
|
|
|
|
2024-07-19 14:47:29 +00:00
|
|
|
protocol static STARTUP {
|
|
|
|
ipv6;
|
|
|
|
route 2001:db8:cc00::/40 unreachable;
|
|
|
|
}
|
|
|
|
|
2024-07-10 10:44:53 +00:00
|
|
|
# We need to CHECK this:
|
|
|
|
# - adding worst to best
|
|
|
|
# - adding best to worst
|
|
|
|
# - removing (both dirs)
|
|
|
|
# - reconf
|
|
|
|
|
|
|
|
function CHECK() -> bool {
|
2024-07-19 14:47:29 +00:00
|
|
|
if net = 2001:db8:cc00::/40 then return true;
|
|
|
|
|
2024-07-10 10:44:53 +00:00
|
|
|
bgp_path.prepend(preference);
|
|
|
|
case epoch {
|
2024-07-19 18:10:40 +00:00
|
|
|
0: case preference {
|
2024-07-10 10:44:53 +00:00
|
|
|
170: return net ~ [ 2001:db8:eee4::/48, 2001:db8:eee5::/48 ];
|
|
|
|
180: return net ~ [ 2001:db8:eee3::/48 ];
|
|
|
|
190: return net ~ [ 2001:db8:eee2::/48, 2001:db8:eee4::/48 ];
|
|
|
|
200: return net ~ [ 2001:db8:eee1::/48, 2001:db8:eee3::/48 ];
|
|
|
|
else: return false;
|
|
|
|
}
|
2024-07-19 18:10:40 +00:00
|
|
|
1: case preference {
|
2024-07-10 10:44:53 +00:00
|
|
|
170: return net ~ [ 2001:db8:eee5::/48, 2001:db8:eee6::/48 ];
|
|
|
|
180: return net ~ [ 2001:db8:eee4::/48 ];
|
|
|
|
190: return net ~ [ 2001:db8:eee3::/48, 2001:db8:eee5::/48 ];
|
|
|
|
200: return net ~ [ 2001:db8:eee2::/48, 2001:db8:eee4::/48 ];
|
|
|
|
else: return false;
|
|
|
|
}
|
|
|
|
else: return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
protocol bgp LINK {
|
2024-07-12 17:56:04 +00:00
|
|
|
local {{ t.links["L"]["src"]["ipv6"].ip }} as 1;
|
|
|
|
neighbor {{ t.links["L"]["dest"]["ipv6"].ip }} as 2;
|
2024-07-10 10:44:53 +00:00
|
|
|
ipv6 {
|
|
|
|
import none;
|
|
|
|
export where CHECK();
|
|
|
|
secondary;
|
|
|
|
};
|
|
|
|
}
|