0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-12-22 17:51:53 +00:00
bird/flock/bgp-secondary/bird_src.conf
Maria Matejka 5aaa8ea226 Flock tests: create simple environment
This is a first try on adapting Flock on cf-bgp-secondary
from bird-tools.
2024-07-10 12:45:51 +02:00

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;
};
}