Open In App

Host Routes in CCNA

Last Updated : 12 Dec, 2022
Improve
Improve
Like Article
Like
Save
Share
Report

A host route directs traffic to a specific host. The root subnet mask is always 1. This means that the subnet mask for host routes is /32 for IPv4 and /128 for IPv6. The host route forwards packets to a specific host. A subnet mask belongs to only one. The IPv4 subnet mask for host routes is always /32. The IPv6 subnet mask for host routes is always /128. Host routes are automatically added to the routing table for all IPv4 and IPv6 addresses configured on your router. The function of a host route is to build a corresponding CEF entry as an acknowledgment entry, allowing packets destined for that IP address to be handled by the router itself. Loopback interfaces are often configured with a /32 subnet mask, so they appear as host routes in the routing table. A host route is the most accurate route.

Configure an IPv4 host route by typing:

config t
ip route <host-to-route-to> 
255.255.255.255 
<exit-interface-on-this-router>
   --OR--
ip route <network-to-route-to> 
<subnet-mask> <next-hops-ipv4-address>

Configure an IPv6 network route by typing:

config t
ipv6 route <network-to-route-to>
/<subnet-mask> <exit-interface-on-this-router>
   --OR--
ipv6 route <network-to-route-to>
/<subnet-mask> <next-hop-ipv6-address>

Create a Static Host Route:

A static route for a specified subnet by using the IP route command with the subnet mask 255.255.255.0. IOS also allows you to provide a static host route for a single host by using the IP route command and the 255.255.255.255 (/32) subnet mask. When there are redundant paths, static host routes are typically used. Consider the following scenario:

You can see from the example above that the 10.0.0.0/24 subnet is connected to a network made up of three routers and a switch. R1 has two ways to connect to that subnet: one route involves R2, and the other involves R3. Let’s assume that, aside from the host 10.0.0.10/24, all hosts should take the path that passes through R2. We want to use the route that passes through R3 for that host. Here’s how to accomplish it:

Topology for Static Host Route

 

R1(config)#ip route 10.0.0.0 
255.255.255.0 192.168.0.2
R1(config)#ip route 10.0.0.10 
255.255.255.255 172.16.0.2

We instructed R1 to send all packets intended for the 10.0.0.0/24 network to 192.168.0.2 in the first instruction (the IP address of the interface on R2 connected to R1). R1 has been told to send all packets intended for the 10.0.0.10 host to 172.16.0.2 instead (the IP address of the interface on R3). Since the IP address, 10.0.0.10 is also listed in the first command, the two routes supplied in the ip routes command above overlap. However, routers usually choose the route with the longer prefix length since it is more particular. R1 will utilize the route via R3 to get to 10.0.0.10 since /32 is a more specified route than /24. With the use of the traceroute command (Linux and Mac) and tracert command (Windows) on R1, we can confirm that packets are in fact traveling along intended routes.

Conclusion:

It works as a path to a particular Internet address in terms of two things: A network ID and a Host ID. Host routes make it possible to make informed routing decisions for each network address. These routes are utilized to create custom routes for regulating or optimizing particular types of network traffic.


Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads