VMware ESXi and vSphere Cluster Management
Directly Connected Routes in Cisco Router Routing Tables
Learn how Cisco routers create, display, prefer, and use directly connected IPv4 routes, including up/up requirements and troubleshooting.
A directly connected network is an IPv4 network physically attached to one of a router's own active Layer 3 interfaces. When that interface has a valid IPv4 address and subnet mask and is operational, Cisco IOS automatically creates a connected route for the interface's subnet.
The routing table is the router's list of destination prefixes and the forwarding paths used to reach them. A connected route tells the router that it can send packets for a particular prefix directly through one of its own interfaces. A remote network, by contrast, is not attached directly to the router and requires a static route, a dynamic routing protocol, or a default route.
How a Router Creates a Connected Route
A router can install a connected route when all of these conditions are met:
- The interface has an IPv4 address configured.
- The interface has a subnet mask, either in dotted-decimal form or as a prefix length.
- The interface is operational.
- The interface's line protocol is operational.
Operational status is commonly displayed as up/up. The first status describes the interface's physical or interface state. The second describes the line protocol. An administratively shut interface, a disconnected cable, or a failed Layer 2 relationship can prevent the route from being active.
The connected prefix is calculated from the interface address and mask. For example, an interface configured as 10.0.0.1 255.255.255.0 belongs to the network 10.0.0.0/24. The router installs that network as a connected route when the interface is up/up.
Example Interface Configuration
configure terminal
interface GigabitEthernet0/0
ip address 10.0.0.1 255.255.255.0
no shutdownThe no shutdown command removes an administrative shutdown condition. It does not repair a disconnected cable, a disabled switch port, or another problem that keeps the line protocol down.
Example Two-Router Topology
Consider two routers connected through a shared transit LAN. R1 has one additional local LAN, and R2 has another.
| Device | Interface | IPv4 address/prefix | Attached network | Expected status |
|---|---|---|---|---|
| R1 | GigabitEthernet0/0 | 10.0.0.1/24 | 10.0.0.0/24 | up/up |
| R1 | GigabitEthernet0/1 | 172.16.0.1/24 | 172.16.0.0/24 | up/up |
| R2 | GigabitEthernet0/0 | 172.16.0.2/24 | 172.16.0.0/24 | up/up |
| R2 | GigabitEthernet0/1 | 192.168.0.1/24 | 192.168.0.0/24 | up/up |
R1 installs connected routes for 10.0.0.0/24 and 172.16.0.0/24. R2 installs connected routes for 172.16.0.0/24 and 192.168.0.0/24. Both routers know the transit network because each has an active interface in that subnet.
However, R1 does not automatically know about 192.168.0.0/24, and R2 does not automatically know about 10.0.0.0/24. A router's connected routes describe only its own active interfaces. They do not describe every network attached to a neighboring router.
Connected Entries in the Cisco IOS Routing Table
Cisco IOS identifies connected routes with the route code C. A typical entry looks similar to this:
Router# show ip route connected
10.0.0.0/24 is directly connected, GigabitEthernet0/0
172.16.0.0/24 is directly connected, GigabitEthernet0/1The prefix is the destination network. The phrase is directly connected indicates that the router does not need a next-hop router for that network. The listed interface is the outgoing interface, also called the exit interface, used to send packets toward destinations in that prefix.
On modern Cisco IOS, the router may also display a local host route with route code L. For example, an interface address of 10.0.0.1/24 can produce a local route for 10.0.0.1/32. This host-specific route represents the router's own interface address. The main connected route remains the C entry for the whole subnet.
How to Read a Route Entry
- Route code:
Cmeans connected;Lcommonly means local. - Network prefix: The destination network and prefix length, such as
10.0.0.0/24. - Administrative distance: The route-source trust value, shown in brackets in full output.
- Metric: A value used by a particular routing source to compare paths of that source.
- Next hop or exit interface: The forwarding information used to send the packet.
Each active routed interface can contribute a connected network entry. If an interface is removed from service, its associated connected route is removed from the active routing table.
Administrative Distance and Route Preference
Administrative distance is a value Cisco IOS uses to rank the trustworthiness of different route sources when those sources provide the same destination prefix. Lower values are preferred. Connected routes have an administrative distance of 0.
| Route source | Typical administrative distance | General meaning |
|---|---|---|
| Connected | 0 | Learned from an active local interface |
| Static | 1 by default | Configured manually by an administrator |
| Dynamic routing protocol | Depends on the protocol | Learned from routing-protocol updates |
If an active connected route and an alternate static or dynamic route advertise the identical destination prefix, the connected route is preferred because its administrative distance is 0. A connected route is not automatically the winner in every routing decision, however. When prefixes differ, the router first uses longest prefix match: the most specific matching prefix is preferred. Administrative distance helps choose between route sources for the same prefix.
Route Knowledge Depends on Topology
In the example topology, R1 initially knows:
10.0.0.0/24, through its local LAN interface.172.16.0.0/24, through its transit interface.
R2 initially knows:
172.16.0.0/24, through its transit interface.192.168.0.0/24, through its local LAN interface.
Suppose a host behind R1 sends traffic to an address in 192.168.0.0/24. R1 performs a route lookup. Its connected routes do not match that remote prefix. If R1 has no static route, dynamic route, or default route that matches the destination, it cannot forward the packet toward R2 and drops it.
The connected route to the transit network only tells R1 how to reach destinations on 172.16.0.0/24. It does not tell R1 that R2 can forward traffic to 192.168.0.0/24. Static routing or a dynamic routing protocol must provide that additional information in a later configuration step.
Comparing the Connected Routes on R1 and R2
| Router | Connected prefix | Route code | Administrative distance | Exit interface | Remote LAN known initially? |
|---|---|---|---|---|---|
| R1 | 10.0.0.0/24 | C | 0 | GigabitEthernet0/0 | R2's 192.168.0.0/24: No |
| R1 | 172.16.0.0/24 | C | 0 | GigabitEthernet0/1 | R2's 192.168.0.0/24: No |
| R2 | 172.16.0.0/24 | C | 0 | GigabitEthernet0/0 | R1's 10.0.0.0/24: No |
| R2 | 192.168.0.0/24 | C | 0 | GigabitEthernet0/1 | R1's 10.0.0.0/24: No |
Verifying Connected Routes
Display Only Connected Routes
Use this command to focus on connected IPv4 entries:
show ip route connectedThis filtered view is useful when checking whether every active routed interface contributed the expected subnet.
Display the Complete Routing Table
Use the full table to view connected routes alongside local, static, dynamic, and default routes:
show ip routeThe complete output provides context. For a route entry, examine the route code, destination prefix, administrative distance, metric, next hop when present, and exit interface.
Verify Interface Addressing and Status
show ip interface brief
show interfaces GigabitEthernet0/0show ip interface brief provides a quick view of interface IP addresses and the status and protocol columns. For a connected route to be active, both status values should normally be up. The more detailed show interfaces command can reveal physical errors, encapsulation details, counters, and line-protocol problems.
What Happens When an Interface Goes Down
Removing the IPv4 address or losing operational status removes the associated connected route from the active routing table. For example:
configure terminal
interface GigabitEthernet0/0
shutdown
show ip route connectedAfter the interface is shut down, the route for its attached subnet should no longer appear as an active connected route. Traffic for that subnet cannot be forwarded through the inactive interface.
| Interface addressing | Interface status | Connected route present? | Reason |
|---|---|---|---|
| IPv4 address and mask configured | up/up | Yes | The interface supplies an active Layer 3 attachment to the subnet. |
| IPv4 address and mask configured | Administratively down | No | The interface was disabled with shutdown. |
| IPv4 address and mask configured | Down/down or line protocol down | No | The interface is not operational. |
| No IPv4 address | Potentially up/up | No IPv4 connected route | There is no IPv4 subnet for IOS to associate with the interface. |
Troubleshooting Missing Connected Routes
An Expected Subnet Is Missing
- Confirm that the interface has an IPv4 address and the correct subnet mask.
- Run
show ip interface briefand check that the interface and protocol are both up. - Verify that the interface is not administratively down.
- If the line protocol is down, inspect the cable, switch port, VLAN or encapsulation settings, and peer-device condition as appropriate.
- Run
show ip route connectedagain after correcting the problem.
The Prefix Is Different from the Expected Prefix
Compare the configured address and mask with the intended network. Calculate the network address from the address and mask. An incorrect mask can cause IOS to install a different connected prefix from the one expected.
R1 Cannot Reach R2's LAN
First confirm that R1 has connected routes for its own LAN and the transit network. Then check whether R1 has any route to R2's LAN. A connected route to the transit subnet does not automatically create a route to every network behind R2. Add a static route or configure a dynamic routing protocol when studying those topics.
A Static Route Does Not Override a Connected Route
For the identical destination prefix, compare administrative distances. The connected route has distance 0, so it is preferred over the default static distance of 1 while the connected interface remains active. If the connected route disappears, another route source may then be selected if one is available.
Exam-Relevant Notes
- C in a Cisco IOS routing table means connected.
- A connected route is automatically created from an active Layer 3 interface's IPv4 address and mask.
- The interface normally must be up/up for the route to be active.
- Connected routes have administrative distance 0.
- A connected route identifies the exit interface; it does not require a remote next-hop address.
- Each router initially knows its own attached networks, not all networks in the topology.
- A remote network requires static, dynamic, or default routing information.
- If no route or default route matches a destination, the router cannot forward the packet and drops it.
- When prefixes differ, longest prefix match is considered before route-source preference.
- A local
Lroute may accompany a connectedCroute and represents the router's own interface address as a host route.
Summary
Directly connected routes are the foundation of a Cisco router's IPv4 routing knowledge. An addressed, operational Layer 3 interface causes IOS to install a connected route for the interface's subnet. The route appears with code C, uses administrative distance 0, and lists the local outgoing interface. Shutting down the interface, losing the line protocol, or removing the address removes the active route.
Connected routes let a router reach its own attached networks, but they do not reveal remote LANs behind neighboring routers. Use show ip route connected, show ip route, and interface-status commands to verify this behavior before adding static routes or dynamic routing.