Ever seen a /32 prefix in the IP routing table?
A /32 prefix is commonly referred to as a host route since it identifies a route to a specific IP host address. Since most (but not all) host computers don’t run routing protocols, we could create a host route on a router and then advertise it to other routers using a dynamic routing protocol. The routers would then use the host route to reach that specific host.
To create a host route, we use the ip route command from global configuration mode and specify a “255.255.255.255” (“/32”) mask. This mask denotes that the route pertains to a specific IP host address. For example, if we want our router to reach the host with address 192.168.1.1 via a next hop of 10.1.2.3, we might do this:
Router(config)#ip route 192.168.1.1 255.255.255.255 10.1.2.3
Assuming that the next hop of 10.1.2.3 is reachable, this route would now appear as an S route in our router’s IP routing table.
If the outbound interface is point-to-point, such as a serial link running HDLC or PPP, or a point-to-point Frame Relay subinterface, we also have the option of specifying the outbound interface instead of the next hop like this:
Router(config)#ip route 192.168.1.1 255.255.255.255 Serial0/1
Assuming that the Serial0/1 interface is up/up, the route would appear as an S route in our router’s IP routing table. In either case, the /32 mask specifies that this is a host route.
Now, having configured a static route for the specific host, we could advertise this route to other routers with a dynamic routing protocol (using route redistribution, for example). Since a /32 mask is not the default mask for any classful network, to advertise this specific route we need a classless routing protocol (the type that advertises the mask with the updates) such as RIPv2, EIGRP, OSPF, IS-IS, or BGP.
Note that while other routes to the host’s subnet or network may exist, because routers use the best (longest) match and nothing beats a /32, the result should be that the routers will use the host-specific route to reach that host.
While host routes are perfectly okay, they aren’t used much because they don’t scale well. A large enterprise may have tens of thousands of hosts, and you wouldn’t want that many entries in the routing tables (think about the RAM, bandwidth, and CPU required by the routing protocol).
When we do see host routes, they are commonly used with router loopback interfaces, which we’ll discuss in the future.