PTL-0005 IP Addressing

Verifying Directly Connected Networks

Investigate how Cisco IOS routers dynamically populate the routing table with directly connected networks (C) and local host routes (L) for both IPv4 and IPv6.

Level
Beginner
Time
30 min
Packet Tracer
8.2+
Simulator
Tested in Packet Tracer
You configure
R1, S1, S2
Last reviewed

Packet Tracer files for Verifying Directly Connected Networks

FILES Packet Tracer topology

Download starter file

starter.pkt, 51 KB. Open it in Cisco Packet Tracer 8.2+. Install Packet Tracer.

Solution / reference file

The completed topology with every task configured. Try the lab first and use this to check your work or when you are stuck.

Download solution file

completed.pkt, 51 KB.

File checksums (SHA-256)
starter.pkt
78fb2c13d55af711e36d02abd3edb0a9209a34808a891fb8f77cde91382d98e2
completed.pkt
fe982b8b5e039254caec7e6284819f935f63be5a7425d4a92aa359e13b280238

Part of Beginner Networking Learning Path (step 6 of 11), BSIT Networking Curriculum Learning Path (step 18 of 56) and CCNA-Aligned Topical Study Path (step 3 of 56).

Category: ip-addressing · Difficulty: beginner · Lab ID: PTL-0005 · Document: reviewed · Simulator: tested pass

A router cannot forward packets to any destination until it has entries in its routing table. The most fundamental routes are directly connected networks. In Cisco IOS 15 and IOS XE, configuring an IP address on an interface and activating it with no shutdown automatically creates two distinct routing table entries: a network route code C (Connected) representing the entire subnet, and a local route code L (Local) representing the specific /32 (or /128) IP address assigned to the physical interface. This lab examines how the routing table is populated, how to filter routing table outputs, and how interface state governs route availability.


Learning Objectives#

  • Explain the criteria required for a Cisco router to install directly connected networks into its routing table.
  • Distinguish between Connected route codes (C) and Local route codes (L).
  • Use the show ip route command and its filtering options (e.g. show ip route connected).
  • Interpret IPv6 directly connected routes and local host routes using show ipv6 route.
  • Demonstrate how disabling an interface (shutdown) dynamically withdraws its connected routes from the routing table.

Prerequisites#

  • Basic familiarity with Cisco router interface configuration and IP addressing.
  • Understanding of subnet masks (/24) and IPv6 prefix lengths (/64).
  • Cisco Packet Tracer 8.0 or newer.

Topology#

PTL-0005 Topology Diagram
PTL-0005 Topology Diagram

The topology features Router R1 connected to two local subnets:

[PC-A]──Fa0 ───── Gi0/1──[Switch S1]──Gi0/2 ───── Gi0/0/0──[Router R1]──Gi0/0/1 ───── Gi0/2──[Switch S2]──Gi0/1 ───── Fa0──[PC-B]
(LAN 1: 192.168.10.0/24)                                                        (LAN 2: 192.168.20.0/24)
(LAN 1: 2001:db8:acad:10::/64)                                                  (LAN 2: 2001:db8:acad:20::/64)
Device Name Model Interface Connected Device Neighbor Interface Cable Type
R1 ISR 4321 GigabitEthernet0/0/0 Switch S1 GigabitEthernet0/2 Copper Straight-Through
R1 ISR 4321 GigabitEthernet0/0/1 Switch S2 GigabitEthernet0/2 Copper Straight-Through
Switch S1 2960-24TT GigabitEthernet0/1 PC-A FastEthernet0 Copper Straight-Through
Switch S2 2960-24TT GigabitEthernet0/1 PC-B FastEthernet0 Copper Straight-Through

Addressing Table#

Device Interface IPv4 Address Subnet Mask IPv6 Global Address IPv6 Link-Local Default Gateway
R1 Gi0/0/0 192.168.10.1 255.255.255.0 2001:db8:acad:10::1/64 fe80::1 N/A
R1 Gi0/0/1 192.168.20.1 255.255.255.0 2001:db8:acad:20::1/64 fe80::1 N/A
S1 VLAN 1 (SVI) 192.168.10.2 255.255.255.0 N/A N/A 192.168.10.1
S2 VLAN 1 (SVI) 192.168.20.2 255.255.255.0 N/A N/A 192.168.20.1
PC-A FastEthernet0 192.168.10.10 255.255.255.0 2001:db8:acad:10::10/64 Auto 192.168.10.1
PC-B FastEthernet0 192.168.20.10 255.255.255.0 2001:db8:acad:20::10/64 Auto 192.168.20.1

