IP Route Commands

ip route

To establish static routes, use the ip route command in switch configuration mode. To remove static routes, use the no form of this command.

ip route prefix mask ip-address [ metric-value]

no ip route prefix mask ip-address

Syntax Description

prefix

Specifies the IP route prefix for the destination.

mask

Specifies the prefix mask for the destination.

ip-address

Specifies the IP address of the next hop that can be used to reach that network.

metric-value

Specifies the metric of the route. The default metric is 6. Valid range is from 1–255.

Command Default

No static routes are established.

Command Modes

Switch configuration (config-switch)

Command History

Release Modification
3.5.1

This command was introduced.

Examples

The following example shows how to route packets for the network 209.165.201.2 to a router at 209.165.202.3:


nfvis(config-switch)# ip route 209.165.201.2 255.255.255.0 209.165.202.3 2
nfvis(config-switch)# commit
nfvis(config-switch)# end 

ip routing

To enable IP routing, use the ip routing command in switch configuration mode. To disable IP routing, use the no form of this command.

ip routing

no ip routing

Syntax Description

This command has no arguments or keywords.

Command Default

IP routing is disabled.

Command Modes

Switch configuration mode (config-switch)

Command History

Release Modification
3.5.1

This command was introduced.

Examples

The following example enables IP Routing:

nfvis(config-switch)# ip routing
nfvis(config-switch)# commit
nfvis(config-switch)# end