---
title: Static Route
slug: aidc/static-route
createdAt: 2025-12-29T10:28:55.771Z
---

## <font color="#1d50a2">URLs Summary</font>

| **URL**                                                                                                                            | **GET** | **POST** | **PATCH** | **PUT** | **DELETE** |
| ---------------------------------------------------------------------------------------------------------------------------------- | ------- | -------- | --------- | ------- | ---------- |
| /rest/v1/rpc/show-ip-route                                                                                                         | N       | Y        | N         | N       | N          |
| /rest/v1/rpc/show-ipv6-route                                                                                                       | N       | Y        | N         | N       | N          |
| /rest/v1/running/static-routes/&#x7B;vrf}/&#x7B;prefix}                                                                            | Y       | Y        | Y         | N       | Y          |
| /rest/v1/running/static-routes/&#x7B;vrf}/&#x7B;prefix}/nexthops/blackhole-nexthop                                                 | N       | Y        | Y         | N       | Y          |
| /rest/v1/running/static-routes/&#x7B;vrf}/&#x7B;prefix}/nexthops/ifindex-nexthops/&#x7B;nh-vrf}/&#x7B;interface}                   | N       | Y        | Y         | N       | Y          |
| /rest/v1/running/static-routes/&#x7B;vrf}/&#x7B;prefix}/nexthops/ip-ifindex-nexthops/&#x7B;nh-vrf}/&#x7B;gateway}/&#x7B;interface} | N       | Y        | Y         | N       | Y          |
| /rest/v1/running/static-routes/&#x7B;vrf}/&#x7B;prefix}/nexthops/ip-nexthops/&#x7B;nh-vrf}/&#x7B;gateway}                          | N       | Y        | Y         | N       | Y          |

## <font color="#1d50a2">Examples</font>

### <font color="#1d50a2">Show IPv4 route vrf all</font>

```json
POST HTTPS://{switch IP}/rest/v1/rpc/show-ip-route
{
    "vrf": "all"
}
```

**response:**

```json
{
    "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
                }
            ]
        }
    ]
}
```

### <font color="#1d50a2">Show IPv6 route</font>

```json
POST HTTPS://{switch IP}/rest/v1/rpc/show-ipv6-route
{
    "vrf": "Vrftest"
}
```

**response:**

```json
{
    "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
                }
            ]
        }
    ]
}
```

### <font color="#1d50a2">Create a static route.</font>

```json
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"
            }
        ]
    }
}
```

### <font color="#1d50a2">Modify a static route with a blackhole next hop.</font>

```json
POST HTTPS://{switch IP}/rest/v1/running/static-routes/Vrf200/10.1.1.0%2F24/nexthops/blackhole-nexthop/
{
    "bh-type": "null"
}
```

### <font color="#1d50a2">Create an interface nexthop for static route.</font>

```json
POST  HTTPS://{switch IP}/rest/v1/running/static-routes/Vrftest/100.0.0.0/24/nexthops/ifindex-nexthops
{
    "nh-vrf": "Vrftest",
    "interface": "Vlan100"
}
```

### <font color="#1d50a2">Modify an ip &amp; interface nexthop for static route</font>

```json
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"
    }
}
```

### <font color="#1d50a2">Modify an ip nexthop for static route.</font>

```json
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"
    }
}
```

## <font color="#1d50a2">Properties Descriptions</font>

### <font color="#1d50a2">Static route blackhole entry</font>

**Tree Diagrams**