Lab Tasks#

  1. Cable the topology in Packet Tracer and configure host settings on PC-A and PC-B.
  2. Before configuring R1, view the empty routing table using show ip route.
  3. Configure dual-stack IP addressing on GigabitEthernet0/0/0 and issue no shutdown.
  4. Inspect the routing table to observe the appearance of C and L routes for LAN 1.
  5. Configure GigabitEthernet0/0/1 and observe the installation of LAN 2 routes.
  6. Examine the IPv6 routing table using show ipv6 route.
  7. Administratively disable GigabitEthernet0/0/0 (shutdown) and verify that its routes are automatically removed from the routing table.
  8. Re-enable the interface and test end-to-end routing between PC-A and PC-B.

Configuration Walkthrough#

Router R1 Configuration#

Router> enable
Router# configure terminal
Router(config)# hostname R1

! Enable IPv6 routing globally
R1(config)# ipv6 unicast-routing

! Configure LAN 1
R1(config)# interface GigabitEthernet0/0/0
R1(config-if)# description Accounting LAN
R1(config-if)# ip address 192.168.10.1 255.255.255.0
R1(config-if)# ipv6 address 2001:db8:acad:10::1/64
R1(config-if)# ipv6 address fe80::1 link-local
R1(config-if)# no shutdown
R1(config-if)# exit

! Configure LAN 2
R1(config)# interface GigabitEthernet0/0/1
R1(config-if)# description Engineering LAN
R1(config-if)# ip address 192.168.20.1 255.255.255.0
R1(config-if)# ipv6 address 2001:db8:acad:20::1/64
R1(config-if)# ipv6 address fe80::1 link-local
R1(config-if)# no shutdown
R1(config-if)# exit

R1(config)# end
R1# copy running-config startup-config

Verification#

1. View the Complete IPv4 Routing Table#

R1# show ip route

(Sample expected output — illustrative):

Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area

Gateway of last resort is not set

      192.168.10.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.10.0/24 is directly connected, GigabitEthernet0/0/0
L        192.168.10.1/32 is directly connected, GigabitEthernet0/0/0
      192.168.20.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.20.0/24 is directly connected, GigabitEthernet0/0/1
L        192.168.20.1/32 is directly connected, GigabitEthernet0/0/1

Note

Understanding C vs L Codes:

  • C (Connected): Represents the subnet attached to the interface (192.168.10.0/24). The router uses this entry to know which physical interface to use when sending frames to any host on that subnet.
  • L (Local): Introduced in Cisco IOS 15, this represents the exact host IP address assigned to the router's interface with a /32 mask (192.168.10.1/32). This allows the router's internal forwarding engine (Cisco Express Forwarding, CEF) to quickly identify packets destined to the router itself versus packets that should be forwarded through the router.

2. Filter the Routing Table by Code#

To view only directly connected routes:

R1# show ip route connected

To view only local host routes:

R1# show ip route local

3. View the IPv6 Routing Table#

R1# show ipv6 route

(Sample expected output — illustrative):

C   2001:DB8:ACAD:10::/64 [0/0]
     via GigabitEthernet0/0/0, directly connected
L   2001:DB8:ACAD:10::1/128 [0/0]
     via GigabitEthernet0/0/0, receive
C   2001:DB8:ACAD:20::/64 [0/0]
     via GigabitEthernet0/0/1, directly connected
L   2001:DB8:ACAD:20::1/128 [0/0]
     via GigabitEthernet0/0/1, receive
L   FF00::/8 [0/0]
     via Null0, receive

Notice the /128 prefix length for local host routes and FF00::/8 multicast reserved route.

4. Observe Route Withdrawal on Interface Shutdown#

R1# configure terminal
R1(config)# interface GigabitEthernet0/0/0
R1(config-if)# shutdown
R1(config-if)# end
R1# show ip route connected

