Skip to content
Ask AI

Static Route

URLGETPOSTPATCHPUTDELETE
/rest/v1/rpc/show-ip-routeNYNNN
/rest/v1/rpc/show-ipv6-routeNYNNN
/rest/v1/running/static-routes/{vrf}/{prefix}YYYNY
/rest/v1/running/static-routes/{vrf}/{prefix}/nexthops/blackhole-nexthopNYYNY
/rest/v1/running/static-routes/{vrf}/{prefix}/nexthops/ifindex-nexthops/{nh-vrf}/{interface}NYYNY
/rest/v1/running/static-routes/{vrf}/{prefix}/nexthops/ip-ifindex-nexthops/{nh-vrf}/{gateway}/{interface}NYYNY
/rest/v1/running/static-routes/{vrf}/{prefix}/nexthops/ip-nexthops/{nh-vrf}/{gateway}NYYNY
POST HTTPS://{switch IP}/rest/v1/rpc/show-ip-route
{
"vrf": "all"
}

response:

{
"data": [
{
"prefix": "10.1.0.174/32",
"prefixLen": 32,
"protocol": "connected",
"vrfId": 0,
"vrfName": "default",
"selected": true,
"destSelected": true,
"distance": 0,
"metric": 0,
"installed": true,
"table": 254,
"internalStatus": 16,
"internalFlags": 8,
"internalNextHopNum": 1,
"internalNextHopActiveNum": 1,
"nexthopGroupId": 88,
"installedNexthopGroupId": 88,
"uptime": "2d05h13m",
"nexthops": [
{
"flags": 3,
"fib": true,
"directlyConnected": true,
"interfaceIndex": 248,
"interfaceName": "Loopback0",
"active": true
}
]
},
{
"prefix": "10.250.0.0/24",
"prefixLen": 24,
"protocol": "connected",
"vrfId": 0,
"vrfName": "default",
"selected": true,
"destSelected": true,
"distance": 0,
"metric": 0,
"installed": true,
"table": 254,
"internalStatus": 16,
"internalFlags": 8,
"internalNextHopNum": 1,
"internalNextHopActiveNum": 1,
"nexthopGroupId": 92,
"installedNexthopGroupId": 92,
"uptime": "2d05h13m",
"nexthops": [
{
"flags": 3,
"fib": true,
"directlyConnected": true,
"interfaceIndex": 2,
"interfaceName": "Mgmt0",
"active": true
}
]
},
{
"prefix": "43.0.0.0/24",
"prefixLen": 24,
"protocol": "connected",
"vrfId": 0,
"vrfName": "default",
"selected": true,
"destSelected": true,
"distance": 0,
"metric": 0,
"installed": true,
"table": 254,
"internalStatus": 16,
"internalFlags": 8,
"internalNextHopNum": 1,
"internalNextHopActiveNum": 1,
"nexthopGroupId": 188,
"installedNexthopGroupId": 188,
"uptime": "03:19:19",
"nexthops": [
{
"flags": 3,
"fib": true,
"directlyConnected": true,
"interfaceIndex": 291,
"interfaceName": "Ethernet43",
"active": true
}
]
}
]
}
POST HTTPS://{switch IP}/rest/v1/rpc/show-ipv6-route
{
"vrf": "Vrftest"
}

response:

{
"data": [
{
"prefix": "fe80::/64",
"prefixLen": 64,
"protocol": "connected",
"vrfId": 311,
"vrfName": "Vrftest",
"selected": true,
"destSelected": true,
"distance": 0,
"metric": 0,
"installed": true,
"table": 1001,
"internalStatus": 16,
"internalFlags": 8,
"internalNextHopNum": 1,
"internalNextHopActiveNum": 1,
"nexthopGroupId": 197,
"installedNexthopGroupId": 197,
"uptime": "00:44:35",
"nexthops": [
{
"flags": 3,
"fib": true,
"directlyConnected": true,
"interfaceIndex": 303,
"interfaceName": "Ethernet53:3",
"active": true
}
]
}
]
}
POST HTTPS://{switch IP}/rest/v1/running/static-routes/
{
"vrf": "Vrf200",
"prefix": "224.0.0.1/32",
"nexthops": {
"ip-ifindex-nexthops": [
{
"gateway": "50.0.0.1",
"interface": "Ethernet24"
}
]
}
}

Modify a static route with a blackhole next hop.

