diff --git a/src/sonic-yang-models/doc/Configuration.md b/src/sonic-yang-models/doc/Configuration.md index 90e0292ff8..0b850ccea7 100644 --- a/src/sonic-yang-models/doc/Configuration.md +++ b/src/sonic-yang-models/doc/Configuration.md @@ -1611,7 +1611,8 @@ These tables have a number of shared attributes as described below: "VLAN_SUB_INTERFACE": { "Ethernet0.555": { "vrf_name": "Blue", - "vlan": "555" + "vlan": "555", + "ipv6_use_link_local_only": "enable" } } } diff --git a/src/sonic-yang-models/tests/files/sample_config_db.json b/src/sonic-yang-models/tests/files/sample_config_db.json index 3f683c3b99..99927ef909 100644 --- a/src/sonic-yang-models/tests/files/sample_config_db.json +++ b/src/sonic-yang-models/tests/files/sample_config_db.json @@ -1280,7 +1280,8 @@ "VLAN_SUB_INTERFACE": { "Ethernet12.10": { "admin_status": "up", - "loopback_action": "drop" + "loopback_action": "drop", + "ipv6_use_link_local_only": "enable" }, "Ethernet12.10|10.0.1.56/31": {}, "Ethernet12.10|fc00::1:71/126": {}, diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/vlan_sub_interface.json b/src/sonic-yang-models/tests/yang_model_tests/tests/vlan_sub_interface.json index 2806d006a8..c78574049d 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests/vlan_sub_interface.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests/vlan_sub_interface.json @@ -71,7 +71,14 @@ "desc": "Configure PortChannel VLAN sub interface with VNET reference." }, "VLAN_SUB_INTERFACE_WITH_MISSING_VNET": { - "desc": "Configure VLAN sub interface with VNET reference but no VNET exsiting.", + "desc": "Configure VLAN sub interface with VNET reference but no VNET existing.", "eStrKey": "LeafRef" + }, + "VLAN_SUB_INTERFACE_ENABLE_IPV6_LINK_LOCAL": { + "desc": "Configure VLAN sub interface with ipv6_use_link_local_only enabled." + }, + "VLAN_SUB_INTERFACE_INVALID_IPV6_LINK_LOCAL": { + "desc": "Configure VLAN sub interface with an invalid ipv6_use_link_local_only value.", + "eStr": "Invalid value \"true\" in \"ipv6_use_link_local_only\" element." } } diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/vlan_sub_interface.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/vlan_sub_interface.json index 36371e691d..64a2b48313 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/vlan_sub_interface.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/vlan_sub_interface.json @@ -779,5 +779,59 @@ ] } } + }, + "VLAN_SUB_INTERFACE_ENABLE_IPV6_LINK_LOCAL": { + "sonic-vlan-sub-interface:sonic-vlan-sub-interface": { + "sonic-vlan-sub-interface:VLAN_SUB_INTERFACE": { + "VLAN_SUB_INTERFACE_LIST": [ + { + "name": "Ethernet8.10", + "ipv6_use_link_local_only": "enable" + } + ] + } + }, + "sonic-port:sonic-port": { + "sonic-port:PORT": { + "PORT_LIST": [ + { + "name": "Ethernet8", + "admin_status": "up", + "alias": "Ethernet8/1", + "description": "Ethernet8", + "lanes": "45,46,47,48", + "mtu": 9000, + "speed": 100000 + } + ] + } + } + }, + "VLAN_SUB_INTERFACE_INVALID_IPV6_LINK_LOCAL": { + "sonic-vlan-sub-interface:sonic-vlan-sub-interface": { + "sonic-vlan-sub-interface:VLAN_SUB_INTERFACE": { + "VLAN_SUB_INTERFACE_LIST": [ + { + "name": "Ethernet8.10", + "ipv6_use_link_local_only": "true" + } + ] + } + }, + "sonic-port:sonic-port": { + "sonic-port:PORT": { + "PORT_LIST": [ + { + "name": "Ethernet8", + "admin_status": "up", + "alias": "Ethernet8/1", + "description": "Ethernet8", + "lanes": "45,46,47,48", + "mtu": 9000, + "speed": 100000 + } + ] + } + } } } diff --git a/src/sonic-yang-models/yang-models/sonic-vlan-sub-interface.yang b/src/sonic-yang-models/yang-models/sonic-vlan-sub-interface.yang index 720cc84355..edeb330ad3 100644 --- a/src/sonic-yang-models/yang-models/sonic-vlan-sub-interface.yang +++ b/src/sonic-yang-models/yang-models/sonic-vlan-sub-interface.yang @@ -28,9 +28,13 @@ module sonic-vlan-sub-interface { description "VLAN sub interface for SONiC OS"; - revision 2025-03-06 { - description "Add leaf vnet_name"; - } + revision 2026-07-20 { + description "Add leaf ipv6_use_link_local_only"; + } + + revision 2025-03-06 { + description "Add leaf vnet_name"; + } revision 2021-11-11 { description "Initial version"; @@ -89,6 +93,12 @@ module sonic-vlan-sub-interface { } } + leaf ipv6_use_link_local_only { + description "Enable/Disable IPv6 link local address on vlan sub-interface"; + type stypes:mode-status; + default disable; + } + leaf loopback_action { description "Packet action when a packet ingress and gets routed on the same IP interface"; type stypes:loopback_action;