Skip to content

Commit fd1a3f9

Browse files
committed
[CI] Update router tests for new as112/bird2 and other improvements
1 parent 9da058b commit fd1a3f9

22 files changed

+1366
-86
lines changed

.env.ci

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ MAIL_MAILER=array
3838

3939
QUEUE_CONNECTION=sync
4040

41-
41+
IXP_AS112_UI_ACTIVE=true
4242

4343
# IP address and port of the first RPKI local cache:
4444
IXP_RPKI_RTR1_HOST=10.39.5.123

data/ci/ci_test_db.sql

Lines changed: 17 additions & 17 deletions
Large diffs are not rendered by default.

data/ci/known-good/api-v4-member-export-1.0-unauth.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@
325325
{
326326
"vlan_id": 1,
327327
"ipv6": {
328-
"address": "2001:db8:1::8",
328+
"address": "2001:db8:1::b",
329329
"as_macro": "AS-IBIS",
330330
"routeserver": true,
331331
"mac_addresses": [],

data/ci/known-good/ci-apiv4-as112-lan1-ipv4.conf

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44
# Do not edit this file, it will be overwritten.
55
#
6-
# Generated: 2016-11-08 18:51:34
6+
# Generated: 2025-08-30 12:04:50
77
#
88

99
# For VLAN: Peering LAN 1 (Tag: 1, Database ID: 1)
@@ -122,3 +122,15 @@ protocol bgp pb_as1213_vli1_ipv4 {
122122
}
123123

124124

125+
protocol bgp pb_as65501_vli9_ipv4 {
126+
description "AS65501 - SCIX Route Servers";
127+
local as routerasn;
128+
source address routeraddress;
129+
neighbor 10.1.0.8 as 65501;
130+
import filter f_import_policy;
131+
export where proto = "static_as112";
132+
import limit 100000 action restart;
133+
134+
}
135+
136+

data/ci/known-good/ci-apiv4-as112-lan1-ipv6.conf

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44
# Do not edit this file, it will be overwritten.
55
#
6-
# Generated: 2016-11-08 18:51:42
6+
# Generated: 2025-08-30 12:05:11
77
#
88

99
# For VLAN: Peering LAN 1 (Tag: 1, Database ID: 1)
@@ -121,3 +121,15 @@ protocol bgp pb_as1213_vli1_ipv6 {
121121
}
122122

123123

124+
protocol bgp pb_as65501_vli9_ipv6 {
125+
description "AS65501 - SCIX Route Servers";
126+
local as routerasn;
127+
source address routeraddress;
128+
neighbor 2001:db8:1::8 as 65501;
129+
import filter f_import_policy;
130+
export where proto = "static_as112";
131+
import limit 100000 action restart;
132+
133+
}
134+
135+

data/ci/known-good/ci-apiv4-as112-lan2-ipv4.conf

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44
# Do not edit this file, it will be overwritten.
55
#
6-
# Generated: 2016-11-08 18:51:59
6+
# Generated: 2025-08-30 12:05:36
77
#
88

99
# For VLAN: Peering LAN 2 (Tag: 2, Database ID: 2)
@@ -98,3 +98,15 @@ protocol static static_as112 {
9898

9999

100100

101+
protocol bgp pb_as1213_vli2_ipv4 {
102+
description "AS1213 - HEAnet";
103+
local as routerasn;
104+
source address routeraddress;
105+
neighbor 10.2.0.11 as 1213;
106+
import filter f_import_policy;
107+
export where proto = "static_as112";
108+
import limit 1000 action restart;
109+
password "u5zSNJLAVT87RGXQ";
110+
}
111+
112+

data/ci/known-good/ci-apiv4-as112-lan2-ipv6.conf

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44
# Do not edit this file, it will be overwritten.
55
#
6-
# Generated: 2016-11-08 18:51:51
6+
# Generated: 2025-08-30 12:06:40
77
#
88

99
# For VLAN: Peering LAN 2 (Tag: 2, Database ID: 2)
@@ -109,3 +109,15 @@ protocol static static_as112 {
109109

110110

111111

112+
protocol bgp pb_as1213_vli2_ipv6 {
113+
description "AS1213 - HEAnet";
114+
local as routerasn;
115+
source address routeraddress;
116+
neighbor 2001:db8:2::11 as 1213;
117+
import filter f_import_policy;
118+
export where proto = "static_as112";
119+
import limit 1000 action restart;
120+
password "u5zSNJLAVT87RGXQ";
121+
}
122+
123+
Lines changed: 201 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,201 @@
1+
#
2+
# Bird AS112 configuration generated by IXP Manager
3+
#
4+
# Do not edit this file, it will be overwritten.
5+
#
6+
# Generated: 2025-08-30 11:54:58
7+
#
8+
9+
# For VLAN: Peering LAN 1 (Tag: 1, Database ID: 1)
10+
11+
# standardise time formats:
12+
timeformat base iso long;
13+
timeformat log iso long;
14+
timeformat protocol iso long;
15+
timeformat route iso long;
16+
17+
18+
log "/var/log/bird/b2-as112-lan1-ipv4.log" all;
19+
log syslog name "bird-b2-as112-lan1-ipv4" all;
20+
21+
define routerasn = 112;
22+
define routeraddress = 192.0.2.6;
23+
24+
router id 192.0.2.6;
25+
26+
protocol kernel {
27+
ipv4 {
28+
export all;
29+
};
30+
scan time 60;
31+
}
32+
33+
protocol device {
34+
scan time 10;
35+
}
36+
37+
# These function excludes weird networks
38+
# rfc1918, class D, class E, too long and too short prefixes
39+
function avoid_martians() -> bool
40+
prefix set martians;
41+
{
42+
43+
martians = [
44+
0.0.0.0/32-, # rfc5735 Special Use IPv4 Addresses
45+
0.0.0.0/0{25,32}, # Filter small prefixes
46+
0.0.0.0/0{0,7}, # rfc1122 Requirements for Internet Hosts -- Communication Layers 3.2.1.3
47+
10.0.0.0/8+, # rfc1918 Address Allocation for Private Internets
48+
100.64.0.0/10+, # rfc6598 IANA-Reserved IPv4 Prefix for Shared Address Space
49+
127.0.0.0/8+, # rfc1122 Requirements for Internet Hosts -- Communication Layers 3.2.1.3
50+
169.254.0.0/16+, # rfc3927 Dynamic Configuration of IPv4 Link-Local Addresses
51+
172.16.0.0/12+, # rfc1918 Address Allocation for Private Internets
52+
192.0.0.0/24+, # rfc6890 Special-Purpose Address Registries
53+
192.0.2.0/24+, # rfc5737 IPv4 Address Blocks Reserved for Documentation
54+
192.168.0.0/16+, # rfc1918 Address Allocation for Private Internets
55+
198.18.0.0/15+, # rfc2544 Benchmarking Methodology for Network Interconnect Devices
56+
198.51.100.0/24+, # rfc5737 IPv4 Address Blocks Reserved for Documentation
57+
203.0.113.0/24+, # rfc5737 IPv4 Address Blocks Reserved for Documentation
58+
224.0.0.0/4+, # rfc1112 Host Extensions for IP Multicasting
59+
240.0.0.0/4+ # rfc6890 Special-Purpose Address Registries
60+
];
61+
62+
63+
# Avoid RFC1918 and similar networks
64+
if ( net ~ martians ) then {
65+
return false;
66+
}
67+
68+
return true;
69+
}
70+
71+
72+
# This protocol defines the routes we want to export for AS112
73+
74+
protocol static static_as112 {
75+
76+
77+
ipv4;
78+
route 192.175.48.0/24 blackhole;
79+
route 192.31.196.0/24 blackhole;
80+
81+
82+
}
83+
84+
##
85+
## AS112 client configuration
86+
##
87+
88+
89+
90+
########################################################################################
91+
########################################################################################
92+
#
93+
# RPKI protocol configuration
94+
#
95+
########################################################################################
96+
########################################################################################
97+
98+
99+
roa4 table t_roa;
100+
101+
protocol rpki rpki1 {
102+
103+
roa4 { table t_roa; };
104+
105+
remote "10.39.5.123" port 3323;
106+
107+
retry keep 90;
108+
refresh keep 900;
109+
expire keep 172800;
110+
}
111+
112+
113+
protocol rpki rpki2 {
114+
115+
roa4 { table t_roa; };
116+
117+
remote "10.39.5.124" port 3323;
118+
119+
retry keep 90;
120+
refresh keep 900;
121+
expire keep 172800;
122+
}
123+
124+
125+
126+
127+
128+
function fn_import ( int remote_as )
129+
{
130+
if !(avoid_martians()) then {
131+
return false;
132+
}
133+
134+
# Belt and braces: must have at least one ASN in the path
135+
if( bgp_path.len < 1 ) then {
136+
return false;
137+
}
138+
139+
# Belt and braces: no one needs an ASN path with > 64 hops, that's just broken
140+
if( bgp_path.len > 64 ) then {
141+
return false;
142+
}
143+
144+
145+
# RPKI check
146+
if( roa_check( t_roa, net, bgp_path.last_nonaggregated ) = ROA_INVALID ) then {
147+
return false;
148+
} else if( roa_check( t_roa, net, bgp_path.last_nonaggregated ) = ROA_VALID ) then {
149+
return true;
150+
}
151+
152+
153+
return true;
154+
}
155+
156+
157+
protocol bgp pb_as42_vli3_ipv4 {
158+
description "AS42 - PCH DNS";
159+
local as routerasn;
160+
source address routeraddress;
161+
neighbor 10.1.0.36 as 42;
162+
strict bind yes;
163+
ipv4 {
164+
import where fn_import( 42 );
165+
import limit 2000 action restart;
166+
export where proto = "static_as112";
167+
};
168+
169+
}
170+
171+
172+
protocol bgp pb_as1213_vli1_ipv4 {
173+
description "AS1213 - HEAnet";
174+
local as routerasn;
175+
source address routeraddress;
176+
neighbor 10.1.0.10 as 1213;
177+
strict bind yes;
178+
ipv4 {
179+
import where fn_import( 1213 );
180+
import limit 1000 action restart;
181+
export where proto = "static_as112";
182+
};
183+
184+
}
185+
186+
187+
protocol bgp pb_as65501_vli9_ipv4 {
188+
description "AS65501 - SCIX Route Servers";
189+
local as routerasn;
190+
source address routeraddress;
191+
neighbor 10.1.0.8 as 65501;
192+
strict bind yes;
193+
ipv4 {
194+
# peer is route server at own IXP => prefixes already validated by route server
195+
import all;
196+
export where proto = "static_as112";
197+
};
198+
199+
}
200+
201+

0 commit comments

Comments
 (0)