feat: Add network bonding configuration API#92
Open
kcirtapfromspace wants to merge 1 commit into
Open
Conversation
Add support for configuring NIC link aggregation (bonding) via the REST API. New module: src/app/network_config.rs - Manages bonding configuration via /etc/bonding.conf and /etc/bonding.enabled - Reads bonding status from /proc/net/bonding/bond0 - Supports all Linux bonding modes (balance-rr, active-backup, balance-xor, broadcast, 802.3ad, balance-tlb, balance-alb) API endpoints: - GET /api/bmc?opt=get&type=network_config Returns: bonding_enabled, bonding_mode, bonding_active, slaves, miimon - GET /api/bmc?opt=set&type=network_config&enabled=1&mode=802.3ad&apply=1 Sets bonding configuration and optionally applies changes This enables the Turing Pi 2.5's dual NICs (ge0 and ge1) to be bonded for increased bandwidth (with 802.3ad LACP) or failover redundancy (with active-backup mode). Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Open
7 tasks
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.
Summary
Add support for configuring NIC link aggregation (bonding) via the REST API.
Changes
New Files
src/app/network_config.rs- Network bonding configuration moduleModified Files
src/app.rs- Added network_config modulesrc/api/legacy.rs- Added API handlers for network_configFeatures
/etc/bonding.confand/etc/bonding.enabled/proc/net/bonding/bond0API Endpoints
GET /api/bmc?opt=get&type=network_config
Returns current bonding status:
{ "bonding_enabled": true, "bonding_mode": "802.3ad", "bonding_active": true, "slaves": ["ge0", "ge1"], "miimon": 100 }GET /api/bmc?opt=set&type=network_config&enabled=1&mode=802.3ad&apply=1
Sets bonding configuration. Parameters:
enabled- "1" or "true" to enable bondingmode- Bonding mode name or numberapply- "1" or "true" to apply changes immediatelyUse Case
This enables the Turing Pi 2.5's dual NICs (ge0 and ge1) to be bonded for:
Related PRs
🤖 Generated with Claude Code