diff --git a/src/sonic-yang-models/doc/Configuration.md b/src/sonic-yang-models/doc/Configuration.md index 9a924bdc3113..efb65f7bb5ca 100644 --- a/src/sonic-yang-models/doc/Configuration.md +++ b/src/sonic-yang-models/doc/Configuration.md @@ -23,7 +23,8 @@ Table of Contents * [Data Plane L3 Interfaces](#data-plane-l3-interfaces) * [DEFAULT_LOSSLESS_BUFFER_PARAMETER](#DEFAULT_LOSSLESS_BUFFER_PARAMETER) * [Device Metadata](#device-metadata) - * [Device neighbor metada](#device-neighbor-metada) + * [Device neighbor metada](#device-neighbor-metada) + * [DHCP_RELAY](#dhcp_relay) * [DSCP_TO_TC_MAP](#dscp_to_tc_map) * [FLEX_COUNTER_TABLE](#flex_counter_table) * [KDUMP](#kdump) @@ -832,6 +833,22 @@ instance is supported in SONiC. ``` +### DHCP_RELAY + +``` +{ +"DHCP_RELAY": { + "dhcpv6_servers": [ + "fc02:2000::1", + "fc02:2000::2", + "fc02:2000::3", + "fc02:2000::4" + ], + "rfc6939_support": "true", + "interface_id": "true" +} + +``` ### DSCP_TO_TC_MAP ``` 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 47cc0103b758..3aa53a97a80c 100644 --- a/src/sonic-yang-models/tests/files/sample_config_db.json +++ b/src/sonic-yang-models/tests/files/sample_config_db.json @@ -1534,13 +1534,15 @@ "dhcpv6_servers": [ "2a04:5555:41::11" ], - "rfc6939_support": "true" + "rfc6939_support": "true", + "interface_id": "true" }, "Vlan777": { "dhcpv6_servers": [ "2a04:5555:41::11" ], - "rfc6939_support": "true" + "rfc6939_support": "true", + "interface_id": "true" } }, "SCHEDULER": { diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/dhcpv6_relay.json b/src/sonic-yang-models/tests/yang_model_tests/tests/dhcpv6_relay.json index 318a5eb7682b..fb05271f99b4 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests/dhcpv6_relay.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests/dhcpv6_relay.json @@ -5,5 +5,9 @@ }, "DHCPV6_SERVER_VALID_FORMAT": { "desc": "Add dhcpv6_server in correct format." + }, + "DHCPv6_OPTION_WITH_INVALID_BOOLEAN_TYPE": { + "desc": "Add dhcpv6 option with invalid option boolean types.", + "eStrKey": "Pattern" } } diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/dhcpv6_relay.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/dhcpv6_relay.json index 68c077e51e91..3a8dc377c470 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/dhcpv6_relay.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/dhcpv6_relay.json @@ -76,11 +76,25 @@ "2001:1::2" ], "rfc6939_support": "true", - + "name": "Vlan400", + "interface_id": "true", "name": "Vlan400" } ] } } + }, + "DHCPv6_OPTION_WITH_INVALID_BOOLEAN_TYPE": { + "sonic-dhcpv6-relay:sonic-dhcpv6-relay": { + "sonic-dhcpv6-relay:DHCP_RELAY": { + "DHCP_RELAY_LIST": [ + { + "name": "Vlan500", + "rfc6939_support": "False", + "interface_id": "False" + } + ] + } + } } } diff --git a/src/sonic-yang-models/yang-models/sonic-dhcpv6-relay.yang b/src/sonic-yang-models/yang-models/sonic-dhcpv6-relay.yang index f1e73397dff4..16977fb2921e 100644 --- a/src/sonic-yang-models/yang-models/sonic-dhcpv6-relay.yang +++ b/src/sonic-yang-models/yang-models/sonic-dhcpv6-relay.yang @@ -34,15 +34,24 @@ module sonic-dhcpv6-relay { type string; } - leaf-list dhcpv6_servers { - description "Configure the dhcp v6 servers"; - type inet:ipv6-address; - } - - leaf rfc6939_support { - description "Set rfc6939 for the relay"; - type boolean; - } + leaf-list dhcpv6_servers { + description "Configure the dhcp v6 servers"; + type inet:ipv6-address; + } + + leaf rfc6939_support { + description "Set rfc6939 for the relay"; + type string { + pattern "false|true"; + } + } + + leaf interface_id { + description "Enable interface ID insertion in relayed messages"; + type string { + pattern "false|true"; + } + } } /* end of VLAN_LIST */ }