IP routing table - 'L' and 'C' entries

In Cisco IOS versions prior to 15.X, the directly connected entries of the routing table contain only one entry indicated by the "C" code. IOS versions 15.X and later include two entries for each directly connected network, indicated by the "C" and "L" codes.

To illustrate this difference, take a look at the following output of the show ip route command on a Cisco IOS router running IOS version 12.X:

Router# show ip route Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2 i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 ia - IS-IS inter area, * - candidate default, U - per-user static route o - ODR, P - periodic downloaded static route Gateway of last resort is not set C 192.168.1.0/24 is directly connected, FastEthernet0/0 C 192.168.2.0/24 is directly connected, FastEthernet0/1 C 10.1.1.0/24 is directly connected, Serial0/0 C 172.16.1.0/24 is directly connected, Serial0/1

The following is the same routing table on a router running IOS 15.X or later:

Router# show ip route Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2 i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 ia - IS-IS inter area, * - candidate default, U - per-user static route o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP a - application route, + - replicated route, % - next hop override Gateway of last resort is not set 192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks C 192.168.1.0/24 is directly connected, FastEthernet0/0 L 192.168.1.1/32 is directly connected, FastEthernet0/0 192.168.2.0/24 is variably subnetted, 2 subnets, 2 masks C 192.168.2.0/24 is directly connected, FastEthernet0/1 L 192.168.2.1/32 is directly connected, FastEthernet0/1 10.1.1.0/24 is variably subnetted, 2 subnets, 2 masks C 10.1.1.0/24 is directly connected, Serial0/0 L 10.1.1.1/32 is directly connected, Serial0/0 172.16.1.0/24 is variably subnetted, 2 subnets, 2 masks C 172.16.1.0/24 is directly connected, Serial0/1 L 172.16.1.1/32 is directly connected, Serial0/1

Notice the two entries for each directly connected network. The "C" code, which indicates a directly connected network, remains the same in both outputs. However, the "L" code, which stands for "local" is the newly added entry.

This entry is a host address that represents the specific interface that has been configured with this address, as can be seen by the /32 subnet mask. The entry shows that it is directly connected to the same interface as the /24 network address.

Local routes are used to identify the IP addresses that are assigned directly to the router's interfaces. These routes allow the router to efficiently route packets destined for its own IP addresses.

There are several reasons for the introduction of this local entry in the routing table:

  1. Direct Delivery to Interface: The "L" entry ensures that any packets destined for the router's own IP addresses are directly delivered to the appropriate interface without any further routing decisions.
  2. Efficient Routing: By having local routes explicitly listed, the router can quickly identify packets that need to be processed locally, such as management traffic (e.g., SSH, SNMP) or packets that require a response from the router itself.
  3. Security and Control: It provides a clear separation in the routing table, distinguishing between routes to other networks and routes to the router's own interfaces, which helps in managing security policies and access control.
  4. Enhanced Performance: The presence of local routes helps optimize the routing process by reducing the overhead associated with determining how to handle packets destined for the router's own IP addresses.

Links:

https://forum.networklessons.com/t/administrative-distance-for-ccna-students/874/31?u=lagapidis

https://networklessons.com/cisco/ccna-routing-switching-icnd1-100-105/ip-routing-explained