2.15 Static Routes

IPv4 Static Route Command

IPv4 Static Routes can be configured as per below:

IPv4 Static Route Configuration Command

R1(config)# ip route [network-address] [subnet-mask] { [ip-address] | [exit-interface] [ip-address] } [distance]

[NOTE] Either the ip-addressexit-interface, or the ip-address and exit-interface parameters must be configured.

Parameters explained in detail:

network-address
This identifies the destination IPv4 Network Address of the Remote Network to enlist in the Routing Table.
subnet-mask
This identifies the subnet mask of the Remote Network.

The subnet mask can be modified to summarize a group of networks and create a summary static route.
ip-address
This identifies the next-hop Router IPv4 address.

Typically used with broadcast networks (i.e., Ethernet).

This could create a recursive static route where the router performs an additional lookup to find the exit interface.
exit-interface
This identifies the exit interface to forward packets.

Creates a directly connected static route.

Typically used in a point-to-point configuration.
exit-interface ip-address
This is known as a fully specified static route since it specifies both the Exit Interface and a Next-Hop IPv4 address.
distance
This is an optional parameter that can be used to assign an administrative distance value between 1 and 255.

Usually used to configure a floating static route by setting an administrative distance that is higher than a dynamically learned route.
IPv4 Static Route Complete Configuration Example
(Next-Hop Router IP Address)
R1> enable
R1# Configure Terminal
R1(config)#
R1(config)# ip route 192.168.10.0 255.255.255.0 192.168.10.1 121
IPv4 Static Route Complete Configuration Example
(Exit Interface)
R1> enable
R1# Configure Terminal
R1(config)#
R1(config)# ip route 192.168.20.0 255.255.255.0 fastEthernet0/1 121
IPv4 Static Route Complete Configuration Example
(Fully Specified Static Route)
R1> enable
R1# Configure Terminal
R1(config)#
R1(config)# ip route 192.168.30.0 255.255.255.0 fastEthernet0/1 192.168.30.1 121