ip route distance

Syntax

ip route <DEST-IPV4-ADDR>/<NETMASK> [<NEXT-HOP-IP-ADDR>|<INTERFACE>] distance <VALUE>

no ip route <DEST-IPV4-ADDR>/<NETMASK> [<NEXT-HOP-IP-ADDR>|<INTERFACE>] distance <VALUE>

Description

Configures the administrative distance for the IPv4 static route.

The no form of this command deletes the static route.

Command context

config

Parameters

<DEST-IPV4-ADDR>/<NETMASK>

Specifies the IPv4 route destination.

<NEXT-HOP-IP-ADDR>

Specifies the next hop IPv4 address for reaching the destination. Format: A.B.C.D

<INTERFACE>

Specifies the next hop as an outgoing interface.

distance <VALUE>

Specifies the administrative distance to associate with this static route. Default: 1. Range: 1-255.

Authority

Administrators

Examples

switch(config)# ip route 10.0.2.0/24 20.0.0.2 distance 4
switch(config)# ip route 10.0.3.0/24 1/1/1 distance 6
switch# configure terminal
switch(config)# no ip route 10.0.3.0/24 1/1/1 distance 6