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>>
Specifies an IP address in IPv4 format (
x.x.x.x
), wherex
is a decimal number from 0 to 255.<MASK>
Specifies the number of bits in the address mask in CIDR format (
x
), wherex
is a decimal number from 0 to 32.<NEXT-HOP-IP-ADDR>
Specifies the next hop IPv4 address in IPv4 format (
x.x.x.x
), wherex
is a decimal number from 0 to 255.<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 or local user group members with execution rights for this command.
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(config)# no ip route 10.0.3.0/24 1/1/1 distance 6