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
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
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
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
The following table defines parameters for 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. |
local-next-hop enable |
Enables the local next hop for this static route. |
next-hop-vrf WORD<1-16> |
Specifies the next-hop VRF instance by name. |
weight <1-65535> |
Specifies the static route cost. Note:
Do not configure a static interface subnet route with a weight of 1. |
preference <1-255> |
Specifies the route preference. |