Section titled “Modify a static route with a blackhole next hop.”
POST HTTPS://{switch IP}/rest/v1/running/static-routes/Vrf200/10.1.1.0%2F24/nexthops/blackhole-nexthop/
{
"bh-type": "null"
}

Create an interface nexthop for static route.

Section titled “Create an interface nexthop for static route.”
POST HTTPS://{switch IP}/rest/v1/running/static-routes/Vrftest/100.0.0.0/24/nexthops/ifindex-nexthops
{
"nh-vrf": "Vrftest",
"interface": "Vlan100"
}

Modify an ip & interface nexthop for static route

Section titled “Modify an ip & interface nexthop for static route”
PATCH HTTPS://{switch IP}/rest/v1/running/static-routes/Vrf200/10.1.1.0%2F24/nexthops/ip-ifindex-nexthops/Vrf100/10.0.0.1/Ethernet24
{
"bfd": {
"enable": "true"
}
}
PATCH HTTPS://{switch IP}/rest/v1/running/static-routes/Vrf200/10.1.1.0%2F24/nexthops/ip-nexthops/default/10.0.0.1
{
"bfd": {
"enable": "true"
}
}

Tree Diagrams

+--rw static-routes
+--rw static-route* [vrf prefix]
+--rw vrf
+--rw prefix
+--rw nexthops
+--rw (nexthop)
+--:(blackhole)
| +--rw blackhole-nexthop
| +--rw bh-type
| +--rw distance?
| +--rw tag?
| +--rw description?

Table of Properties

NameRequiredType/RangeDescription
static-routesMPath-only node, has no configurable value.
vrfM”default”
vrf name(sub-property of static-routes)
VRF of staticd IP route.
prefixMA.B.C.D/M
XX:XX:XX:XX:XX:XX:XX:XX/M(sub-property of static-routes)
IP prefix.
nexthopsM(sub-property of static-routes)
Path-only node, has no configurable value.
nexthop object.
blackhole-nexthopM(sub-property of nexthops)
Path-only node, has no configurable value.
bh-typeM”unspec"
"null"
"reject"
"prohibited”
(sub-property of blackhole-nexthop)
A blackhole sub-type, if the nexthop is a blackhole type.
- “unspec”: “Generic unreachable.”

- “null”: “Null type.”
- “reject”: “ICMP unreachable.”
- “prohibited”: “ICMP admin-prohibited.”
Default value: “null”
distanceO1..255(sub-property of blackhole-nexthop)
Admin distance associated with this route.
Default value: 1
tagO1..4294967295(sub-property of blackhole-nexthop)
Route tag
descriptionOstring within 255 characters(sub-property of blackhole-nexthop)
A textual description of the nexthop. Spaces are not permitted in the description.

Tree Diagrams

+--rw static-routes
+--rw static-route* [vrf prefix]
+--rw vrf
+--rw prefix
+--rw nexthops
+--rw (nexthop)
+--:(non-blackhole)
+--rw ifindex-nexthops* [nh-vrf interface]
| +--rw interface
| +--rw nh-vrf
| +--rw distance?
| +--rw tag?
| +--rw description?
+--rw ip-nexthops* [nh-vrf gateway]
| +--rw nh-vrf
| +--rw gateway
| +--rw distance?
| +--rw tag?
| +--rw description?
| +--rw bfd
| | +--rw enable?
| | +--rw multihop?
| | +--rw local-address?
| +--rw track?
+--rw ip-ifindex-nexthops* [nh-vrf gateway interface]
+--rw gateway
+--rw nh-vrf
+--rw interface
+--rw onlink?
+--rw distance?
+--rw tag?
+--rw description?
+--rw bfd
| +--rw enable?
| +--rw multihop?
| +--rw local-address?
+--rw track?

Table of Properties

