The ip route command is a fundamental tool used to configure static routes in Cisco networking devices. Static routes provide a secure and efficient way to direct traffic in small to medium-sized networks, improving performance and predictability. In this article, we’ll explore the ip route command, its syntax, parameters, and practical applications in detail, tailored for CCNA and CCNP students.
Router(config)# ip route network-address subnet-mask {ip-address | interface-type interface-number [ip-address]} [distance] [name name] [permanent] [tag tag]
The description of the parameter using the IP route command is the following:
network-address
This is the first parameter of the ip route command. It specifies the destination network address that is required to add to the routing table.
subnet-mask
The destination network subnet mask is to be added to the routing table. We can also use a summarized subnet mask for a group of networks to cut the routing table overhead and for speedy processing.
ip-address
This parameter provides a way to reach the destination network. It is the IP address of the connecting router to use to forward the packet to the remote destination network. This is also called the next hop of the router.
exit-interface
This command also does the same job just like an ip-address parameter, but in different ways. It specifies the exit interface and tells the router that if it receives a packet for the destination specified by the previous parameter, then it exits that packet from this interface. The device connected to the end of this interface will take care of the packet.
Note:- One or both of ip-address and exit-interface must be used.
distance
Administrative distance is the trustworthiness of the route. The value of the administrative distance is from 0 to 255. The route with the lowest AD value will be chosen while forwarding the packet. By default static route has two AD values depending on the previous parameter.
If a static route uses an exit interface, the administrative distance will be 0. If the static route is configured with the next-hop IP address, the administrative distance value will be 0. Usually, this is used to create a floating static route or multiple routes to the same destination. For example, we can create a primary and backup path for the destination network.
name
we use this parameter to assign a name to the route.
permanent
If we configure the route with the parameter permanent, in case a route goes down router will not remove it from the routing table. The parameter permanent will keep this route in the routing table.
It’s an optional parameter; we can configure the route without this parameter. This parameter is important for packet security. If you never want packets to take another path.
Tag
By using this parameter, we can specify a tag number when configuring a static route. The tag can then be matched with a route map. The route map is an access list that allows you to permit, deny, and change the parameters of routing advertisements.