ip route
ip route[
vrfvrf-name]dest-ip-addr[next-hop-vrfvrf-name|default-vrf]next-hop-addr[metric][bfd][distancedistance][namestring][tagtag]ip route[vrfvrf-name]dest-ip-addr{ethernetunit/slot/port|laglag-id|tunneltunnel-id|vevlan-id}[metric][distancedistance][namestring][tagtag]ip route[vrfvrf-name]dest-ip-addrnull0[distancedistance][namestring][tagtag]no ip route[
vrfvrf-name]dest-ip-addr[next-hop-vrfvrf-name|default-vrf]next-hop-addr[metric][bfd][distancedistance][namestring][tagtag]no ip route[vrfvrf-name]dest-ip-addr{ethernetunit/slot/port|laglag-id|tunneltunnel-id|vevlan-id}[metric][distancedistance][namestring][tagtag]no ip route[vrfvrf-name]dest-ip-addrnull0[distancedistance][namestring][tagtag]- dest-ip-addr
- 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 "P.Q.R.S" is the mask value).
- metric
- Specifies the cost metric of the route. Valid values range from 1 through 16. The default is 1.
- distancedistance
- 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.
- tagtag
- 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.
Global configuration mode
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.
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.
Use the ip route bfd command to
create a BFD session.
The ip route bfd command is supported for ICX 7850 devices only.
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).
The following example configures inter-VRF route leaking by specifying the next-hop VRF.
device(config)# ip route vrf 1 33.1.1.0/24 next-hop-vrf 2 131.1.1.3
The following example configures inter-VRF route leaking by specifying the outgoing interface of another VRF.
device(config)# ip route 32.32.32.32 255.255.255.255 ve 100 Info: Outgoing interface vrf red is different from route vrf default-vrf
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 vrf 4 10.95.7.0/24 next-hop-vrf 6 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 next-hop-vrf vrf5 10..2.12.1
The following example configures a static route with an Ethernet interface as the destination.
device(config)# ip route 10.128.2.69 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
The following example configures tunnel 1 as the next-hop gateway. The tunnel is configured in the default VRF.
device(config)# ip route 10.1.1.0/24 tunnel 1
The following example configures tunnel 5 as the next-hop gateway in a non-default VRF, as long as the tunnel already exists.
device(config)# ip route vrf 1 10.1.5.0/24 tunnel 5