From b68492615b9a617e40576b1a30a2bf7f349000ad Mon Sep 17 00:00:00 2001 From: Sudharsan Dhamal Gopalarathnam Date: Tue, 21 Mar 2023 04:35:45 -0700 Subject: [PATCH] [yang]Updating vxlan yang model to include IPv6 source in VxLAN tunnel (#14363) - Why I did it Update VxLAN yang model to include IPv6 source in VxLAN tunnel. The src_ip field can include both ipv4 as well as ipv6 address - How I did it Updated yang model. - How to verify it Added UT to verify --- .../tests/yang_model_tests/tests/vxlan.json | 3 ++ .../yang_model_tests/tests_config/vxlan.json | 39 +++++++++++++++++++ .../yang-models/sonic-vxlan.yang | 2 +- 3 files changed, 43 insertions(+), 1 deletion(-) diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/vxlan.json b/src/sonic-yang-models/tests/yang_model_tests/tests/vxlan.json index 6bb0507fb050..880d0c015d0c 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests/vxlan.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests/vxlan.json @@ -2,6 +2,9 @@ "VXLAN_VALID_TEST": { "desc": "Valid VXLAN Configuration." }, + "VXLAN_VALID_V6_TUNNEL_TEST": { + "desc": "Valid VXLAN V6 Configuration." + }, "VXLAN_EVPN_NVO_WITHOUT_VTEP": { "desc": "Configure EVPN_NVO without VXLAN_TUNNEL entry", "eStrKey" : "LeafRef" diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/vxlan.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/vxlan.json index 90e71063cb24..117d626ca4c2 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/vxlan.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/vxlan.json @@ -38,6 +38,45 @@ } } }, + "VXLAN_VALID_V6_TUNNEL_TEST": { + "sonic-vlan:sonic-vlan": { + "sonic-vlan:VLAN": { + "VLAN_LIST": [ + { + "name": "Vlan100" + } + ] + } + }, + "sonic-vxlan:sonic-vxlan": { + "sonic-vxlan:VXLAN_TUNNEL": { + "VXLAN_TUNNEL_LIST": [ + { + "name": "vtep1", + "src_ip": "2001::1:2:3:4" + } + ] + }, + "sonic-vxlan:VXLAN_EVPN_NVO": { + "VXLAN_EVPN_NVO_LIST": [ + { + "name": "nvo1", + "source_vtep": "vtep1" + } + ] + }, + "sonic-vxlan:VXLAN_TUNNEL_MAP": { + "VXLAN_TUNNEL_MAP_LIST": [ + { + "name": "vtep1", + "mapname": "map_100_Vlan100", + "vlan": "Vlan100", + "vni": "100" + } + ] + } + } + }, "VXLAN_EVPN_NVO_WITHOUT_VTEP": { "sonic-vxlan:sonic-vxlan": { "sonic-vxlan:VXLAN_EVPN_NVO": { diff --git a/src/sonic-yang-models/yang-models/sonic-vxlan.yang b/src/sonic-yang-models/yang-models/sonic-vxlan.yang index fc23ea9141a0..bad6111b35a8 100644 --- a/src/sonic-yang-models/yang-models/sonic-vxlan.yang +++ b/src/sonic-yang-models/yang-models/sonic-vxlan.yang @@ -60,7 +60,7 @@ module sonic-vxlan { } leaf src_ip { - type inet:ipv4-address; + type inet:ip-address; } } }