Notice that 192.168.10.0/24 and 192.168.10.1/32 have disappeared from the routing table! A router only installs routes for interfaces whose status is up and line protocol is up.

Re-enable the interface:

R1(config)# interface GigabitEthernet0/0/0
R1(config-if)# no shutdown

The routes immediately reappear.


Troubleshooting#

  • Problem: Configured interface IP address does not appear in show ip route.
    • Check: Run show ip interface brief. For an interface route to enter the routing table, the interface must be in the up/up operational state. If it is administratively down, issue no shutdown. If it is up/down, check that the cable is connected to an active switch.
  • Problem: show ipv6 route returns nothing.
    • Check 1: Ensure ipv6 unicast-routing was issued in global configuration mode.
    • Check 2: Ensure an IPv6 address was configured and the interface is up/up.
  • Problem: PC-A cannot ping PC-B.
    • Check: Confirm that PC-A has 192.168.10.1 configured as its default gateway, and PC-B has 192.168.20.1. Connected routes allow R1 to route between its own active interfaces without requiring static or dynamic routing protocols.

Key Takeaways#

  • Directly connected routes (C) are the building blocks of all routing tables; routers route between directly connected subnets automatically.
  • Local routes (L) represent the router's own interface IP with a /32 or /128 mask for fast local packet processing.
  • A network route will only be installed in the routing table when the corresponding interface achieves the up/up operational state.
  • Filtering options like show ip route connected help network engineers quickly diagnose interface reachability in large routing tables.

References#

  • Cisco Systems, Cisco 4000 Series ISR Software Configuration Guide: IP Routing Basics (Accessed 2026-10-26).
  • IETF, RFC 5737: IPv4 Address Blocks Reserved for Documentation: RFC 5737.
  • IETF, RFC 3849: IPv6 Address Prefix Reserved for Documentation: RFC 3849.

Files and Validation Status#

Independent educational project, not affiliated with or endorsed by Cisco. Passwords shown are educational examples and should not be used in production networks.

Reference configurations

Final device configurations from the solution. Like the solution file, these give the answers away.

R1 R1.txt, 716 B
! ==========================================
! Router R1 Configuration
! Lab: Verifying Directly Connected Networks (PTL-0005)
! ==========================================
enable
configure terminal
hostname R1

! Enable IPv6 routing globally
ipv6 unicast-routing

! LAN 1 Interface
interface GigabitEthernet0/0/0
 description Accounting LAN
 ip address 192.168.10.1 255.255.255.0
 ipv6 address 2001:db8:acad:10::1/64
 ipv6 address fe80::1 link-local
 no shutdown
 exit

! LAN 2 Interface
interface GigabitEthernet0/0/1
 description Engineering LAN
 ip address 192.168.20.1 255.255.255.0
 ipv6 address 2001:db8:acad:20::1/64
 ipv6 address fe80::1 link-local
 no shutdown
 exit

end
copy running-config startup-config

Download R1.txt

S1 S1.txt, 398 B
! ==========================================
! Switch S1 Configuration
! Lab: Verifying Directly Connected Networks (PTL-0005)
! ==========================================
enable
configure terminal
hostname S1

interface vlan 1
 description Accounting Management SVI
 ip address 192.168.10.2 255.255.255.0
 no shutdown
 exit

ip default-gateway 192.168.10.1

end
copy running-config startup-config

Download S1.txt

S2 S2.txt, 399 B
! ==========================================
! Switch S2 Configuration
! Lab: Verifying Directly Connected Networks (PTL-0005)
! ==========================================
enable
configure terminal
hostname S2

interface vlan 1
 description Engineering Management SVI
 ip address 192.168.20.2 255.255.255.0
 no shutdown
 exit

ip default-gateway 192.168.20.1

end
copy running-config startup-config

Download S2.txt

  • Routing Table
  • Directly Connected Routes
  • IPv4 Addressing
  • IPv6 Addressing
  • Cisco IOS

This page is generated from labs/ip-addressing/verify-connected-networks/README.md in the repository. Corrections go there.

Search

Type at least two letters, for example OSPF, DHCP relay or VLAN.