Skip to content

Commit 95ce319

Browse files
authored
Added vni field in VRF Yang for VxLAN L3 VNI Support #13456 (#13735)
Why I did it Added vni field in VRF Yang for VxLAN L3 VNI Support. The VRF table schema as per EVPN HLD is below https://github.com/sonic-net/SONiC/blob/master/doc/vxlan/EVPN/EVPN_VXLAN_HLD.md Addresses Issue #13456
1 parent ee1b6b3 commit 95ce319

File tree

5 files changed

+41
-1
lines changed

5 files changed

+41
-1
lines changed

src/sonic-yang-models/doc/Configuration.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -1883,6 +1883,7 @@ table allow to change properties of a virtual router. Attributes:
18831883
packets with IP options
18841884
- 'l3_mc_action' contains packet action. Defines the action for
18851885
unknown L3 multicast packets
1886+
- 'vni' contains L3 VNI value. VNI associated Virtual router instance.
18861887

18871888
The packet action could be:
18881889

@@ -1904,7 +1905,8 @@ The packet action could be:
19041905
'src_mac': '02:04:05:06:07:08',
19051906
'ttl_action': 'copy',
19061907
'ip_opt_action': 'deny',
1907-
'l3_mc_action': 'drop'
1908+
'l3_mc_action': 'drop',
1909+
'vni': '100'
19081910
}
19091911
```
19101912

src/sonic-yang-models/tests/files/sample_config_db.json

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"SAMPLE_CONFIG_DB_JSON": {
33
"VRF": {
44
"Vrf_blue": {
5+
"vni" : "100"
56
}
67
},
78
"DHCP_SERVER": {

src/sonic-yang-models/tests/yang_model_tests/tests/vrf.json

+7
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,12 @@
88
},
99
"VRF_TEST_WITH_FALLBACK": {
1010
"desc": "Configure VRF with fallback in VRF table."
11+
},
12+
"VRF_TEST_WITH_VNI": {
13+
"desc": "Configure VRF with VNI in VRF table."
14+
},
15+
"VRF_TEST_WITH_VNI_OOR": {
16+
"desc": "Configure VRF with out of range VNI in VRF table.",
17+
"eStrKey": "Range"
1118
}
1219
}

src/sonic-yang-models/tests/yang_model_tests/tests_config/vrf.json

+22
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,27 @@
2828
}]
2929
}
3030
}
31+
},
32+
33+
"VRF_TEST_WITH_VNI": {
34+
"sonic-vrf:sonic-vrf": {
35+
"sonic-vrf:VRF": {
36+
"VRF_LIST": [{
37+
"name": "Vrf_blue",
38+
"vni": "100"
39+
}]
40+
}
41+
}
42+
},
43+
44+
"VRF_TEST_WITH_VNI_OOR": {
45+
"sonic-vrf:sonic-vrf": {
46+
"sonic-vrf:VRF": {
47+
"VRF_LIST": [{
48+
"name": "Vrf_blue",
49+
"vni": "16777216"
50+
}]
51+
}
52+
}
3153
}
3254
}

src/sonic-yang-models/yang-models/sonic-vrf.yang

+8
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,14 @@ module sonic-vrf {
4343
"Enable/disable fallback feature which is useful for specified VRF user to access internet through global/main route.";
4444
}
4545

46+
leaf vni {
47+
type uint32 {
48+
range "0..16777215";
49+
}
50+
default 0;
51+
description
52+
"VNI mapped to VRF";
53+
}
4654
} /* end of list VRF_LISt */
4755
} /* end of container VRf */
4856
} /* end of container sonic-vrf */

0 commit comments

Comments
 (0)