Adds a static route to the IP routing tables.
- vrf vrf-name
- Specifies the VRF associated with the destination IPv4 address.
- Specifies the destination IPv4 address and mask in the format A.B.C.D/L (where "L" is the prefix-length of the mask) or A.B.C.D P.Q.R.S (where "PQ.R.S" is the mask value).
- Specifies the IPv4 address of the next hop.
- ethernet unit/slot/port
- Specifies the destination Ethernet port.
- ve vlan-id
- Specifies the outgoing interface type as VE.
- tunnel tunnel-id
- Specifies the outgoing interface type as tunnel.
- Configures the Layer 3 switch to drop IP packets to a specific network or host address by configuring a "null" (sometimes called "null0") static route for the address.
- Specifies the cost metric of the route. Valid values range from 1 through 16. The default is 1.
- distance distance
- Specifies the administrative distance of the route. When comparing otherwise equal routes to a destination, a device prefers lower administrative distances over higher ones. Valid values range from 1 through 255. The default is 1. The value 255 makes the route unusable.
- tag tag
- Specifies the tag value of the route to use for route filtering with a route map. Valid values range from 0 through 4294967295. The default is 0.
- name string
- Specifies the static route name.The maximum length of the name is 128 bytes.
Global configuration mode
The no form of the command followed by the route identifier removes a static route. If the static route includes a name, you must enter the no form of the command twice (once to remove the name and the second time to remove the route from the routing table).
For a default route, enter 0.0.0.0/0 as the destination IP address followed by the next-hop IP address. Physical or virtual interfaces cannot be used as next-hops for a default route.
If you do not want to specify a next-hop IP address, you can instead specify a port or interface number on the device. If you specify an Ethernet port, the device forwards packets destined for the static route’s destination network to the specified interface. Conceptually, this feature makes the destination network like a directly connected network, associated with a device interface.
The port or virtual interface you use for the static route’s next hop must have at least one IP address configured on it. The address does not need to be in the same subnet as the destination network.
ICX 7150 devices do not support tunnels or VRFs.
When a tunnel is configured as the next hop for a static route, the tunnel must already be configured if the destination is a non-default VRF. In contrast, a tunnel can be designated as the next hop in the default VRF before it is configured. The default VRF is used when no VRF is specified in the command.
The following example configures a static route to 10.95.7.0, using 10.95.6.157 as the next-hop gateway.
device(config)# ip route 10.95.7.0/24 10.95.6.157
The following example configures a default route through next-hop IP address 10.2.12.1.
device(config)# ip route 0.0.0.0/0 10.2.12.1
The following example configures a static route with an Ethernet interface as the destination.
device(config)# ip route 22.214.171.124 255.255.255.0 ethernet 1/4/1
The following example configures a null static route to drop packets destined for network 10.157.22.x.
device(config)# ip route 10.157.22.0 255.255.255.0 null0
device(config)# ip route 126.96.36.199/24 tunnel 1
device(config)# ip route vrf 1 188.8.131.52/24 tunnel 5