Static routes are configured using the ip route global configuration command. The syntax of the command is:
Router(config)# ip route network-address subnet-mask { ip-address | interface-type interface-number [ ip-address ]} [ distance ] [ name name ] [ permanent ] [ tag tag ]
The following parameters are required to configure static routing:
- network-address - Destination network address of the remote network to be added to the routing table, often this is referred to as the prefix.
- subnet-mask - Subnet mask, or just mask, of the remote network to be added to the routing table. The subnet mask can be modified to summarize a group of networks.
One or both of the following parameters must also be used:
- ip-address - The IP address of the connecting router to use to forward the packet to the remote destination network. Commonly referred to as the next hop.
- exit-intf - The outgoing interface to use to forward the packet to the next hop.
As shown in the figure, the command syntax commonly used is ip route network-address subnet-mask {ip-address | exit-intf}.
Thedistance parameter is used to create a floating static route by setting an administrative distance that is higher than a dynamically learned route.
Note: The remaining parameters are not relevant for this chapter or for CCNA studies.