Skip to content
Open
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
22 changes: 22 additions & 0 deletions src/sonic-yang-models/doc/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
* [VLAN](#vlan)
* [VLAN_MEMBER](#vlan_member)
* [VNET](#vnet)
* [VNET_ROUTE](#vnet_route)
* [VNET_ROUTE_TUNNEL](#vnet_route_tunnel)
* [VOQ Inband Interface](#voq-inband-interface)
* [VXLAN](#vxlan)
Expand Down Expand Up @@ -2737,6 +2738,27 @@ monitoring sessions for the vnet routes and is optional.
}
```

### VNET_ROUTE

VNET_ROUTE table has vnet_name|prefix as the object key, where vnet_name is the name of the VNet and prefix is the ip4 prefix associated with the vnet route. The table includes the following attributes:
- NEXTHOP: Comma-separated nexthop IPs (mandatory). They are used to identify the nexthops of the vnet route.
- IFNAME: The interface names (mandatory), such as "Ethernet1". It identifies the outgoing interfaces for the vnet route.

```
{
"VNET_ROUTE": {
"Vnet_2000|100.100.3.0/24": {
"nexthop": "100.100.3.1,100.100.3.2",
"ifname": "Ethernet1,Ethernet2"
},
"Vnet_3000|100.100.4.0/24": {
"nexthop": "100.100.4.1",
"ifname": "Ethernet2"
}
}
}
```

### VNET_ROUTE_TUNNEL

VNET_ROUTE_TUNNEL table has vnet_name|prefix as the object key, where vnet_name is the name of the VNet and prefix is the ip4 prefix associated with the route tunnel. The table includes the following attributes:
Expand Down
6 changes: 6 additions & 0 deletions src/sonic-yang-models/tests/files/sample_config_db.json
Original file line number Diff line number Diff line change
Expand Up @@ -2404,6 +2404,12 @@
"overlay_dmac": "22:33:44:55:66:77"
}
},
"VNET_ROUTE": {
"vnet1|100.100.4.0/24": {
"nexthop": "100.100.4.1,100.100.4.2",
"ifname": "Ethernet1,Ethernet2"
}
},
"VNET_ROUTE_TUNNEL" : {
"vnet1|10.0.0.0/24" : {
"endpoint": "192.168.1.1,192.168.1.2",
Expand Down
42 changes: 42 additions & 0 deletions src/sonic-yang-models/tests/yang_model_tests/tests/vnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,48 @@
"desc": "Missing Vxlan_TUNNEL configuration",
"eStr" : [ "points to a non-existing leaf" ]
},
"VNET_ROUTE_VALID_TEST": {
"desc": "Valid VNET Route Configuration."
},
"VNET_ROUTE_MULTI_TEST": {
"desc": "Multiple VNET route configurations for different VNETs in VNET_ROUTE_LIST table."
},
"VNET_ROUTE_TEST_DUPLICATE_NAME": {
"desc": "VNET route configuration with duplicate name keys in VNET_ROUTE_LIST table.",
"eStr": "Duplicated instance of \"VNET_ROUTE_LIST\" list."
},
"VNET_ROUTE_TEST_INVALID_NEXTHOP": {
"desc": "VNET route configuration with invalid nexthop IP value (256.256.256.256) in VNET_ROUTE_LIST table.",
"eStrKey": "Pattern"
},
"VNET_ROUTE_TEST_INVALID_NAME_FORMAT": {
"desc": "VNET route configuration with invalid name format (missing prefix) in VNET_ROUTE_LIST table.",
"eStrKey": "ListKey"
},
"VNET_ROUTE_TEST_INVALID_PREFIX": {
"desc": "VNET route configuration with invalid prefix format (300.100.4.0/24) in name field.",
"eStrKey": "Pattern"
},
"VNET_ROUTE_TEST_MISSING_NEXTHOP": {
"desc": "VNET route configuration with missing mandatory attribute (nexthop) in VNET_ROUTE_LIST table.",
"eStrKey": "Mandatory"
},
"VNET_ROUTE_TEST_MISSING_INTERFACE": {
"desc": "VNET route configuration with missing mandatory attribute (interface) in VNET_ROUTE_LIST table.",
"eStrKey": "Mandatory"
},
"VNET_ROUTE_TEST_NONEXISTENT_VNET": {
"desc": "VNET route configuration referencing a non-existent VNET name, violating the must condition.",
"eStrKey" : "LeafRef"
},
"VNET_ROUTE_TEST_MULTI_NEXTHOP_INTERFACE": {
"desc": "VNET route configuration with multiple comma-separated nexthop IPs and interfaces in VNET_ROUTE_LIST table."
},
"VNET_ROUTE_TEST_INVALID_MULTI_NEXTHOP": {
"desc": "VNET route configuration with invalid IP in comma-separated nexthop list.",
"eStrKey": "Pattern"
},

"VNET_ROUTE_TUNNEL_MIN_TEST": {
"desc": "Basic VNET route tunnel configuration with minimal required field - endpoint in VNET_ROUTE_TUNNEL_LIST table."
},
Expand Down
Loading
Loading