NameRequiredType/RangeDescription
static-routesMPath-only node, has no configurable value.
vrfM”default”
vrf name(sub-property of static-routes)
VRF of staticd IP route.
prefixMA.B.C.D/M
XX:XX:XX:XX:XX:XX:XX:XX/M(sub-property of static-routes)
IP prefix.
nexthopsM(sub-property of static-routes)
Path-only node, has no configurable value.
nexthop object.
ifindex-nexthopsO(sub-property of nexthops)
Path-only node, has no configurable value.
A list of nexthop objects.
interfaceMEthernet name
Lag1..9999
Vlan1..4094
Vxlan vni name(sub-property of ifindex-nexthops)
The nexthop egress interface.
nh-vrfM”default”
vrf name(sub-property of ifindex-nexthops)
The nexthop vrf name, if different from the route.
distanceO1..255(sub-property of ifindex-nexthops)
Admin distance associated with this route.
Default value: 1
tagO1..4294967295(sub-property of ifindex-nexthops)
Route tag
descriptionOstring within 255 characters(sub-property of ifindex-nexthops)
A textual description of the nexthop. Spaces are not permitted in the description.
ip-nexthopsO(sub-property of nexthops)
Path-only node, has no configurable value.
A list of nexthop objects of type ip4 or ip6.
nh-vrfM”default”
vrf name(sub-property of ip-nexthops)
The nexthop vrf name, if different from the route.
gatewayMA.B.C.D
XX:XX:XX:XX:XX:XX:XX:XX(sub-property of ip-nexthops)
The nexthop gateway address.
distanceO1..255(sub-property of ip-nexthops)
Admin distance associated with this route.
Default value: 1
tagO1..4294967295(sub-property of ip-nexthops)
Route tag
descriptionOstring within 255 characters(sub-property of ip-nexthops)
A textual description of the nexthop. Spaces are not permitted in the description.
bfdO(sub-property of ip-nexthops)
Path-only node, has no configurable value.
FRR nexthop bfd object.
enableO”true"
"false”(sub-property of bfd)
Nexthop open bfd
Default value: “false”
multihopCO”true"
"false”(sub-property of bfd)
Only applicable when enable = “true”.
Open bfd multihop mode
Default value: “false”
local-addressCOA.B.C.D
XX:XX:XX:XX:XX:XX:XX:XX(sub-property of bfd)
Only applicable when enable = “true” and multihop = “true”.
The bfd local-address.
trackO1..4294967295(sub-property of ip-nexthops)
Route track
ip-ifindex-nexthopsO(sub-property of nexthops)
Path-only node, has no configurable value.
A list of nexthop objects of type ip4-ifindex or ip6-ifindex.
gatewayMA.B.C.D
XX:XX:XX:XX:XX:XX:XX:XX(sub-property of ip-ifindex-nexthops)
The nexthop gateway address.
nh-vrfM”default”
vrf name(sub-property of ip-ifindex-nexthops)
The nexthop vrf name, if different from the route.
interfaceMEthernet name
Lag1..9999
Vlan1..4094
Vxlan vni name(sub-property of ip-ifindex-nexthops)
The nexthop egress interface.
onlinkO”true"
"false”(sub-property of ip-ifindex-nexthops)
Treat the nexthop as directly attached to the interface.
Default value: “false”
distanceO1..255(sub-property of ip-ifindex-nexthops)
Admin distance associated with this route.
Default value: 1
tagO1..4294967295(sub-property of ip-ifindex-nexthops)
Route tag
descriptionOstring within 255 characters(sub-property of ip-ifindex-nexthops)
A textual description of the nexthop. Spaces are not permitted in the description.
bfdO(sub-property of ip-ifindex-nexthops)
Path-only node, has no configurable value.
FRR nexthop bfd object.
enableO”true"
"false”(sub-property of bfd)
Nexthop open bfd
Default value: “false”
multihopCO”true"
"false”(sub-property of bfd)
Only applicable when enable = “true”.
Open bfd multihop mode
Default value: “false”
local-addressCOA.B.C.D
XX:XX:XX:XX:XX:XX:XX:XX(sub-property of bfd)
Only applicable when enable = “true” and multihop = “true”.
The bfd local-address.
trackO1..4294967295(sub-property of ip-ifindex-nexthops)
Route track

Tree Diagrams

+---x show-ip-route
+---w input
| +---w vrf?
+--ro output
+--ro data?

Table of Properties

NameRequiredType/RangeDescription
show-ip-routeMPath-only node, has no configurable value.
Show IPv4 routes.
vrfO”all"
"default”
vrf name(sub-property of input)
VRF of IPv4 route.
dataRO(sub-property of output)

Tree Diagrams

+---x show-ipv6-route
+---w input
| +---w vrf?
+--ro output
+--ro data?

Table of Properties

NameRequiredType/RangeDescription
show-ipv6-routeMPath-only node, has no configurable value.
Show IPv6 routes.
vrfO”all"
"default”
vrf name(sub-property of input)
VRF of IPv6 route.
dataRO(sub-property of output)