```plaintext
  +--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**

| **Name**          | **Required** | **Type/Range**                                       | **Description**                                                                                                                                                                                                                                                                           |
| ----------------- | ------------ | ---------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| static-routes     | M            |                                                      | Path-only node, has no configurable value.                                                                                                                                                                                                                                                |
| vrf               | M            | "default"<br />vrf name                              | (sub-property of static-routes)<br />VRF of staticd IP route.                                                                                                                                                                                                                             |
| prefix            | M            | A.B.C.D/M<br />XX\:XX\:XX\:XX\:XX\:XX\:XX\:XX/M      | (sub-property of static-routes)<br />IP prefix.                                                                                                                                                                                                                                           |
| nexthops          | M            |                                                      | (sub-property of static-routes)<br />Path-only node, has no configurable value.<br />nexthop object.                                                                                                                                                                                      |
| blackhole-nexthop | M            |                                                      | (sub-property of nexthops)<br />Path-only node, has no configurable value.                                                                                                                                                                                                                |
| bh-type           | M            | "unspec"<br />"null"<br />"reject"<br />"prohibited" | (sub-property of blackhole-nexthop)<br />A blackhole sub-type, if the nexthop is a blackhole type.<br />- "unspec": "Generic unreachable."&#xD;<br />- "null": "Null type."<br />- "reject": "ICMP unreachable."<br />- "prohibited": "ICMP admin-prohibited."<br />Default value: "null" |
| distance          | O            | 1..255                                               | (sub-property of blackhole-nexthop)<br />Admin distance associated with this route.<br />Default value: 1                                                                                                                                                                                 |
| tag               | O            | 1..4294967295                                        | (sub-property of blackhole-nexthop)<br />Route tag                                                                                                                                                                                                                                        |
| description       | O            | string within 255 characters                         | (sub-property of blackhole-nexthop)<br />A textual description of the nexthop. Spaces are not permitted in the description.                                                                                                                                                               |

### <font color="#1d50a2">Static route non-blackhole entry</font>

**Tree Diagrams**

```plaintext
  +--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**

