[Nexthop][fboss2-dev] Add show running-config CLI command#838
Open
benoit-nexthop wants to merge 2 commits intofacebook:mainfrom
Open
[Nexthop][fboss2-dev] Add show running-config CLI command#838benoit-nexthop wants to merge 2 commits intofacebook:mainfrom
benoit-nexthop wants to merge 2 commits intofacebook:mainfrom
Conversation
This was referenced Jan 26, 2026
d682f77 to
73d5198
Compare
73d5198 to
9d484eb
Compare
Add new fboss2-dev CLI commands for managing static MAC address entries on VLANs: - `config vlan <vlan-id> static-mac add <mac-address> <port-id>` - `config vlan <vlan-id> static-mac delete <mac-address>` These commands allow operators to configure static MAC address entries in the FBOSS switch configuration, which is useful for scenarios where MAC addresses need to be pinned to specific ports. Features: * VLAN ID validation (1-4094 range) * MAC address format validation * Port existence validation with automatic logical ID resolution * Duplicate entry detection for add operations * Integration with ConfigSession for proper config management Unit Tests: ``` ./fboss/oss/scripts/nhfboss-test.sh --timeout 30 --retry 0 --filter 'CmdConfigVlanStaticMac' Output: [==========] Running 33 tests from 1 test suite. ... [ PASSED ] 33 tests. ``` Manual CLI Testing: ``` $ fboss2-dev config vlan 2001 static-mac add 02:00:00:E2:E2:01 eth1/1/1 Successfully added static MAC entry: MAC 02:00:00:E2:E2:01 -> VLAN 2001, Port eth1/1/1 (ID 9) $ fboss2-dev config session commit Config session committed successfully as r77 and config reloaded. $ fboss2-dev config vlan 2001 static-mac delete 02:00:00:E2:E2:01 Successfully deleted static MAC entry: MAC 02:00:00:E2:E2:01 from VLAN 2001 ```
Add a new fboss2 show command that retrieves the running configuration
from the agent via the `getRunningConfig()` Thrift API and displays it
as nicely formatted JSON.
This is useful when the config file on disk is missing or out of sync
with the running agent configuration.
Added unit test CmdShowRunningConfigTest that mocks the getRunningConfig
thrift API.
```
[admin@fboss101 ~]$ fboss2 show running-config
{
"sw": {
"version": 0,
"ports": [
{
"logicalID": 1,
"speed": "HUNDREDG",
"name": "eth1/1/1",
...
}
],
...
}
}
```
NOS-4057 #done
9d484eb to
aea6fb0
Compare
meta-codesync bot
pushed a commit
that referenced
this pull request
Mar 6, 2026
Summary: Add new fboss2-dev CLI commands for managing static MAC address entries on VLANs: - `config vlan <vlan-id> static-mac add <mac-address> <port-id>` - `config vlan <vlan-id> static-mac delete <mac-address>` These commands allow operators to configure static MAC address entries in the FBOSS switch configuration, which is useful for scenarios where MAC addresses need to be pinned to specific ports. Features: * VLAN ID validation (1-4094 range) * MAC address format validation * Port existence validation with automatic logical ID resolution * Duplicate entry detection for add operations * Integration with ConfigSession for proper config management Unit tests: ``` /var/FBOSS/tmp_bld_dir/build/fboss/fboss2_cmd_config_test --gtest_filter='CmdConfigVlanStaticMacTestFixture.*' Output: [==========] Running 31 tests from 1 test suite. ... [ PASSED ] 31 tests. ``` Note: this change is part of a series, the previous one is #832, the next one is #838. ## Sample usage ``` $ fboss2-dev config vlan 2001 static-mac add 02:00:00:E2:E2:01 eth1/1/1 Successfully added static MAC entry: MAC 02:00:00:E2:E2:01 -> VLAN 2001, Port eth1/1/1 (ID 9) $ fboss2-dev config session commit Config session committed successfully as r77 and config reloaded. $ fboss2-dev config vlan 2001 static-mac delete 02:00:00:E2:E2:01 Successfully deleted static MAC entry: MAC 02:00:00:E2:E2:01 from VLAN 2001 ``` Original change by manoharan-nexthop Pull Request resolved: #837 Reviewed By: srikrishnagopu Differential Revision: D95454566 Pulled By: joseph5wu fbshipit-source-id: fb224affbe826d0d13f0e8011a28b408983c9d04
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.
Pre-submission checklist
pip install -r requirements-dev.txt && pre-commit installpre-commit runAdd a new fboss2 show command that retrieves the running configuration
from the agent via the
getRunningConfig()Thrift API and displays itas nicely formatted JSON.
This is useful when the config file on disk is missing or out of sync
with the running agent configuration.
Note: this change is part of a series, the previous one is #837, the next one is #843.
Test Plan
Added unit test CmdShowRunningConfigTest that mocks the getRunningConfig
thrift API.
Sample usage