Skip to content

frr-mgmt-framework, YANG: add IPv6 ND/RA support for VLAN_INTERFACE#26872

Open
zedzean wants to merge 1 commit intosonic-net:masterfrom
zedzean:zaahir/vlan-interface-ipv6-nd-ra
Open

frr-mgmt-framework, YANG: add IPv6 ND/RA support for VLAN_INTERFACE#26872
zedzean wants to merge 1 commit intosonic-net:masterfrom
zedzean:zaahir/vlan-interface-ipv6-nd-ra

Conversation

@zedzean
Copy link
Copy Markdown

@zedzean zedzean commented Apr 17, 2026

Why I did it

There is no ConfigDB-native mechanism to configure IPv6 Neighbor Discovery / Router Advertisement parameters on VLAN interfaces in SONiC today. The only way to apply ipv6 nd suppress-ra, ipv6 nd managed-config-flag, ipv6 nd other-config-flag, or ipv6 nd ra-interval <N> to an SVI is to issue vtysh commands manually, which do not persist and are outside the frrcfgd management framework.

This change aligns with the direction proposed in SONiC HLD #2165 (OpenConfig Interfaces Router Advertisement, targeted at the 202605 release) by adding the three interface-level flag leaves to VLAN_INTERFACE_LIST and implementing the frrcfgd translation to zebra interface-context commands.

A fourth leaf (nd_ra_interval) is added as a SONiC-native extension. It has no OpenConfig mapping in the current HLD but is useful for the common operational case of tuning the unsolicited RA cadence. Reviewers: if you'd
prefer this deferred to a separate PR until it lands in the HLD, please say so and I'll split the patch.

How I did it

YANG (sonic-vlan.yang): added four new leaves to VLAN_INTERFACE_LIST:

Leaf Type OpenConfig mapping
nd_suppress_ra boolean router-advertisement/config/suppress
nd_managed_config_flag boolean router-advertisement/config/managed
nd_other_config_flag boolean router-advertisement/config/other-config
nd_ra_interval uint32 range 1..1800 (none - extension)

A new revision entry was added to the yang file.

frrcfgd (frrcfgd.py): subscribed to the VLAN_INTERFACE table, introduced a vlan_intf_nd_key_map using the standard {no:no-prefix} convention established by PR #21697 (hdl_admin_status style). Interface-context command dispatch follows the existing PIM_INTERFACE / IGMP_INTERFACE pattern.

DELETE semantics restore per-flag FRR defaults rather than blindly emitting no <cmd>. Two handler variants make this explicit:
hdl_nd_flag_default_on (used for suppress-ra whose FRR default is enabled on non-P2P interfaces) and hdl_nd_flag_default_off (used for the M/O flags whose FRR default is disabled). This keeps the observable behaviour symmetric: creating then deleting a VLAN_INTERFACE entry leaves the interface in the same state as if the entry had never existed.

How to verify it

# Apply the config via apply-patch (full yang validation)
cat > /tmp/ra.json <<JSON
[
  {"op": "add", "path": "/VLAN_INTERFACE/Vlan100/nd_suppress_ra", "value": "false"},
  {"op": "add", "path": "/VLAN_INTERFACE/Vlan100/nd_managed_config_flag", "value": "true"},
  {"op": "add", "path": "/VLAN_INTERFACE/Vlan100/nd_ra_interval", "value": "30"}
]
JSON
sudo config apply-patch /tmp/ra.json

# Verify resulting FRR configuration
docker exec bgp vtysh -c 'show running-config' | grep -A6 '^interface Vlan100$'
# interface Vlan100
#  ipv6 nd managed-config-flag
#  ipv6 nd ra-interval 30
#  no ipv6 nd suppress-ra
# exit

Yang validation rejects invalid input:

# Invalid boolean
sudo config apply-patch '[{"op":"add","path":"/VLAN_INTERFACE/Vlan100/nd_suppress_ra","value":"garbage"}]'
# libyang: Invalid value "garbage" in "nd_suppress_ra" element.

# Out-of-range interval
sudo config apply-patch '[{"op":"add","path":"/VLAN_INTERFACE/Vlan100/nd_ra_interval","value":"99999"}]'
# Invalid IPv6 ND RA interval (expected range: 1..1800 seconds)

DELETE restores the FRR default:

sudo config apply-patch '[
  {"op":"remove","path":"/VLAN_INTERFACE/Vlan100/nd_suppress_ra"},
  {"op":"remove","path":"/VLAN_INTERFACE/Vlan100/nd_managed_config_flag"},
  {"op":"remove","path":"/VLAN_INTERFACE/Vlan100/nd_ra_interval"}
]'
docker exec bgp vtysh -c 'show running-config' | grep -A3 '^interface Vlan100$' || echo "(interface reverted to default)"

Tested on SONiC in unified routing config mode with FRR 10.4.1 on a
top-of-rack switch. Full test matrix (19 tests: 9 direct ConfigDB writes,
3 delete-semantics checks, 7 apply-patch end-to-end) passes.

Which release branch to backport (provide reason below if selected)

  • 202205
  • 202211
  • 202305
  • 202311
  • 202405
  • 202411
  • 202505

Tested branch (Please provide the tested image version)

Description for the changelog

frr-mgmt-framework, YANG: add IPv6 ND/RA support for VLAN_INTERFACE

Link to config_db schema for YANG module changes

See HLD sonic-net/SONiC#2165 for the schema spec.

A picture of a cute animal (not mandatory but encouraged)

cat

@linux-foundation-easycla
Copy link
Copy Markdown

linux-foundation-easycla bot commented Apr 17, 2026

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: zedzean / name: Zaahir Ahmed Syed (05622c4)

@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Add support for IPv6 Neighbor Discovery / Router Advertisement configuration
on VLAN interfaces via ConfigDB. Aligned with HLD PR sonic-net/SONiC#2165.

Three interface-level flag leaves are added to VLAN_INTERFACE_LIST with
OpenConfig mapping specified in the HLD:
  * nd_suppress_ra         -> oc-ip:router-advertisement/config/suppress
  * nd_managed_config_flag -> oc-ip:router-advertisement/config/managed
  * nd_other_config_flag   -> oc-ip:router-advertisement/config/other-config

A fourth leaf (nd_ra_interval) is added as an extension with no OpenConfig
mapping in the current HLD, bounded to the FRR-supported range of 1..1800
seconds.

frrcfgd translates each ConfigDB field to the equivalent FRR vtysh command
in the interface context, using the standard {no:no-prefix} convention from
PR sonic-net#21697 (admin_status handler). DELETE events
restore the per-flag FRR default via two handler variants
(hdl_nd_flag_default_on and hdl_nd_flag_default_off) so the interface ends
up in the same state as if the ConfigDB entry had never existed.

Tests added:
  * tests/yang_model_tests/tests/vlan_interface.json (10 cases: 5 positive,
    4 negative, 1 combined)
  * tests/yang_model_tests/tests_config/vlan_interface.json
  * tests/files/sample_config_db.json updated with ND fields on Vlan111

Signed-off-by: Zaahir Ahmed Syed <zaahir@cloudflare.com>
@zedzean zedzean force-pushed the zaahir/vlan-interface-ipv6-nd-ra branch from 3dd8e4f to 05622c4 Compare April 17, 2026 09:14
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

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