Created
April 20, 2025 14:54
-
-
Save tonusoo/aa531093e1c6179f3dd2b9a922e4f647 to your computer and use it in GitHub Desktop.
Juniper conditional BGP announcement PoC
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[edit policy-options] | |
+ prefix-list DC1-aggregate { | |
+ 10.10.0.0/23; | |
+ } | |
[edit policy-options] | |
+ policy-statement ISP-B-out-v4 { | |
+ term conditional-announcement { | |
+ from { | |
+ prefix-list DC1-aggregate; | |
+ condition conditional-announcement; | |
+ } | |
+ then reject; | |
+ } | |
+ then next policy; | |
+ } | |
+ policy-statement from-ISP-A { | |
+ term allow-from-ISP-A { | |
+ from community from-ISP-A; | |
+ then accept; | |
+ } | |
+ term reject-all { | |
+ then reject; | |
+ } | |
+ } | |
[edit policy-options] | |
+ community from-ISP-A members 64512:10; | |
[edit policy-options] | |
+ condition conditional-announcement { | |
+ if-route-exists { | |
+ 0.0.0.0/0; | |
+ table conditional.inet.0; | |
+ } | |
+ } | |
[edit] | |
+ routing-instances { | |
+ conditional { | |
+ instance-type virtual-router; | |
+ } | |
+ } | |
[edit routing-options] | |
+ rib-groups { | |
+ conditional { | |
+ import-rib [ inet.0 conditional.inet.0 ]; | |
+ import-policy from-ISP-A; | |
+ } | |
+ } | |
[edit protocols bgp group ebgp] | |
- export [ AS64512-aggregates-v4 reject-all ]; | |
+ export [ ISP-B-out-v4 AS64512-aggregates-v4 reject-all ]; | |
[edit protocols bgp group ibgp] | |
+ family inet { | |
+ unicast { | |
+ rib-group conditional; | |
+ } | |
+ } |
Author
tonusoo
commented
Apr 20, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment