Skip to content

junos: add route-level community lab for static, aggregate, and generate routes - #235

Merged
dhalperi merged 1 commit into
mainfrom
junos-route-communities
Sep 28, 2026
Merged

dhalperi merged 1 commit into
mainfrom
junos-route-communities

Conversation

@dhalperi

Copy link
Copy Markdown
Member

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.

…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
dhalperi enabled auto-merge (squash) September 28, 2026 23:30
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.59%. Comparing base (feb209c) to head (206a4a9).

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           
Flag Coverage Δ
unittests 83.59% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dhalperi
dhalperi merged commit 43b73f0 into main Sep 28, 2026
145 checks passed
@dhalperi
dhalperi deleted the junos-route-communities branch September 28, 2026 23:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants