Configuring a default static route

About this task

The default route specifies a route to all networks for which there are no explicit routes in the forwarding information base or the routing table. This route has a prefix length of zero (RFC 1812). You can configure the switch with a static default route, or they can learn it through a dynamic routing protocol.

To create a default static route, you configure the destination address and subnet mask to 0.0.0.0.

Note

Note

When you configure a static route with a next-hop-vrf context, you can specify a next-hop IP address that is a locally owned VRRP IP address of the system itself. However, this is not a supported configuration. The best practice is to implement an alternative method of inter-vrf route sharing, such as route redistribution or ISIS accept polices.

Note

Note

As a best practice, do not configure static routes on a DvR Leaf node unless the configuration is for reachability to a management network using a Brouter port.

You cannot configure the preference of static routes on a Leaf node.

Procedure

  1. Enter either Global Configuration mode or VRF Router Configuration mode for a specific VRF context:

    enable

    configure terminal

    Optional: router vrf WORD<1-16>

  2. Create a default static route:

    ip route 0.0.0.0 0.0.0.0 <A.B.C.D> weight <1–65535>

  3. Enable a default static route:

    ip route 0.0.0.0 0.0.0.0 <A.B.C.D> enable [next-hop-vrf WORD<1-16>]

  4. Configure other default static route parameters as required.

Example

Create a default static route and enable the default static route.

Switch:1>enable
Switch:1>configure terminal
Switch:1(config)#ip route 0.0.0.0 0.0.0.0 192.0.2.128 weight 100
Switch:1(config)#ip route 0.0.0.0 0.0.0.0 192.0.2.128 enable

Variable Definitions

Use the data in the following table to use the ip route command.

Variable

Value

<A.B.C.D>

<A.B.C.D> specifies the IP address of the next-hop router (the next router at which packets must arrive on this route).

enable

Adds a static or default route to the router or VRF.

The no form of this command is no ip route 0.0.0.0 0.0.0.0 <A.B.C.D> enable.

local-next-hop enable

Enables the local next hop for this static route.

The default form of this command is default ip route 0.0.0.0 0.0.0.0 <A.B.C.D> local-next-hop enable.

The no form of this command is no ip route 0.0.0.0 0.0.0.0 <A.B.C.D> local-next-hop enable.

next-hop-vrf WORD<1-16>

Specifies the next-hop VRF instance by name.

The default form of this command is default ip route 0.0.0.0 0.0.0.0 <A.B.C.D> next-hop-vrf WORD<1-16>.

The no form of this command is no ip route 0.0.0.0 0.0.0.0 <A.B.C.D> next-hop-vrf WORD<1-16>.

weight <1-65535>

Specifies the static route cost.

The default form of this command is default ip route 0.0.0.0 0.0.0.0 <A.B.C.D> weight.

Note:

Do not configure a static interface subnet route with a weight of 1.

preference <1-255>

Specifies the route preference.

The default form of this command is default ip route 0.0.0.0 0.0.0.0 <A.B.C.D> preference.