router id 192.0.2.12;

log "/var/log/bird.log" all;
log syslog all;
debug protocols all;

protocol device { }

protocol static own_prefixes {
	route {{ data.AS1_good1 }} reject;
	route {{ data.AS1_good2 }} reject;
	route {{ data.AS1_good3 }} reject;
}

filter to_the_rs {
	if net = {{ data.AS1_good3 }} then
		bgp_next_hop = {{ data.AS1_1_IPAddress }};
	if net = {{ data.AS103_gshut_1 }} then {
		bgp_community.add((65535, 0));
	}
	accept;
}
filter from_rs {
	# AS1 must announce AS103_gshut_* to test gshut.
	if net = {{ data.AS103_gshut_1 }} then
		reject;
	if net = {{ data.AS103_gshut_2 }} then
		reject;
	accept;
}
protocol bgp the_rs {
	local as 1;
	neighbor {{ data.rs_IPAddress }} as 999;
	import filter from_rs;
	export filter to_the_rs;
	connect delay time 1;
	connect retry time 1;
	missing lladdr ignore;
}
protocol bgp AS101 {
	local as 1;
	neighbor {{ data.AS101_IPAddress }} as 101;
	import all;
	export all;
	connect delay time 1;
	connect retry time 1;
}
