---
title: Static Route Configuration
slug: enterprise-v5p2/static-route-configuration
description: ip unicast routing
createdAt: 2025-11-14T03:58:43.498Z
---

### <font color="#1d50a2">show ip route</font>

**\[Command]**
**show ip route** \[**summary|connected|static|bgp|ospf|isis|kernel|** *A.B.C.D/M* **|** *A.B.C.D* **|vrf \{all|** *String* **}|json]**

**\[Purpose]**
Display all ipv4 routes

**\[Parameter]**

| **Parameter**  | **Description**                   |
| -------------- | --------------------------------- |
| *summary*      | Display routes summary            |
| *connected*    | Display directly connected routes |
| *static*       | Display static routes             |
| *bgp*          | Display bgp routes                |
| *ospf*         | Display ospf routes               |
| *isis*         | Display isis routes               |
| *\<A.B.C.D/M>* | IP prefix                         |
| *\<A.B.C.D>*   | Network                           |

**\[View]**
System view

**\[Use Cases]**

```plaintext
sonic# show ip route connected
Codes: K - kernel route, C - connected, S - static, R - RIP,
    O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
    T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
    F - PBR, f - OpenFabric,
    > - selected route, * - FIB route, q - queued, r - rejected, b - backup
C>* 10.0.0.0/24 is directly connected, Ethernet112, 00:22:20
C>* 10.1.0.103/32 is directly connected, Loopback0, 20:16:20
C>* 10.250.0.0/24 is directly connected, eth0, 20:16:40
C>* 11.11.10.0/24 is directly connected, Vlan10, 20:16:10
C>* 112.0.0.0/24 is directly connected, Ethernet112, 00:22:20
C>* 122.0.0.0/24 is directly connected, Vlan100, 20:16:10
```

### <font color="#1d50a2">show ip protocol</font>

**\[Command]**
**show ip protocol** \[**vrf** \{**all**| *String* }]

**\[Purpose]**
Display IPv4 protocol information

**\[Parameter]**

| **Parameter** | **Description**                                           |
| ------------- | --------------------------------------------------------- |
| *vrf*         | Display IPv4 protocol information under the specified VRF |

**\[View]**
System view

**\[Use Cases]**

```plaintext
sonic# show ip protocol
Protocol  : route-map
------------------------
system   : none
kernel   : none
connected  : none
static   : none
rip     : none
ripng    : none
ospf    : none
ospf6    : none
isis    : none
bgp     : RM_SET_SRC
pim     : none
eigrp    : none
nhrp    : none
hsls    : none
olsr    : none
table    : none
ldp     : none
vnc     : none
vnc-direct : none
vnc-rn   : none
bgp-direct : none
bgp-direct-to-nve-groups : none
babel    : none
sharp    : none
pbr     : none
bfd     : none
wildcard  : none
any     : none
```

### <font color="#1d50a2">show ipv6 route</font>

