Skip to content

bgp: T9013: Add BMP source-interface support#5290

Merged
c-po merged 1 commit into
vyos:rollingfrom
natali-rs1985:T9013
Jun 25, 2026
Merged

bgp: T9013: Add BMP source-interface support#5290
c-po merged 1 commit into
vyos:rollingfrom
natali-rs1985:T9013

Conversation

@natali-rs1985

Copy link
Copy Markdown
Contributor

Change summary

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes)
  • Migration from an old Vyatta component to vyos-1x, please link to related PR inside obsoleted component
  • Other (please describe):

Related Task(s)

Related PR(s)

vyos/vyos-build#1225

How to test / Smoketest result

set system frr bmp
commit 
run restart bgp

set protocols bgp system-as '65001'
set protocols bgp bmp target test address '192.0.0.1'
set protocols bgp bmp target test source-interface eth1
commit

vyos@vyos# vtysh -c "show running-config bgpd"
Building configuration...

Current configuration:
!
frr version 10.6.1
frr defaults traditional
hostname vyos
service integrated-vtysh-config
!
router bgp 65001
 no bgp ebgp-requires-policy
 no bgp reject-as-sets
 no bgp default ipv4-unicast
 no bgp network import-check
 !
 bmp targets test
  bmp connect 192.0.0.1 port 5000 min-retry 1000 max-retry 2000 source-interface eth1
 exit
exit
!
end
[edit]
vyos@vyos# 


vyos@vyos# python3 /usr/libexec/vyos/tests/smoke/cli/test_protocols_bgp.py -k test_bgp_99_bmp
test_bgp_99_bmp (__main__.TestProtocolsBGP.test_bgp_99_bmp) ... ok

----------------------------------------------------------------------
Ran 1 test in 40.299s

OK
[edit]
vyos@vyos# 

Checklist:

  • I have read the CONTRIBUTING document
  • I have linked this PR to one or more Phabricator Task(s)
  • I have run the components SMOKETESTS if applicable
  • My commit headlines contain a valid Task id
  • My change requires a change to the documentation
  • I have updated the documentation accordingly

@coderabbitai

coderabbitai Bot commented Jun 24, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: b9b9d5c0-3814-43e5-ab71-b998921905c8

📥 Commits

Reviewing files that changed from the base of the PR and between 729ca18 and a83edf1.

📒 Files selected for processing (3)
  • data/templates/frr/bgpd.frr.j2
  • interface-definitions/include/bgp/protocol-common-config.xml.i
  • smoketest/scripts/cli/test_protocols_bgp.py
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • ansible/ansible (manual)
🚧 Files skipped from review as they are similar to previous changes (3)
  • data/templates/frr/bgpd.frr.j2
  • interface-definitions/include/bgp/protocol-common-config.xml.i
  • smoketest/scripts/cli/test_protocols_bgp.py
📜 Recent review details
⏰ Context from checks skipped due to timeout. (4)
  • GitHub Check: build_iso
  • GitHub Check: codeql-analysis-call / Analyze (python)
  • GitHub Check: Mergify Merge Protections
  • GitHub Check: Summary
🧰 Additional context used
🔍 Remote MCP Context7

Relevant context for review:

  • FRR’s BMP documentation explicitly supports an outbound BMP session command of the form bmp connect HOSTNAME port ... [source-interface WORD], and says bmp targets NAME groups these session settings. This matches the template change adding source-interface to the rendered bmp connect line when configured.
  • VyOS docs confirm BMP support is enabled with set system frr bmp, but the returned BGP docs only show update-source for BGP neighbors; I did not find a BMP-target-specific source-interface CLI in the retrieved VyOS documentation.

📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • BMP target settings now support an optional source interface.
    • When configured, generated FRR output will include the source interface as part of the BMP connection settings.
  • Tests

    • Updated BGP protocol smoke tests to confirm the source interface is present in generated configuration when set, and absent after it is removed.

Walkthrough

Adds source-interface support to BMP target configuration. The XML schema includes source-interface under bmp/target, the FRR template conditionally renders it on bmp connect, and the smoketest covers set and delete behavior.

