From eff1c9fbe92da159d85fd7d62f5a9468026efee74506930dbee3e1425c494ec1 Mon Sep 17 00:00:00 2001 From: khodor Date: Thu, 2 Jan 2025 02:47:47 +0000 Subject: [PATCH] Add aggregate-routes --- aggregate-routes | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 aggregate-routes diff --git a/aggregate-routes b/aggregate-routes new file mode 100644 index 0000000..f8ac8c4 --- /dev/null +++ b/aggregate-routes @@ -0,0 +1,25 @@ +#Policy prevents BGP from generating an aggregate route. Useful for annouuncing a smaller subnet from a different ASN. +set policy-options policy-statement AGGREGATE_FROM_DIRECT_STATIC_OSPF term FROM_DIRECT from protocol direct +set policy-options policy-statement AGGREGATE_FROM_DIRECT_STATIC_OSPF term FROM_DIRECT then accept +set policy-options policy-statement AGGREGATE_FROM_DIRECT_STATIC_OSPF term FROM_STATIC from protocol static +set policy-options policy-statement AGGREGATE_FROM_DIRECT_STATIC_OSPF term FROM_STATIC then accept +set policy-options policy-statement AGGREGATE_FROM_DIRECT_STATIC_OSPF term FROM_OSPF from protocol ospf +set policy-options policy-statement AGGREGATE_FROM_DIRECT_STATIC_OSPF term FROM_OSPF then accept +set policy-options policy-statement AGGREGATE_FROM_DIRECT_STATIC_OSPF term FROM_OSPF3 from protocol ospf3 +set policy-options policy-statement AGGREGATE_FROM_DIRECT_STATIC_OSPF term FROM_OSPF3 then accept +set policy-options policy-statement AGGREGATE_FROM_DIRECT_STATIC_OSPF term DEFAULT_REJECT then reject + +#Will still take bgp routes into consideration for aggregate generation +set policy-options policy-statement aggregate-from-direct-static-ospf from protocol direct +set policy-options policy-statement aggregate-from-direct-static-ospf from protocol static +set policy-options policy-statement aggregate-from-direct-static-ospf from protocol ospf +set policy-options policy-statement aggregate-from-direct-static-ospf from protocol ospf3 +set policy-options policy-statement aggregate-from-direct-static-ospf then accept + +set routing-options aggregate route 185.83.86.0/24 community 199557:199557 +set routing-options aggregate route 185.83.86.0/24 discard +set routing-options aggregate route 185.83.86.0/24 policy aggregate-from-direct-static-ospf + +set routing-options aggregate route x.x.x.x/24 policy AGGREGATE_FROM_DIRECT_STATIC_OSPF +set routing-options aggregate route x.x.x.x/24 tag 123456 +set routing-options aggregate route x.x.x.x/24 discard \ No newline at end of file