What is Routing? Routing is the process that routers use to determine the path that IP packets should take over a network to reach their destination. Routers store routes to all known destinations in a routing table, which functions similarly to a switch's MAC address table but operates at Layer 3 with IP addresses instead of MAC addresses.
The Routing Table A routing table is essentially a set of instructions that tells the router how to forward packets. Each route provides guidance: to reach destination network X, send the packet to next-hop Y (the next router in the path), or if the destination is directly connected, send the packet directly to that destination.
Connected Routes (Code: C) Connected routes are automatically added to the routing table when you configure an IP address on an interface and enable it with the NO SHUTDOWN command. These routes point to the network that the interface is directly connected to, using the actual netmask configured on the interface.
Local Routes (Code: L) Local routes are also automatically added when you configure and enable an interface. These routes point to the exact IP address configured on the interface and always use a /32 prefix length, which specifies only that single IP address. Local routes tell the router that packets destined for this address are meant for the router itself.
Static Routes (Code: S) Static routes are manually configured by a network administrator to tell the router how to reach remote networks that are not directly connected. Unlike connected and local routes, static routes are not added automatically and must be explicitly configured.
Default Routes A default route is a route to 0.0.0.0/0, which matches all possible IP addresses. It serves as the "route of last resort" - if no more specific route matches a packet's destination, the default route is used. This is commonly used to direct traffic toward the Internet.
Topic
Key Information
Routes per interface
2 routes added automatically (1 Connected + 1 Local) when IP is configured and interface is enabled
Connected route destination
Network address with configured subnet mask (e.g., 192.168.1.0/24)
Local route destination
Exact interface IP with /32 mask (e.g., 192.168.1.1/32)
Route selection method
Most specific matching route (longest prefix length) wins
Router behavior for unknown destinations
DROP the packet (unlike switches which flood)
Static route command
ip route [destination] [netmask] [next-hop or exit-interface]
Default route
ip route 0.0.0.0 0.0.0.0 [next-hop]
Two-way reachability
Routers need routes to BOTH source and destination networks
Term
Definition
Routing
The process routers use to determine the path IP packets should take to reach their destination
Routing Table
A database of known destination networks and instructions for reaching them
Next-Hop
The next router in the path toward the destination
Connected Route
An automatically added route to the network directly attached to an interface
Local Route
An automatically added route to the router's own interface IP address (/32)
Static Route
A manually configured route to a remote network
Default Route
A route to 0.0.0.0/0 that matches all destinations; used when no more specific route exists
Default Gateway
The router that end hosts send packets to for destinations outside their local network
Most Specific Route
The matching route with the longest prefix length
Prefix Length
The number of bits in the network portion of an address (e.g., /24, /32)
Two-Way Reachability
The ability for traffic to flow in both directions between source and destination
Gateway of Last Resort
Another term for default route/default gateway
Code
Meaning
C
Connected route
L
Local route
S
Static route
S*
Static route that is a candidate default route
/32
Prefix length for local routes (specifies exactly 1 IP address)
0.0.0.0/0
Default route (matches all ~4 billion IP addresses)
Key Commands:
show ip route - Display routing table
show ip interface brief - Display interface status and IPs
ip route [net] [mask] [next-hop] - Configure static route with next-hop
ip route [net] [mask] [exit-int] - Configure static route with exit interface
ip route [net] [mask] [exit-int] [next-hop] - Configure with both
ip route 0.0.0.0 0.0.0.0 [next-hop] - Configure default route
Confusing Connected vs Local Routes
Connected = route to the NETWORK (uses configured mask like /24)
Local = route to the EXACT IP ADDRESS (always /32)
Forgetting Two-Way Reachability
Just because Host A can reach Host B doesn't mean B can reply
ALL routers in the path need routes to BOTH networks
Router vs Switch Behavior
Routers DROP packets with no matching route
Switches FLOOD frames with unknown destinations
This is a common exam question!
Static Route Syntax
You CANNOT use slash notation (/24) in static route commands
Must write full netmask: 255.255.255.0, NOT /24
Default Route Netmask
Default route netmask is 0.0.0.0 (all zeros)
NOT 255.255.255.255 (all ones)
Interface Must Be Enabled
Connected and Local routes only appear if interface is UP (no shutdown)
Shutdown interfaces = no routes in table
"Directly Connected" Static Routes
When you specify only exit-interface in a static route, it shows as "directly connected"
Don't confuse this with actual Connected (C) routes
Most Specific Route Selection
/32 is MORE specific than /24
/24 is MORE specific than /16
/0 is the LEAST specific (default route)
"CL-32" - Connected and Local routes are added automatically; Local routes use /32
"Routers are Rude, Switches are Social"
Routers DROP unknown packets (rude)
Switches FLOOD unknown frames (social)
"Longer is Stronger"
Longer prefix length = more specific = wins route selection
/32 beats /24 beats /16 beats /0
"Two Routes, One Interface"
Every enabled interface = 2 routes (Connected + Local)
3 interfaces = 6 routes automatically
"Zero Zero for Default"
Default route: 0.0.0.0 0.0.0.0 (network AND mask are zeros)
"S-C-L" for Static, Connected, Local
Remember the codes alphabetically
"Layer 3 stays, Layer 2 changes"
Source/Destination IP = unchanged through network
Source/Destination MAC = changes at each hop
R1# show ip route
C 192.168.1.0/24 is directly connected, GigabitEthernet0/0
L 192.168.1.1/32 is directly connected, GigabitEthernet0/0
S 192.168.4.0/24 [1/0] via 192.168.13.3
S* 0.0.0.0/0 [1/0] via 203.0.113.2
Analysis:
Interface G0/0 has IP 192.168.1.1/24 (we know from the L route)
To reach 192.168.4.0/24, send to next-hop 192.168.13.3
Default route sends all other traffic to 203.0.113.2
The asterisk (*) indicates candidate default
If R1 receives a packet destined for 192.168.1.1:
Matches 192.168.1.0/24 (Connected) ✓
Matches 192.168.1.1/32 (Local) ✓
Winner: 192.168.1.1/32 because /32 > /24 (more specific)
Result: R1 receives packet for itself
Scenario: Configure R1 to reach network 10.0.0.0/8 via next-hop 192.168.1.2
R1(config)# ip route 10.0.0.0 255.0.0.0 192.168.1.2
PC1 (192.168.1.10) → PC4 (192.168.4.10)
Hop 1: PC1 → R1
- L3 Dest IP: 192.168.4.10 (PC4)
- L2 Dest MAC: R1's G0/2 MAC (default gateway)
Hop 2: R1 → R3
- L3 Dest IP: 192.168.4.10 (unchanged)
- L2 Dest MAC: R3's G0/0 MAC (next-hop)
Hop 3: R3 → R4
- L2 Dest MAC: R4's G0/1 MAC (next-hop)
Hop 4: R4 → PC4
- L2 Dest MAC: PC4's MAC (final destination)
What is routing?
Routing is the process that routers use to determine the path that IP packets should take over a network to reach their destination.
What two types of routes are automatically added when you configure an IP address on a router interface and enable it?
Connected route (C) and Local route (L)
What is the difference between a Connected route and a Local route?
Connected route: Route to the network the interface is connected to (uses configured mask, e.g., /24)
Local route: Route to the exact IP address configured on the interface (always /32)
What prefix length do Local routes always use, and why?
/32 - because it specifies exactly one IP address (all 32 bits are fixed)
What code represents each route type in the routing table?
Connected: ?
Local: ?
Static: ?
Connected: C
Local: L
Static: S
What does a router do when it receives a packet and has no matching route in its routing table?
The router DROPS the packet. (Unlike switches, which flood unknown frames)
How does a router select which route to use when multiple routes match a packet's destination?
The router selects the MOST SPECIFIC matching route, which is the route with the LONGEST PREFIX LENGTH.
Which is more specific: a /24 route or a /32 route?
/32 is more specific because it matches only 1 IP address, while /24 matches 256 addresses.
What is a default route and what is its network/mask?
A default route is a route that matches ALL destinations. Its network/mask is 0.0.0.0/0 (also written as 0.0.0.0 0.0.0.0)
What command displays a router's routing table?
show ip route
What is the command syntax to configure a static route with a next-hop address?
ip route [destination-network] [subnet-mask] [next-hop-ip]
Example: ip route 192.168.4.0 255.255.255.0 192.168.13.3
ip route 192.168.4.0 255.255.255.0 192.168.13.3
What is the command to configure a default route to next-hop 10.1.1.1?
ip route 0.0.0.0 0.0.0.0 10.1.1.1
What does "Gateway of last resort" mean in the routing table output?
It refers to the default route - the route used when no more specific route matches the destination.
What are the three ways to configure a static route?
Next-hop only: ip route 10.0.0.0 255.0.0.0 192.168.1.2
ip route 10.0.0.0 255.0.0.0 192.168.1.2
Exit-interface only: ip route 10.0.0.0 255.0.0.0 g0/0
ip route 10.0.0.0 255.0.0.0 g0/0
Both: ip route 10.0.0.0 255.0.0.0 g0/0 192.168.1.2
ip route 10.0.0.0 255.0.0.0 g0/0 192.168.1.2
What is the "default gateway" on an end host (like a PC)?
The IP address of the router interface that the host should send packets to when the destination is outside its local network.
If a router interface is configured with IP 10.0.0.1/16, what will be the:
Connected route destination?
Local route destination?
Connected: 10.0.0.0/16
Local: 10.0.0.1/32
What does the asterisk () mean next to a route code (e.g., S)?
It indicates the route is a "candidate default" - a potential default route for the router.
True or False: When a packet travels through multiple routers, the source and destination IP addresses change at each hop.
FALSE - The Layer 3 (IP) addresses remain the same. Only the Layer 2 (MAC) addresses change at each hop.
What is "two-way reachability" and why is it important?
Two-way reachability means traffic can flow in both directions between source and destination. It's important because all routers in the path need routes to BOTH the source and destination networks for communication to work (including replies).
A router has these routes:
192.168.1.0/24
192.168.0.0/16
Which route will be used for a packet destined to 192.168.1.50?
192.168.1.0/24 - It's the most specific match (longest prefix length: /24 > /16 > /0)
What happens if you configure an IP address on a router interface but forget to use no shutdown?
no shutdown
The interface remains administratively down, and the Connected and Local routes will NOT appear in the routing table.
How many IP addresses does each prefix length include?
/32 = ?
/24 = ?
/16 = ?
/0 = ?
/32 = 1 address
/24 = 256 addresses
/16 = 65,536 addresses
/0 = ~4.3 billion addresses (all IPv4)
What is the difference between how routers and switches handle unknown destinations?
Routers: DROP packets with no matching route
Switches: FLOOD frames with unknown destination MAC (unknown unicast)
In a static route command, can you use slash notation (e.g., /24) for the subnet mask?
NO - You must write the full dotted-decimal mask (e.g., 255.255.255.0)
What does it mean when a static route shows as "directly connected" in the routing table?
The static route was configured with only an exit-interface (no next-hop IP). The route uses Proxy ARP to function. Note: This is different from an actual Connected (C) route.
What two numbers appear in brackets [1/0] next to static routes in the routing table?
Administrative Distance / Metric (These concepts are covered in more detail with dynamic routing protocols)
If R1 has interface G0/0 with IP 172.16.1.1/24, what command shows this information?
show ip interface brief
What is the purpose of a Local route?
To tell the router: "Packets destined for this IP address are for ME - receive them, don't forward them."
What is a "next-hop" in routing?
The next router in the path toward the destination. It's the IP address where packets should be forwarded to reach a remote network.
Fill in the blank: The default route is the _____ specific route possible, while a /32 route is the _____ specific route possible.
LEAST; MOST
What are the two main methods routers use to learn routes?
Dynamic Routing: Routers use protocols (like OSPF) to automatically share routing information
Static Routing: Network admin manually configures routes
(Note: Connected and Local routes are neither - they're added automatically when interfaces are configured)
A packet is sent from PC1 (192.168.1.10) to PC4 (192.168.4.10). What is the destination MAC address of the frame when PC1 first sends it?
The MAC address of PC1's default gateway (the router interface connected to PC1's network) - NOT PC4's MAC address.
What route would match destination IP 8.8.8.8 in this routing table?
C 192.168.1.0/24 is directly connected, G0/0
L 192.168.1.1/32 is directly connected, G0/0
S 10.0.0.0/8 via 192.168.1.2
S* 0.0.0.0/0 via 203.0.113.2
The default route (0.0.0.0/0 via 203.0.113.2) - it's the only route that matches 8.8.8.8
True or False: Routers in a path need routes to every network along the path, not just the final destination.
FALSE - Routers only need routes to the source and destination networks, not intermediate networks. Each router just needs to know the next-hop to reach the destination.
What does WAN stand for and what does it mean?
Wide Area Network - a network that extends over a large geographical area (e.g., connecting offices in different cities or countries)
Last changed17 hours ago