mirror of
https://gitlab.nic.cz/labs/bird.git
synced 2024-12-23 02:01:55 +00:00
100 lines
2.5 KiB
Plaintext
100 lines
2.5 KiB
Plaintext
|
log "bird.log" all;
|
||
|
|
||
|
router id 1;
|
||
|
define epoch = 1;
|
||
|
|
||
|
ipv6 table master6 sorted;
|
||
|
|
||
|
debug tables all;
|
||
|
debug channels all;
|
||
|
|
||
|
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;
|
||
|
disabled;
|
||
|
}
|
||
|
|
||
|
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;
|
||
|
disabled;
|
||
|
}
|
||
|
|
||
|
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;
|
||
|
disabled;
|
||
|
}
|
||
|
|
||
|
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;
|
||
|
disabled;
|
||
|
}
|
||
|
|
||
|
# We need to CHECK this:
|
||
|
# - adding worst to best
|
||
|
# - adding best to worst
|
||
|
# - removing (both dirs)
|
||
|
# - reconf
|
||
|
|
||
|
function CHECK() -> bool {
|
||
|
bgp_path.prepend(preference);
|
||
|
case epoch {
|
||
|
1: case preference {
|
||
|
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;
|
||
|
}
|
||
|
2: case preference {
|
||
|
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 {
|
||
|
local {{ link["src"]["ipv6"].ip }} as 1;
|
||
|
neighbor {{ link["dest"]["ipv6"].ip }} as 2;
|
||
|
ipv6 {
|
||
|
import none;
|
||
|
export where CHECK();
|
||
|
secondary;
|
||
|
};
|
||
|
}
|