ip route

Last Updated : Oct 26, 2015 |

Establishes a static route. Use no ip route to remove a static route.

Syntax

ip route ip_addr mask {{next_hop [next_hop [next_hop]] } | {interface_type interface_number}} [cost] [preference] [permanent | {track track-index} | Null0]

Note:

You can specify up to three next hops. However, if you apply tracking, you can specify only one next hop.

If you wish to establish a route through the FastEthernet interface on which DHCP address negotiation is configured, you must specify the interface type as the FastEthernet interface.

When applying tracking to a static route, a PBR next hop, or the DHCP client default route, you must specify the same next hop for the object tracker’s RTR (use the next hop command in rtr context).

Object tracking cannot be configured on Null0 or on a permanent route.

Parameters

Parameter

Description

Possible Values

Default Value

ip_addr

The IP address of the network

mask

The mask of the static route

next_hop

The next hop address in the network

interface_type

The interface type

interface_number

The interface number

cost

The path cost

1

preference

The preference of the route

High, Low

Low

permanent

Keyword that specifies that the route is not disabled if the interface is down

track

Keyword specifying to apply tracking to monitor the route

track-index

The index number of the object tracker

1-50

Null0

Keyword that creates a static discard route.

Note:

Object tracking cannot be configured on Null0 or on a permanent route.

User level

read-write

Context

general

Examples

To create a static route on IP address 132.55.0.0 with subnet mask 255.255.0.0 following the path 132.55.4.45, with cost of 3, priority of high, and object tracker 6:

Gxxx-001(super)# ip route 132.55.0.0 255.255.0.0 132.55.4.45 3 high track 6

To create a static discard route on IP address 134.66.0.0:

Gxxx-001(super)# ip route 134.66.0.0 255.255.0.0 Null0

To create a static route over the WAN Fast Ethernet when running DHCP client:

Gxxx-001# ip route 1.1.1.0 255.255.255.0 FastEthernet 10/3