junos: add route-level community lab for static, aggregate, and generate routes - #235
Merged
Merged
Conversation
…ate routes
Two-node vJunos-router lab testing which community forms Junos accepts
in `routing-options {static|aggregate|generate}` at route and
`defaults` level, and what the eBGP peer receives. Juniper's
`community (Routing Options)` reference describes large communities as
static-only; on 25.4R1.12 they are accepted in all six contexts and
reach the peer. Extended communities (`target:`, `origin:`) are
rejected by the CLI parser in all six. A `DEFAULTS` virtual-router
exercises the `defaults` blocks over a second eBGP session.
Batfish drops aggregate/generate routes carrying a route-level large
community and ignores large communities in their `defaults` blocks;
test_main_rib_routes and test_bgp_rib_routes are sickbayed against
batfish/batfish#10367.
lab_builder: `_junos_commit_check` now treats an `error:` response to a
`set` line as a rejection. Previously the rejected line was never
loaded, so `commit check` passed and the check reported "accepted".
Junos BGP parser: strip the `Aggregator:` line that aggregate routes
append to the `as-path` field.
----
Prompt:
```
https://www.juniper.net/documentation/us/en/software/junos/cli-reference/topics/ref/statement/community-edit-routing-options.html confuses me. It says that extended communities are not supported on static routes, and that large communities are ONLY supported on static routes. Can you build minimal Junos BGP labs to test this out?
```
Follow-up: extend the lab to exercise `defaults` with large
communities and what the peer receives, as a regression test.
dhalperi
enabled auto-merge (squash)
September 28, 2026 23:30
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #235 +/- ##
=======================================
Coverage 83.58% 83.59%
=======================================
Files 96 96
Lines 4703 4705 +2
=======================================
+ Hits 3931 3933 +2
Misses 772 772
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two-node vJunos-router lab testing which community forms Junos accepts
in
routing-options {static|aggregate|generate}at route anddefaultslevel, and what the eBGP peer receives. Juniper'scommunity (Routing Options)reference describes large communities asstatic-only; on 25.4R1.12 they are accepted in all six contexts and
reach the peer. Extended communities (
target:,origin:) arerejected by the CLI parser in all six. A
DEFAULTSvirtual-routerexercises the
defaultsblocks over a second eBGP session.Batfish drops aggregate/generate routes carrying a route-level large
community and ignores large communities in their
defaultsblocks;test_main_rib_routes and test_bgp_rib_routes are sickbayed against
batfish/batfish#10367.
lab_builder:
_junos_commit_checknow treats anerror:response to asetline as a rejection. Previously the rejected line was neverloaded, so
commit checkpassed and the check reported "accepted".Junos BGP parser: strip the
Aggregator:line that aggregate routesappend to the
as-pathfield.Prompt:
Follow-up: extend the lab to exercise
defaultswith largecommunities and what the peer receives, as a regression test.