Directly Connected Routes in Cisco Networks
Learn how Cisco routers create, display, select, and use IPv4 and IPv6 directly connected and local routes.
What Is a Directly Connected Route?
A directly connected route is a route that a Cisco router automatically installs for an IP network attached to one of its own active Layer 3 interfaces. The interface has an IP address and mask or prefix length, so the router can determine which network is attached to that interface.
For example, if R1 has 192.168.10.1/24 on GigabitEthernet0/0, the router knows that 192.168.10.0/24 is reachable through that interface. A host such as 192.168.10.10 is on a directly connected network; R1 does not need another router as a next hop to reach it.
A remote network is different. If R1 must reach 172.16.20.0/24 behind R2, R1 needs a route that identifies R2, or another forwarding path, as the next hop. Connected routes cover only prefixes attached to the local router.
Connected routes are foundational because every routing decision begins with the routing table. They identify the networks physically or logically attached to the router and provide the outgoing interfaces used for local forwarding and for reaching neighboring routers.
How a Connected Route Is Installed
An interface normally needs all of the following conditions before its connected network is installed and usable:
- A valid IPv4 address and subnet mask, or a valid IPv6 address and prefix length, is configured.
- The interface is not administratively disabled. In Cisco IOS, this means the interface has received
no shutdown. - The physical and data-link operation is successful.
- The interface and its line protocol are operationally active, commonly shown as up/up.
The mask or prefix length determines the network prefix. For IPv4, the router applies the subnet mask to the interface address. For IPv6, the prefix length identifies the network bits.
| Administrative State | Line Protocol State | Likely Route Presence | Interpretation |
|---|---|---|---|
| up | up | Present and usable | The interface is administratively enabled and operational. |
| administratively down | down | Absent or unusable | The interface was disabled with shutdown. |
| up | down | Usually absent or unusable | The interface is enabled, but a physical, data-link, encapsulation, or neighbor problem exists. |
| down | down | Absent or unusable | The interface is not operational, often because of a disconnected or failed link. |
A shutdown interface can retain its configured address in the running configuration, but the router cannot use that interface to forward traffic. A failed cable, switch port, serial connection, or data-link condition can likewise prevent the prefix from being installed or make it unusable.
Connected and Local Entries in Cisco IOS
Cisco IOS uses route codes to identify the source and purpose of routing-table entries. The code C means connected. The code L means local.
R1# show ip route
...
C 192.168.10.0/24 is directly connected, GigabitEthernet0/0
L 192.168.10.1/32 is directly connected, GigabitEthernet0/0The prefix describes the destination range. The phrase is directly connected identifies the route source. The interface at the end is the outgoing interface selected for that prefix. Connected routes have an administrative distance of 0, the most preferred value for route sources.
These entries appear automatically when the interface is correctly addressed and operational. You do not create them with a static-route command or a routing-protocol configuration.
Local Host Routes
A local route is a host route for an address configured on the router's own interface. It matches one exact address and directs traffic addressed to the router itself to the router's control plane.
- IPv4 local routes use
/32, such as192.168.10.1/32. - IPv6 local routes use
/128, such as2001:db8:10:1::1/128.
Do not confuse the two entries. A C route represents the entire attached network, while an L route represents only the router's configured interface address.
| Characteristic | Connected Route | Local Route |
|---|---|---|
| Cisco IOS route code | C | L |
| Prefix scope | An attached network or subnet | One exact router interface address |
| Typical IPv4 prefix length | Determined by the mask, such as /24 | /32 |
| Typical IPv6 prefix length | Determined by the configured prefix, such as /64 | /128 |
| Purpose | Reach hosts and neighbors on the attached subnet | Receive traffic addressed to the router itself |
| Traffic destination | Another device on the connected network | The router's own interface address |
| Administrative distance | 0 | 0 |
| Example | C 192.168.10.0/24 | L 192.168.10.1/32 |
IPv4 Connected Routes
For IPv4, the interface address and subnet mask determine the connected network. Consider:
interface GigabitEthernet0/0
ip address 192.168.10.1 255.255.255.0
no shutdownThe mask 255.255.255.0 is /24. The first 24 bits identify the network, so the interface produces these entries:
C 192.168.10.0/24 is directly connected, GigabitEthernet0/0
L 192.168.10.1/32 is directly connected, GigabitEthernet0/0To calculate the network address, preserve the address bits covered by the mask and set the host bits to zero. Thus, 192.168.10.1 with /24 becomes 192.168.10.0/24.
Subnetting changes the installed prefix. For example, 192.168.10.129/26 belongs to 192.168.10.128/26, not 192.168.10.0/24. The router installs the prefix specified by the actual mask on the interface.
IPv4 LAN Example
R1 connects GigabitEthernet0/0 to a LAN:
- R1:
192.168.10.1/24 - Host:
192.168.10.10/24 - Host default gateway:
192.168.10.1
R1 installs C 192.168.10.0/24 and L 192.168.10.1/32. When R1 forwards a packet to the host, it uses GigabitEthernet0/0 and resolves the host's MAC address with ARP.
Point-to-Point Transit Example
Suppose R1 and R2 share a transit subnet:
- R1 transit interface:
10.0.12.1/30 - R2 transit interface:
10.0.12.2/30
Each router installs C 10.0.12.0/30 and an L /32 route for its own interface address. The transit addresses are directly reachable. However, a LAN behind R2 is not automatically reachable from R1; R1 needs a static route or a dynamically learned route for that remote LAN.
IPv6 Connected Routes
For IPv6, a global unicast address and prefix length create the connected route. Example:
interface GigabitEthernet0/1
ipv6 address 2001:db8:10:1::1/64
no shutdownR1 installs:
C 2001:DB8:10:1::/64 [0/0]
via GigabitEthernet0/1
L 2001:DB8:10:1::1/128 [0/0]
via GigabitEthernet0/1IOS display formatting can vary, but the important information is the C or L code, prefix, and interface. The /64 is the attached network; the /128 is the router's exact address.
IPv6 interfaces also use link-local addresses, commonly in FE80::/10. Link-local addresses support neighbor communication and other local IPv6 functions. They do not replace a routed global unicast or unique-local prefix when devices need connectivity across IPv6 networks.
Routing-Table Lookup and Forwarding
When a packet arrives, the router compares its destination IP address with routing-table prefixes. It selects the best matching route using longest-prefix match: the matching prefix with the greatest number of network bits wins.
For example, assume the table contains a connected route for 192.168.10.0/24 and a more-specific 192.168.10.128/25 route:
- Traffic to
192.168.10.130matches both prefixes, so the/25route wins. - Traffic to
192.168.10.50matches the/24but not the/25, so the connected route is used.
A more-specific route can therefore be selected over a broader connected route. The router must analyze the actual destination and prefix lengths rather than assuming that every address in a broad connected range uses the same path.
Forwarding to a Directly Connected Host
- The router performs a route lookup for the destination IP address.
- The connected route identifies the outgoing interface.
- For IPv4 Ethernet, the router uses ARP to resolve the destination IP address to a MAC address.
- For IPv6 Ethernet, the router uses Neighbor Discovery to resolve the local neighbor's link-layer address.
- The router creates a Layer 2 frame, places the packet inside it, and transmits it through the selected interface.
No next-hop router is needed when the destination host belongs to the directly connected subnet. The router still needs Layer 2 resolution before it can send an Ethernet frame.
Configuration and Verification Workflow
Configure an IPv4 Interface
configure terminal
interface gigabitEthernet 0/0
ip address 192.168.10.1 255.255.255.0
no shutdown
endConfigure an IPv6 Interface
configure terminal
ipv6 unicast-routing
interface gigabitEthernet 0/1
ipv6 address 2001:db8:10:1::1/64
no shutdown
endEnable IPv6 unicast routing when the router must forward IPv6 packets between interfaces. An interface can have IPv6 addresses and communicate locally even when the router is not configured to route between IPv6 networks, but routed IPv6 operation requires the appropriate forwarding configuration.
Verify Interfaces and Routes
show ip interface brief
show ip route
show ip route connected
show ip route 192.168.10.0
show interfaces gigabitEthernet 0/0
show running-config interface gigabitEthernet 0/0
show arp
ping 192.168.10.10show ipv6 interface brief
show ipv6 interface gigabitEthernet 0/1
show ipv6 route
show ipv6 route connected
show ipv6 route 2001:db8:10:1::/64
show ipv6 neighbors
ping ipv6 2001:db8:10:1::10Use show ip route 192.168.10.10 or show ipv6 route 2001:db8:10:1::10 to inspect the route selected for a particular destination. These commands help confirm the chosen outgoing interface and expose a more-specific route that might override a connected route.
IPv4 and IPv6 Route Examples
| Protocol | Interface Address | Installed Connected Prefix | Installed Local Prefix | Outgoing Interface |
|---|---|---|---|---|
| IPv4 | 192.168.10.1/24 | 192.168.10.0/24 | 192.168.10.1/32 | GigabitEthernet0/0 |
| IPv4 | 10.0.12.1/30 | 10.0.12.0/30 | 10.0.12.1/32 | Transit interface |
| IPv6 | 2001:db8:10:1::1/64 | 2001:db8:10:1::/64 | 2001:db8:10:1::1/128 | GigabitEthernet0/1 |
Connected Routes Compared with Other Route Types
| Route Source | Example Route Code | How It Is Created | Administrative Distance | Next-Hop Information |
|---|---|---|---|---|
| Connected | C | Automatically created from an active addressed interface | 0 | Usually an outgoing interface; no router next hop is required |
| Local | L | Automatically created for a router interface address | 0 | Delivered to the local router |
| Static | S | Manually configured with an ip route or IPv6 static-route command | Typically 1 by default | Configured next hop and/or outgoing interface |
| Dynamic routing protocol | For example, O for OSPF | Learned through a configured routing protocol | Depends on the protocol; OSPF is typically 110 | Learned next hop and outgoing interface |
| Default route | Often S*, but it depends on its source | Configured or learned as 0.0.0.0/0 or ::/0 | Depends on its source | Usually points toward an upstream router |
A routing protocol does not automatically advertise every connected network merely because the network appears in the table. The protocol must be configured to include the network, or the network must be redistributed, depending on the protocol and design.
A router needs additional routes for remote networks. Connected routes identify only its own attached prefixes. For example, OSPF can advertise R1's connected LAN to another router after R1 is configured appropriately. Review Configure OSPF for dynamic route exchange and Configure Router on a Stick for subinterface-based VLAN routing.
Troubleshooting Missing or Unusable Connected Routes
The C Route Is Missing
If the expected IPv4 connected route does not appear, check the interface state and configuration:
show ip interface brief
show interfaces <interface>
show running-config interface <interface>- Remove an unintended
shutdownwithno shutdown. - Restore a disconnected or failed physical and Layer 2 link.
- Correct a missing or invalid IPv4 address and subnet mask.
If an IPv6 connected prefix is absent, use:
show ipv6 interface brief
show ipv6 interface <interface>
show ipv6 routeConfirm that the intended IPv6 address and prefix length are configured, that the interface is operational, and that IPv6 forwarding is enabled when the router is expected to route between IPv6 networks.
The Route Exists but the Host Is Unreachable
A present connected route proves that the router knows the destination subnet. It does not prove that a particular host is powered on, correctly addressed, or reachable through Layer 2.
- Verify the host IP address, subnet mask or prefix, and default gateway.
- Confirm that the switch port and VLAN place the host in the intended subnet.
- Check the physical connection and host power state.
- Inspect IPv4 ARP with
show arpor IPv6 neighbors withshow ipv6 neighbors. - Check host firewall or ICMP filtering.
- Test from another host in the same subnet.
An interface can show up/up while an end host remains unreachable. Up/up confirms the router's interface and its immediate link, not the complete path through the switch, VLAN, host configuration, and host operating system.
The Unexpected Route Is Selected
Use the destination-specific lookup commands:
show ip route <destination>
show ipv6 route <destination>Then check for a more-specific prefix, an incorrectly calculated network address, or an incorrect mask or prefix length. Overlapping interface networks are a serious design problem: the router may have ambiguous or conflicting forwarding behavior, and hosts may not have a consistent view of which router is local.
Exam-Relevant Notes
- C means a connected network; L means the router's own interface address.
- Connected routes are automatically generated from active Layer 3 interfaces.
- Connected routes have administrative distance 0.
- IPv4 local routes are /32; IPv6 local routes are /128.
- Longest-prefix match is performed before comparing administrative distance between routes that match the same destination.
- ARP resolves IPv4 local destinations to MAC addresses; IPv6 Neighbor Discovery performs the corresponding IPv6 neighbor resolution.
- A directly connected destination does not require a next-hop router, but Ethernet forwarding still requires a destination MAC address.
- Up/up does not guarantee that an end host is reachable.
For supporting fundamentals, see the OSI Reference Model and Computer Network Explained.