C613-50100-01 REV C Command Reference for x930 Series 841
AlliedWare Plus™ Operating System - Version 5.4.6-1.x
ROUTING COMMANDS
IP
ROUTE
ip route
Overview This command adds a static route to the Routing Information Base (RIB). If this
route is the best route for the destination, then your device adds it to the
Forwarding Information Base (FIB). Your device uses the FIB to advertise routes to
neighbors and forward packets.
When using VRF (Virtual Routing and Forwarding), you can use this command to
configure a static inter-VRF route to a destination network that is reachable by a
remote gateway located in a different VRF instance. Note that to apply the
command in this way, the ip route static inter-vrf command must be in enabled (its
default condition). For more information about VRF, see the VRF Feature Overview
and Configuration Guide and the VRF lite Commands chapter.
The no variant of this command removes the static route from the RIB and FIB.
Syntax
ip route <subnet&mask> {<gateway-ip>|<interface>} [<distance>]
no ip route <subnet&mask> {<gateway-ip>|<interface>}
[<distance>]
Syntax (VRF lite) ip route [vrf <vrf-name>] <subnet&mask> [<gateway-ip>]
[<interface>] [<distance>]
no ip route [vrf <vrf-name>] <subnet&mask> [<gateway-ip>]
[<interface>] [<distance>]
Parameter Description
<subnet&mask> The IPv4 address of the destination subnet defined using either a
prefix length or a separate mask specified in one of the following
formats:
The IPv4 subnet address in dotted decimal notation followed by
the subnet mask, also in dotted decimal notation.
The IPv4 subnet address in dotted decimal notation, followed by a
forward slash, then the prefix length.
<gateway-ip> The IPv4 address of the gateway device.
<interface> The interface that connects your device to the network. Enter the
name of the VLAN or its VID. You can also enter ‘null’ as an
interface. Specify a ‘null’ interface to add a null or blackhole route
to the switch.
The gateway IP address or the interface is required, if VRF lite is not
configured.If VRF lite is configured:When adding a static intra-VRF
route, you must specify either the gateway IP address or the
interface.
When adding a static inter-VRF route, you must specify both the
gateway IP address and the interface.
<distance> The administrative distance for the static route in the range
<1-255>. Static routes by default have an administrative distance
of 1.