| **Name**            | **Required** | **Type/Range**                                                     | **Description**                                                                                                                               |
| ------------------- | ------------ | ------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------- |
| static-routes       | M            |                                                                    | Path-only node, has no configurable value.                                                                                                    |
| vrf                 | M            | "default"<br />vrf name                                            | (sub-property of static-routes)<br />VRF of staticd IP route.                                                                                 |
| prefix              | M            | A.B.C.D/M<br />XX\:XX\:XX\:XX\:XX\:XX\:XX\:XX/M                    | (sub-property of static-routes)<br />IP prefix.                                                                                               |
| nexthops            | M            |                                                                    | (sub-property of static-routes)<br />Path-only node, has no configurable value.<br />nexthop object.                                          |
| ifindex-nexthops    | O            |                                                                    | (sub-property of nexthops)<br />Path-only node, has no configurable value.<br />A list of nexthop objects.                                    |
| interface           | M            | Ethernet name<br />Lag1..9999<br />Vlan1..4094<br />Vxlan vni name | (sub-property of ifindex-nexthops)<br />The nexthop egress interface.                                                                         |
| nh-vrf              | M            | "default"<br />vrf name                                            | (sub-property of ifindex-nexthops)<br />The nexthop vrf name, if different from the route.                                                    |
| distance            | O            | 1..255                                                             | (sub-property of ifindex-nexthops)<br />Admin distance associated with this route.<br />Default value: 1                                      |
| tag                 | O            | 1..4294967295                                                      | (sub-property of ifindex-nexthops)<br />Route tag                                                                                             |
| description         | O            | string within 255 characters                                       | (sub-property of ifindex-nexthops)<br />A textual description of the nexthop. Spaces are not permitted in the description.                    |
| ip-nexthops         | O            |                                                                    | (sub-property of nexthops)<br />Path-only node, has no configurable value.<br />A list of nexthop objects of type ip4 or ip6.                 |
| nh-vrf              | M            | "default"<br />vrf name                                            | (sub-property of ip-nexthops)<br />The nexthop vrf name, if different from the route.                                                         |
| gateway             | M            | A.B.C.D<br />XX\:XX\:XX\:XX\:XX\:XX\:XX\:XX                        | (sub-property of ip-nexthops)<br />The nexthop gateway address.                                                                               |
| distance            | O            | 1..255                                                             | (sub-property of ip-nexthops)<br />Admin distance associated with this route.<br />Default value: 1                                           |
| tag                 | O            | 1..4294967295                                                      | (sub-property of ip-nexthops)<br />Route tag                                                                                                  |
| description         | O            | string within 255 characters                                       | (sub-property of ip-nexthops)<br />A textual description of the nexthop. Spaces are not permitted in the description.                         |
| bfd                 | O            |                                                                    | (sub-property of ip-nexthops)<br />Path-only node, has no configurable value.<br />FRR nexthop bfd object.                                    |
| enable              | O            | "true"<br />"false"                                                | (sub-property of bfd)<br />Nexthop open bfd<br />Default value: "false"                                                                       |
| multihop            | CO           | "true"<br />"false"                                                | (sub-property of bfd)<br />Only applicable when enable = "true".<br />Open bfd multihop mode<br />Default value: "false"                      |
| local-address       | CO           | A.B.C.D<br />XX\:XX\:XX\:XX\:XX\:XX\:XX\:XX                        | (sub-property of bfd)<br />Only applicable when enable = "true" and multihop = "true".<br />The bfd local-address.                            |
| track               | O            | 1..4294967295                                                      | (sub-property of ip-nexthops)<br />Route track                                                                                                |
| ip-ifindex-nexthops | O            |                                                                    | (sub-property of nexthops)<br />Path-only node, has no configurable value.<br />A list of nexthop objects of type ip4-ifindex or ip6-ifindex. |
| gateway             | M            | A.B.C.D<br />XX\:XX\:XX\:XX\:XX\:XX\:XX\:XX                        | (sub-property of ip-ifindex-nexthops)<br />The nexthop gateway address.                                                                       |
| nh-vrf              | M            | "default"<br />vrf name                                            | (sub-property of ip-ifindex-nexthops)<br />The nexthop vrf name, if different from the route.                                                 |
| interface           | M            | Ethernet name<br />Lag1..9999<br />Vlan1..4094<br />Vxlan vni name | (sub-property of ip-ifindex-nexthops)<br />The nexthop egress interface.                                                                      |
| onlink              | O            | "true"<br />"false"                                                | (sub-property of ip-ifindex-nexthops)<br />Treat the nexthop as directly attached to the interface.<br />Default value: "false"               |
| distance            | O            | 1..255                                                             | (sub-property of ip-ifindex-nexthops)<br />Admin distance associated with this route.<br />Default value: 1                                   |
| tag                 | O            | 1..4294967295                                                      | (sub-property of ip-ifindex-nexthops)<br />Route tag                                                                                          |
| description         | O            | string within 255 characters                                       | (sub-property of ip-ifindex-nexthops)<br />A textual description of the nexthop. Spaces are not permitted in the description.                 |
| bfd                 | O            |                                                                    | (sub-property of ip-ifindex-nexthops)<br />Path-only node, has no configurable value.<br />FRR nexthop bfd object.                            |
| enable              | O            | "true"<br />"false"                                                | (sub-property of bfd)<br />Nexthop open bfd<br />Default value: "false"                                                                       |
| multihop            | CO           | "true"<br />"false"                                                | (sub-property of bfd)<br />Only applicable when enable = "true".<br />Open bfd multihop mode<br />Default value: "false"                      |
| local-address       | CO           | A.B.C.D<br />XX\:XX\:XX\:XX\:XX\:XX\:XX\:XX                        | (sub-property of bfd)<br />Only applicable when enable = "true" and multihop = "true".<br />The bfd local-address.                            |
| track               | O            | 1..4294967295                                                      | (sub-property of ip-ifindex-nexthops)<br />Route track                                                                                        |

### <font color="#1d50a2">Show IPv4 route</font>

**Tree Diagrams**

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

**Table of Properties**

| **Name**      | **Required** | **Type/Range**                     | **Description**                                                   |
| ------------- | ------------ | ---------------------------------- | ----------------------------------------------------------------- |
| show-ip-route | M            |                                    | Path-only node, has no configurable value.<br />Show IPv4 routes. |
| vrf           | O            | "all"<br />"default"<br />vrf name | (sub-property of input)<br />VRF of IPv4 route.                   |
| data          | RO           | \<anydata>                         | (sub-property of output)                                          |

### <font color="#1d50a2">Show IPv6 route</font>

**Tree Diagrams**

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

**Table of Properties**

| **Name**        | **Required** | **Type/Range**                     | **Description**                                                   |
| --------------- | ------------ | ---------------------------------- | ----------------------------------------------------------------- |
| show-ipv6-route | M            |                                    | Path-only node, has no configurable value.<br />Show IPv6 routes. |
| vrf             | O            | "all"<br />"default"<br />vrf name | (sub-property of input)<br />VRF of IPv6 route.                   |
| data            | RO           | \<anydata>                         | (sub-property of output)                                          |