**\[Command]**
**show ipv6 route**
\[**summary|connected|static|bgp|ospf6|isis|kernel|** *X\:X\::X*:&#x58;*/M* | *X\:X\::X*:X **|vrf \{all|** *String* **}|json]**

**\[Purpose]**
Show IPv6 routing table

**\[Parameter]**

| **Parameter**         | **Description**                            |
| --------------------- | ------------------------------------------ |
| *summary*             | Show route summary                         |
| *connected*           | Show directly connected routes             |
| *static*              | Display static routes                      |
| *bgp*                 | Show BGP routes                            |
| *ospf6*               | Display OSPF6 routes                       |
| *isis*                | Show ISIS routes                           |
| *kernel*              | Show kernel routes                         |
| *X\:X\::X*:&#x58;*/M* | IPv6 prefix /                              |
| *X\:X\::X*:X          | Network                                    |
| *vrf*                 | Display the routes under the specified VRF |
| *json*                | Display routes in json format              |

**\[View]**
System view

**\[Use Cases]**

```plaintext
sonic# show ipv6 route
Codes: K - kernel route, C - connected, S - static, R - RIPng,
    O - OSPFv3, I - IS-IS, B - BGP, N - NHRP, T - Table,
    v - VNC, V - VNC-Direct, A - Babel, D - SHARP, F - PBR,
    f - OpenFabric,
    > - selected route, * - FIB route, q - queued, r - rejected, b - backup
B>* ::/0 [20/0] via fe80::1a17:25ff:fe37:6508, Ethernet50, weight 1, 02:54:43
 *       via fe80::1a17:25ff:fe37:6722, Ethernet49, weight 1, 02:54:43
```

### <font color="#1d50a2">show ipv6 protocol \[vrf\]</font>

**\[Command]**
**show ipv6 protocol** \[**vrf \{all|** *String* **}]**

**\[Purpose]**
Display IPv6 protocol information

**\[Parameter]**

| **Parameter** | **Description**                                           |
| ------------- | --------------------------------------------------------- |
| *vrf*         | Display IPv6 protocol information under the specified VRF |

**\[View]**
System view

**\[Use Cases]**

```plaintext
sonic# show ipv6 protocol
VRF: default
Protocol             : route-map
-------------------------------------
system              : none
kernel              : none
connected           : none
static              : RM_SET_SRC6
rip                 : none
ripng               : none
ospf                : none
ospf6               : none
isis                : none
bgp                 : RM_SET_SRC6
pim                 : none
eigrp               : none
nhrp                : none
hsls                : none
olsr                : none
table               : none
ldp                 : none
vnc                 : none
vnc-direct          : none
vnc-rn              : none
bgp-direct          : none
bgp-direct-to-nve-groups : none
babel               : none
sharp               : none
pbr                 : none
bfd                 : none
openfabric          : none
vrrp                : none
nhg                 : none
srte                : none
wildcard            : none
any                 : none
```

### <font color="#1d50a2">ip route</font>

**\[Command]**
**ip route** *A.B.C.D* **\{** */M|A.B.C.D* **} \{** *A.B.C.D* **|Null0|ethernet** *interface\_num* **|vlan** *vlan\_id* **|link-Aggregation** *lag\_id* **|vxlan-vni** *vni* **} \[OPTION]**&#x20;
**ip route** *A.B.C.D* **\{** */M|A.B.C.D* } \{**reject|blackhole**} \[**tag** *tag\_id* **|label** *label\_id* **|table** *table\_id* **]**
**ip route** *A.B.C.D* **\{** */M|A.B.C.D* **} gre** *gre\_id*
**no ip route** *A.B.C.D* **\{** */M|A.B.C.D* **}**
**\{** *A.B.C.D* **|Null0|ethernet** *interface\_num* **|vlan** *valn\_id* **|link-aggregation** *lag\_id* **|vxlan-vni}\[OPTION]**

**\[Purpose]**
Configure IPv4 static routes

**\[Parameter]**

| **Parameter**    | **Description**                                                                    |
| ---------------- | ---------------------------------------------------------------------------------- |
| *A.B.C.D/M*      | Destination IP address of the route                                                |
| *A.B.C.D*        | Routing the IP address of the next hop                                             |
| *Null0*          | No outgoing interface specified                                                    |
| *interface\_num* | Specify the outgoing interface as a physical port, the range of interface id 0\~54 |
| *vlan\_id*       | Specify the outgoing interface as a VLAN port, specify VLAN id, range 1\~4094      |
| *lag\_id*        | Specify the outgoing interface as the aggregation port                             |
| *VNI*            | Direct vxlan-vni value                                                             |

<font color="#1d05a2">**OPTION** options are as follows\:</font>

| **Parameter**   | **Description**                                                                    |
| --------------- | ---------------------------------------------------------------------------------- |
| *tag*           | Specify the tag value of the route, range 1\~4294967295                            |
| *distance*      | Specify the metric value of the route, in the range 1\~255                         |
| *label*         | Specify the label value of the route, ranging from 16 to 1048575, separated by "/" |
| *table*         | Specify the table value of this route, range 1\~4294967295                         |
| *nexthop-vrf*   | Specify the VRF for the next hop of this route                                     |
| *color*         | Specify the color value of this route, range 1\~4294967295                         |
| *bfd*           | Enable the BFD detection function for this route                                   |
| *multihop*      | Set BFD's multihop mode                                                            |
| *local-address* | Set local-address in multihop mode of BFD, A.B.C.D                                 |
| *reject*        | Specify the route as reject type                                                   |
| *blackhole*     | Specify the route as a blackhole route                                             |

**\[View]**
System configuration view

**\[Use Cases]**

```plaintext
sonic# configure terminal
sonic(config)# ip route 20.0.0.0/24 10.0.0.57
```

### <font color="#1d50a2">ipv6 route</font>

**\[Command]**
**ipv6 route** *X\:X\::X*:X **\{** */M|X\:X\::X*:X } \[**from** *X\:X\::X*:&#x58;*/M* **] \{** *X\:X\::X*:X **|Null0|ethernet|** *interface\_num* **|vlan** *vlan\_id* **|link-aggregation** *lag\_id* **|vxlan-vni}\[OPTION]**
**ipv6 route** *X\:X\::X*:X **\{** */M|X\:X\::X*:X } \{**reject|blackhole**}\[**tag** *tag\_id* **|label** *label\_id* **|table** *table\_id* **]**
**ipv6 route** *X\:X\::X*:X **\{** */M|X\:X\::X*:X **} gre** *gre\_id*
**no ipv6 route** *X\:X\::X*:X **\{** */M|X\:X\::X*:X } \[**from** *X\:X\::X*:&#x58;*/M* ]
**\{** *X\:X\::X*:X **|Null0|ethernet** *interface\_num* **|vlan** *vlan\_id* **|link-aggregation** *lag\_id* **|vxlan-vni}\[OPTION]**

**\[Purpose]**
Configure IPv6 static routes

**\[Parameter]**

| **Parameter**         | **Description**                                        |
| --------------------- | ------------------------------------------------------ |
| *X\:X\::X*:&#x58;*/M* | Destination IPv6 address of the route                  |
| *X\:X\::X*:X          | Routing the next-hop IPv6 address                      |
| *from*                | Specify the source address of the route                |
| *X\:X\::X*:&#x58;*/M* | Specify the route address prefix                       |
| *Null0*               | No outgoing interface specified                        |
| *ethernet*            | Specify the outgoing interface as a physical port      |
| *interface\_num*      | The range of interface ID 0\~54                        |
| *vlan*                | Specify the outgoing interface as a VLAN port          |
| *vlan\_id*            | Specify VLAN ID, range 1\~4094                         |
| *link-aggregation*    | Specify the outgoing interface as the aggregation port |
| *lag\_id*             | Specify LAG ID                                         |
| *vxlan-vni*           | Direct VNI value                                       |
| *VNI*                 | VNI range 1\~16777215                                  |

<font color="#1d05a2">**OPTION** options are as follows\:</font>

| **Parameter**   | **Description**                                                                    |
| --------------- | ---------------------------------------------------------------------------------- |
| *tag*           | Specify the tag value of the route, range 1\~4294967295                            |
| *distance*      | Specify the metric value of the route, in the range 1\~255                         |
| *label*         | Specify the label value of the route, ranging from 16 to 1048575, separated by "/" |
| *table*         | Specify the table value of this route, range 1\~4294967295                         |
| *nexthop-vrf*   | Specify the VRF for the next hop of this route                                     |
| *color*         | Specify the color value of this route, range 1\~4294967295                         |
| *bfd*           | Enable the BFD detection function for this route                                   |
| *multihop*      | Set BFD's multihop mode                                                            |
| *local-address* | Set local-address in multihop mode of BFD, A.B.C.D                                 |
| *reject*        | Specify the route as reject type                                                   |
| *blackhole*     | Specify the route as a blackhole route                                             |
| *gre\_id*       | Specify the route out interface as GRE                                             |

**\[View]**
System configuration view

**\[Use Cases]**

```plaintext
sonic# configure terminal
sonic(config)# ipv6 route 2022::2000/64 1000::1
```