Changes

BMP target source-interface feature

Layer / File(s) Summary
Schema and template rendering
interface-definitions/include/bgp/protocol-common-config.xml.i, data/templates/frr/bgpd.frr.j2
protocol-common-config.xml.i:877 adds #include <include/source-interface.xml.i> under bmp/target, and bgpd.frr.j2:541 appends source-interface {{ bmp_config.source_interface }} to bmp connect when defined.
Smoketest set and delete flow
smoketest/scripts/cli/test_protocols_bgp.py
test_protocols_bgp.py:1855, 1883, 1904-1918 adds source_iface = 'eth0', configures BMP target source-interface, verifies the rendered FRR config includes it, deletes it, and verifies it is removed from the output.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title matches the change: BGP BMP target source-interface support.
Description check ✅ Passed The description is related to the BMP source-interface feature and its smoketest coverage.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
✨ Simplify code
  • Create PR with simplified code

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Jun 24, 2026

Copy link
Copy Markdown

❌ Typos detected in PR (4 found)

File Typo Suggestion
data/templates/frr/bgpd.frr.j2:261 delimeter delimiter
data/templates/frr/bgpd.frr.j2:264 delimeter delimiter
data/templates/frr/bgpd.frr.j2:550 delimeter delimiter
data/templates/frr/bgpd.frr.j2:557 delimeter delimiter

@dmbaturin dmbaturin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree the source interface option can be useful and the implementation is very straightforward.

@natali-rs1985

Copy link
Copy Markdown
Contributor Author
DEBUG - test_bgp_99_bmp (__main__.TestProtocolsBGP.test_bgp_99_bmp) ... FAIL
DEBUG - 
DEBUG - ======================================================================
DEBUG - FAIL: test_bgp_99_bmp (__main__.TestProtocolsBGP.test_bgp_99_bmp)
DEBUG - ----------------------------------------------------------------------
DEBUG - Traceback (most recent call last):
DEBUG -   File "/usr/libexec/vyos/tests/smoke/cli/test_protocols_bgp.py", line 1918, in test_bgp_99_bmp
DEBUG -     self.assertNotIn('source-interface', frrconfig)
DEBUG - AssertionError: 'source-interface' unexpectedly found in 'router bgp 64512\n no bgp ebgp-requires-policy\n no bgp reject-as-sets\n no bgp default ipv4-unicast\n no bgp network import-check\n !\n bmp mirror buffer-limit 32000000\n !\n bmp targets instance-bmp\n  bmp mirror\n  bmp monitor ipv4 unicast pre-policy\n  bmp monitor ipv4 unicast loc-rib\n  bmp monitor ipv6 unicast pre-policy\n  bmp monitor ipv6 unicast loc-rib\n  bmp connect 127.0.0.1 port 5000 min-retry 1024 max-retry 2048 source-interface eth0\n exit\nexit'
DEBUG - 
DEBUG - ----------------------------------------------------------------------
DEBUG - Ran 35 tests in 330.661s
DEBUG - 
DEBUG - FAILED (failures=1)

The test will succeed after the FRR fix patch is merged

@sever-sever sever-sever left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add source-interface feature for BMP

@c-po c-po left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implementation lookgs good. Test included

@dmbaturin

Copy link
Copy Markdown
Member

The typos cannot be fixed easily, a fix for those will come later. They are not user visible.

@c-po c-po merged commit a141346 into vyos:rolling Jun 25, 2026
19 of 20 checks passed
@vyos-bot vyos-bot Bot added mirror-initiated This PR initiated for mirror sync workflow mirror-completed and removed mirror-initiated This PR initiated for mirror sync workflow labels Jun 25, 2026
@github-actions

Copy link
Copy Markdown

CI integration 👍 passed!

Details

CI logs

  • CLI Smoketests 👍 passed
  • CLI Smoketests (interfaces only) 👍 passed
  • Config tests 👍 passed
  • RAID1 tests 👍 passed
  • CLI Smoketests VPP 👍 passed
  • Config tests VPP 👍 passed
  • TPM tests 👍 passed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

4 participants