Add aggregate-routes

This commit is contained in:
2025-01-02 02:47:47 +00:00
parent ebaa70d8ea
commit eff1c9fbe9

25
aggregate-routes Normal file
View File

@@ -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