summaryrefslogtreecommitdiff
path: root/proto/aggregator/test.conf
diff options
context:
space:
mode:
authorIgor Putovny <igor.putovny@nic.cz>2023-06-21 13:15:07 +0200
committerOndrej Zajicek <santiago@crfreenet.org>2023-09-26 15:46:24 +0200
commit977b82fba49b22d9548546d88b105945921efaed (patch)
treec62f27e9923c25336263883e2c069f8e87d150dc /proto/aggregator/test.conf
parent0a729b509c2c4476cbf66c64620a863e6a381c8c (diff)
Basic route aggregation
Add a new protocol offering route aggregation. User can specify list of route attributes in the configuration file and run route aggregation on the export side of the pipe protocol. Routes are sorted and for every group of equivalent routes new route is created and exported to the routing table. It is also possible to specify filter which will run for every route before aggregation. Furthermore, it will be possible to set attributes of new routes according to attributes of the aggregated routes. This is a work in progress. Original work by Igor Putovny, subsequent cleanups and finalization by Maria Matejka.
Diffstat (limited to 'proto/aggregator/test.conf')
-rw-r--r--proto/aggregator/test.conf116
1 files changed, 116 insertions, 0 deletions
diff --git a/proto/aggregator/test.conf b/proto/aggregator/test.conf
new file mode 100644
index 00000000..e5e1e267
--- /dev/null
+++ b/proto/aggregator/test.conf
@@ -0,0 +1,116 @@
+log "bird.log" all;
+
+protocol device {}
+
+protocol static {
+ ipv6;
+ route 2001:db8:0::/48 unreachable { bgp_path.prepend(65432); bgp_path.prepend(4200000000); };
+ route 2001:db8:1::/48 unreachable;
+ route 2001:db8:2::/48 unreachable;
+ route 2001:db8:3::/48 unreachable;
+ route 2001:db8:4::/48 unreachable;
+ route 2001:db8:5::/48 unreachable;
+ route 2001:db8:6::/48 unreachable;
+ route 2001:db8:7::/48 unreachable;
+ route 2001:db8:8::/48 unreachable;
+ route 2001:db8:9::/48 unreachable;
+ route 2001:db8:a::/48 unreachable;
+ route 2001:db8:b::/48 unreachable;
+ route 2001:db8:c::/48 unreachable;
+ route 2001:db8:d::/48 unreachable;
+ route 2001:db8:e::/48 unreachable;
+ route 2001:db8:f::/48 unreachable;
+}
+
+protocol static {
+ ipv6 {
+ import filter {
+ bgp_med = 1;
+ bgp_community = -empty-.add((65533,1)).add((65500,0xe));
+ accept;
+ };
+ };
+ route 2001:db8:1::/48 unreachable;
+ route 2001:db8:3::/48 unreachable;
+ route 2001:db8:5::/48 unreachable;
+ route 2001:db8:7::/48 unreachable;
+ route 2001:db8:9::/48 unreachable;
+ route 2001:db8:b::/48 unreachable;
+ route 2001:db8:d::/48 unreachable;
+ route 2001:db8:f::/48 unreachable;
+}
+
+protocol static {
+ ipv6 {
+ import filter {
+ bgp_med = 2;
+ bgp_community = -empty-.add((65533,2)).add((65500,0xd));
+ accept;
+ };
+ };
+ route 2001:db8:2::/48 unreachable;
+ route 2001:db8:3::/48 unreachable;
+ route 2001:db8:6::/48 unreachable;
+ route 2001:db8:7::/48 unreachable;
+ route 2001:db8:a::/48 unreachable;
+ route 2001:db8:b::/48 unreachable;
+ route 2001:db8:e::/48 unreachable;
+ route 2001:db8:f::/48 unreachable;
+}
+
+protocol static {
+ ipv6 {
+ import filter {
+ bgp_med = 4;
+ bgp_community = -empty-.add((65533,4)).add((65500,0xb));
+ accept;
+ };
+ };
+ route 2001:db8:4::/48 unreachable;
+ route 2001:db8:5::/48 unreachable;
+ route 2001:db8:6::/48 unreachable;
+ route 2001:db8:7::/48 unreachable;
+ route 2001:db8:c::/48 unreachable;
+ route 2001:db8:d::/48 unreachable;
+ route 2001:db8:e::/48 unreachable;
+ route 2001:db8:f::/48 unreachable;
+}
+
+protocol static {
+ ipv6 {
+ import filter {
+ bgp_med = 8;
+ bgp_community = -empty-.add((65533,8)).add((65500,0x7));
+ accept;
+ };
+ };
+ route 2001:db8:8::/48 unreachable;
+ route 2001:db8:9::/48 unreachable;
+ route 2001:db8:a::/48 unreachable;
+ route 2001:db8:b::/48 unreachable;
+ route 2001:db8:c::/48 unreachable;
+ route 2001:db8:d::/48 unreachable;
+ route 2001:db8:e::/48 unreachable;
+ route 2001:db8:f::/48 unreachable;
+}
+
+ipv6 table agr_result;
+
+protocol aggregator {
+ table master6;
+ peer table agr_result;
+ export all;
+ aggregate on net,(defined(bgp_med));
+ merge by {
+ print "Merging all these: ", routes;
+ bgp_med = 0;
+ for route r in routes do {
+ if ! defined(r.bgp_med) then { unset(bgp_med); accept; }
+
+ print r, " bgp_med: ", r.bgp_med;
+ bgp_med = bgp_med + r.bgp_med;
+ bgp_community = bgp_community.add(r.bgp_community);
+ }
+ accept;
+ };
+}