Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 54 additions & 14 deletions src/sonic-yang-models/doc/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -2827,33 +2827,73 @@ VOQ_INBAND_INTERFACE holds the name of the inband system port dedicated for cpu

### VXLAN

VXLAN_TUNNEL holds the VTEP source ip configuration.
VXLAN_TUNNEL holds the VTEP source ip configuration (maximum 2 tunnels).
VXLAN_TUNNEL_MAP holds the vlan to vni and vni to vlan mapping configuration.
VXLAN_EVPN_NVO holds the VXLAN_TUNNEL object to be used for BGP-EVPN discovered tunnels.

Single tunnel example:
```
{
"VXLAN_TUNNEL": {
"VXLAN_TUNNEL": {
"vtep1": {
"src_ip": "10.10.10.10",
"dst_ip": "12.12.12.12"
}
}
"VXLAN_TUNNEL_MAP" : {
},
"VXLAN_TUNNEL_MAP": {
"vtep1|map_1000_Vlan100": {
"vni": "1000",
"vlan": "100"
},
"vtep1|testmap": {
"vni": "22000",
"vlan": "70"
},
}
"VXLAN_EVPN_NVO": {
"vni": "1000",
"vlan": "100"
},
"vtep1|map_22000_Vlan70": {
"vni": "22000",
"vlan": "70"
}
},
"VXLAN_EVPN_NVO": {
"nvo1": {
"source_vtep": "vtep1"
}
}
}
}
```

Dual tunnel example:
```
{
"VXLAN_TUNNEL": {
"vtep1": {
"src_ip": "10.10.10.10",
"dst_ip": "12.12.12.12"
},
"vtep2": {
"src_ip": "10.20.10.10",
"dst_ip": "20.20.20.20"
}
},
"VXLAN_TUNNEL_MAP": {
"vtep1|map_1000_Vlan100": {
"vni": "1000",
"vlan": "100"
},
"vtep1|map_22000_Vlan70": {
"vni": "22000",
"vlan": "70"
},
"vtep2|map_2000_Vlan200": {
"vni": "2000",
"vlan": "200"
},
"vtep2|map_3000_Vlan300": {
"vni": "3000",
"vlan": "300"
}
},
"VXLAN_EVPN_NVO": {
"nvo1": {
"source_vtep": "vtep1"
}
}
}
```

Expand Down
23 changes: 15 additions & 8 deletions src/sonic-yang-models/tests/yang_model_tests/tests/vxlan.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,26 @@
"VXLAN_TUNNEL_NAME_VALID_TEST": {
"desc": "Tunnel Name string length 15 is valid"
},
"VXLAN_TUNNEL_NAME_INVALID_LENGTH_TEST": {
"desc": "Tunnel Name string length exceeding 16 is invalid",
"eStr" : "Invalid interface name length, it must not exceed 16 characters."
"VXLAN_TUNNEL_NAME_LONG_VALID_TEST": {
"desc": "Tunnel Name string length exceeding 16 is now valid"
},
"VXLAN_TUNNEL_NAME_INVALID_TEST": {
"desc": "Tunnel Name string length 0 is invalid",
"eStr" : "Invalid interface name length, it must not exceed 16 characters."
"VXLAN_TUNNEL_NAME_EMPTY_VALID_TEST": {
"desc": "Tunnel Name string length 0 is valid"
},
"VXLAN_TUNNEL_NAME_VALID_DST_IPV4_TEST": {
"desc": "Valid IPv4 Destination Address",
"eStr" : "Invalid interface name length, it must not exceed 16 characters."
"desc": "Valid IPv4 Destination Address"
},
"VXLAN_TUNNEL_NAME_VALID_DST_IPV6_TEST": {
"desc": "Valid IPv6 Destination Address"
},
"VXLAN_TUNNEL_MAX_ELEM_VALID_TEST": {
"desc": "Valid config with 2 VXLAN_TUNNEL entries"
},
"VXLAN_TUNNEL_MAX_ELEM_INVALID_TEST": {
"desc": "Invalid config with more than 2 VXLAN_TUNNEL entries",
"eStrKey": "MaxElements"
},
"VXLAN_TUNNEL_NAME_STRING_VALID_TEST": {
"desc": "Tunnel name as arbitrary string is valid"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@
}
}
},
"VXLAN_TUNNEL_NAME_INVALID_LENGTH_TEST": {
"VXLAN_TUNNEL_NAME_LONG_VALID_TEST": {
"sonic-vlan:sonic-vlan": {
"sonic-vlan:VLAN": {
"VLAN_LIST": [
Expand Down Expand Up @@ -227,7 +227,7 @@
}
}
},
"VXLAN_TUNNEL_NAME_INVALID_TEST": {
"VXLAN_TUNNEL_NAME_EMPTY_VALID_TEST": {
"sonic-vlan:sonic-vlan": {
"sonic-vlan:VLAN": {
"VLAN_LIST": [
Expand Down Expand Up @@ -321,5 +321,35 @@
]
}
}
},
"VXLAN_TUNNEL_MAX_ELEM_VALID_TEST": {
"sonic-vxlan:sonic-vxlan": {
"sonic-vxlan:VXLAN_TUNNEL": {
"VXLAN_TUNNEL_LIST": [
{ "name": "vtep1", "src_ip": "1.2.3.4" },
{ "name": "vtep2", "src_ip": "2.3.4.5" }
]
}
}
},
"VXLAN_TUNNEL_MAX_ELEM_INVALID_TEST": {
"sonic-vxlan:sonic-vxlan": {
"sonic-vxlan:VXLAN_TUNNEL": {
"VXLAN_TUNNEL_LIST": [
{ "name": "vtep1", "src_ip": "1.2.3.4" },
{ "name": "vtep2", "src_ip": "2.3.4.5" },
{ "name": "vtep3", "src_ip": "3.4.5.6" }
]
}
}
},
"VXLAN_TUNNEL_NAME_STRING_VALID_TEST": {
"sonic-vxlan:sonic-vxlan": {
"sonic-vxlan:VXLAN_TUNNEL": {
"VXLAN_TUNNEL_LIST": [
{ "name": "arbitrary_string", "src_ip": "5.6.7.8" }
]
}
}
}
}
4 changes: 2 additions & 2 deletions src/sonic-yang-models/yang-models/sonic-vxlan.yang
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ module sonic-vxlan {
list VXLAN_TUNNEL_LIST {

key "name";
max-elements 1;
max-elements 2;

leaf name {
type stypes:interface_name;
type string;
}

leaf src_ip {
Expand Down
Loading