Create a cluster-scoped or SVM-scoped static route
Creates a static route at the cluster or SVM level to manage packet routing within your network. Use it to define how packets are directed through specific gateways for efficient network traffic handling.
HTTP method and endpoint
POST /network/ip/routes
Introduced in
ONTAP 9.6
Usage notes
Creates a Cluster-scoped or SVM-scoped static route.
Required properties
-
gateway- IP address to route packets to. -
SVM-scoped routes
-
svm.nameorsvm.uuid- SVM that route is applied to.
-
-
cluster-scoped routes
-
There are no additional required fields for Cluster-scoped routes.
-
Default property values
If not specified in POST, the following default property values are assigned:
-
destination- 0.0.0.0/0 for IPv4 or ::/0 for IPv6. -
ipspace.name-
Default for Cluster-scoped routes.
-
Name of the SVM's IPspace for SVM-scoped routes.
-
-
metric- 20.
Related ONTAP commands
-
network route create
Parameters
| Name | Type | In | Required | Description |
|---|---|---|---|---|
return_records |
boolean |
query |
False |
The default is false. If set to true, the records are returned.
|
Request Body
| Name | Type | Description |
|---|---|---|
destination |
IP information |
|
gateway |
string |
The IP address of the gateway router leading to the destination. |
interfaces |
array[interfaces] |
IP interfaces on the same subnet as the gateway. |
ipspace |
Applies to both SVM and cluster-scoped objects. Either the UUID or name may be supplied on input. |
|
metric |
integer |
Indicates a preference order between several routes to the same destination. With typical usage, the default metrics provided are adequate, there is no need to specify a metric in the route creation. |
svm |
Applies only to SVM-scoped objects. Either the UUID or name must be supplied. |
|
uuid |
string |
The UUID that uniquely identifies the route. |
Example request
{
"destination": {
"address": "10.10.10.7",
"netmask": "24"
},
"gateway": "10.1.1.1",
"interfaces": [
{
"name": "lif1",
"uuid": "1cd8a442-86d1-11e0-ae1c-123478563412"
}
],
"ipspace": {
"name": "Default",
"uuid": "1cd8a442-86d1-11e0-ae1c-123478563412"
},
"svm": {
"name": "svm1",
"uuid": "02c9e252-41be-11e9-81d5-00a0986138f7"
},
"uuid": "1cd8a442-86d1-11e0-ae1c-123478563412"
}
Response
Status: 201, Created
| Name | Type | Description |
|---|---|---|
num_records |
integer |
Number of records |
records |
array[network_route] |
Example response
{
"num_records": 1,
"records": [
{
"destination": {
"address": "10.10.10.7",
"netmask": "24"
},
"gateway": "10.1.1.1",
"interfaces": [
{
"name": "lif1",
"uuid": "1cd8a442-86d1-11e0-ae1c-123478563412"
}
],
"ipspace": {
"name": "Default",
"uuid": "1cd8a442-86d1-11e0-ae1c-123478563412"
},
"svm": {
"name": "svm1",
"uuid": "02c9e252-41be-11e9-81d5-00a0986138f7"
},
"uuid": "1cd8a442-86d1-11e0-ae1c-123478563412"
}
]
}
Headers
| Name | Description | Type |
|---|---|---|
Location |
Useful for tracking the resource location |
string |
Error
Status: Default
ONTAP Error Response Codes
| Error Code | Description |
|---|---|
1966265 |
The destination and gateway must belong to the same IP address family. |
1966345 |
Duplicate route exists. |
1966505 |
The gateway address cannot be the same as a LIF address. A LIF is already configured with that IP address. |
1967080 |
The destination.address is missing. |
1967081 |
The specified SVM must exist in the specified IPspace. |
1967082 |
The specified ipspace.uuid and ipspace.name refer to different IPspaces. |
1967146 |
The specified svm.name is not valid. |
2621462 |
The specified SVM does not exist. |
2621574 |
This operation is not permitted on an SVM that is configured as the destination of a MetroCluster SVM relationship. |
2621706 |
The specified UUID and name refer to different SVMs. |
53282375 |
The specified destination is invalid. |
Also see the table of common errors in the Response body overview section of this documentation.
Definitions
See Definitions
href
| Name | Type | Description |
|---|---|---|
href |
string |
_links
ip_info
IP information
| Name | Type | Description |
|---|---|---|
address |
string |
IPv4 or IPv6 address |
netmask |
string |
Input as netmask length (16) or IPv4 mask (255.255.0.0). For IPv6, the default value is 64 with a valid range of 1 to 127. Output is always the netmask length. |
ip
IP information
interfaces
A network interface. Either UUID or name may be supplied on input.
| Name | Type | Description |
|---|---|---|
ip |
IP information |
|
name |
string |
The name of the interface. If only the name is provided, the SVM scope must be provided by the object this object is embedded in. |
uuid |
string |
The UUID that uniquely identifies the interface. |
ipspace
Applies to both SVM and cluster-scoped objects. Either the UUID or name may be supplied on input.
| Name | Type | Description |
|---|---|---|
name |
string |
IPspace name |
uuid |
string |
IPspace UUID |
svm
Applies only to SVM-scoped objects. Either the UUID or name must be supplied.
| Name | Type | Description |
|---|---|---|
name |
string |
The name of the SVM. This field cannot be specified in a PATCH method. |
uuid |
string |
The unique identifier of the SVM. This field cannot be specified in a PATCH method. |
network_route
| Name | Type | Description |
|---|---|---|
destination |
IP information |
|
gateway |
string |
The IP address of the gateway router leading to the destination. |
interfaces |
array[interfaces] |
IP interfaces on the same subnet as the gateway. |
ipspace |
Applies to both SVM and cluster-scoped objects. Either the UUID or name may be supplied on input. |
|
metric |
integer |
Indicates a preference order between several routes to the same destination. With typical usage, the default metrics provided are adequate, there is no need to specify a metric in the route creation. |
svm |
Applies only to SVM-scoped objects. Either the UUID or name must be supplied. |
|
uuid |
string |
The UUID that uniquely identifies the route. |
error_arguments
| Name | Type | Description |
|---|---|---|
code |
string |
Argument code |
message |
string |
Message argument |
error
| Name | Type | Description |
|---|---|---|
arguments |
array[error_arguments] |
Message arguments |
code |
string |
Error code |
message |
string |
Error message |
returned_error
| Name | Type | Description |
|---|---|---|
arguments |
array[error_arguments] |
Message arguments |
code |
string |
Error code |
message |
string |
Error message |
target |
string |
The target parameter that caused the error. |