The connected route’s concept is pretty much basic. The router has to know the subnet number that is connected to each of its interfaces for it to route packets to that subnet. The router does the calculation by looking at the interface IP address and subnet mask on that attached network then calculates the subnet ID. However, the router just needs that route when the interface is working and is up so that it can route traffic towards the destination network address.
Cisco routers automatically add a route to their routing tables for the subnet connected to each interface, assuming that the following two conditions are satisfied:
• The interface is in a working state, meaning, the interface status in the ‘show interfaces’ command lists a line status of up and protocol status of up.
• The interface has an IP address assigned through the ‘ip address’ interface subcommand.
Local routes are produced automatically in the routing table by a router starting IOS 15 to define a route for that one specific IP address configured on the router interface. Each local route has a /32 prefix length wherein the host route is defined specifically for that one IP address. Routers use these local routes that specify their own local IP addresses to efficiently forward packets sent to the router itself.
Connected and Local Routes in the Routing Table
The routing table is defined as a list of routes in a router, with each route listing the destination subnet and mask, the router interface which to forward the packets out destined to that subnet, and the next-hop router’s IP address.
We are now going to see and understand how the local routes appear in the routing tables of a router and how local routing is interpreted. The routers below are directly connected and thus, having connected routes. Refer to the diagram below, we are given three router devices, R1, R2, and R3, that are connected via the serial interface, and users are connected to its Gigabit Ethernet ports facing the end-users.
Now, we will check the IP address and subnet mask that is configured in our network device, R1, using the ‘show running-configuration’ command.
! Excerpt from show running-config follows... ! interface GigabitEthernet0/0 ip address 192.168.1.1 255.255.255.0 ! interface Serial0/0/0 ip address 192.168.4.1 255.255.255.0 ! interface GigabitEthernet0/1/0 ip address 192.168.5.1 255.255.255.0
Let us now verify and look at the routing table entries of R1 using the ‘show ip route’ command as an example.
R1# 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, p - overrides from PfR Gateway of last resort is not set 192.168.0.0/16 is variably subnetted, 6 subnets, 2 masks C 192.168.1.0/24 is directly connected, GigabitEthernet0/0 L 192.168.1.1/32 is directly connected, GigabitEthernet0/0 C 192.168.4.0/24 is directly connected, Serial0/0/0 L 192.168.4.1/32 is directly connected, Serial0/0/0 C 192.168.5.0/24 is directly connected, GigabitEthernet0/1/0 L 192.168.5.1/32 is directly connected, GigabitEthernet0/1/0
Look closely at the list above and notice that each lists a ‘C’ in the first column, which also says ‘directly connected’ to the router interfaces identifying the route as connected to the Router R1. The first part of each route lists the matching parameters, the subnet ID and the subnet mask, of the connected networks. The end of every route lists the outgoing IP interface. Local routes can be identified as ‘L’ in the routing table, and always has a /32 mask and the routers determine them automatically.
We can see the connected route, 192.168.1.0/24 connected via R1’s GigabitEthernet0/0 interface. Below the connected route is the local route. It means that the IP address 192.168.1.1 on the GigabitEthernet0/0 interface is used in a direct connection. /32 means ‘this specific address.’
The other types of routes we can have in our routing table are static routes, dynamic routes, and we also have a default route.
Download our Free CCNA Study Guide PDF for complete notes on all the CCNA 200-301 exam topics in one book.
We recommend the Cisco CCNA Gold Bootcamp as your main CCNA training course. It’s the highest rated Cisco course online with an average rating of 4.8 from over 30,000 public reviews and is the gold standard in CCNA training: