Routing Fundamentals

Learn routing basics including default gateways, Layer 2 vs Layer 3 devices, and how local and remote networks communicate.

🌐 Routing Fundamentals – Default Gateway

The default gateway is one of the most important routing concepts. If you understand this properly, routing, internet access, and troubleshooting become simpleβ€”both for CCST exams and real networks built on devices from Cisco Systems.

πŸšͺ What Is a Default Gateway?

Definition (Exam-Ready):
A default gateway is the router IP address that a device uses to send traffic outside its local network.
In simple words:
β€œWhen I don’t know where to send data, I send it to the gateway.”

🧠 Why Default Gateway Is Needed

A computer can communicate directly only with devices in the same network. To reach other networks or the internet, it needs help from a router.

That router = Default Gateway

πŸ—ΊοΈ How Default Gateway Works (Step-by-Step)

Default Gateway Working Diagram 1 Default Gateway Working Diagram 2

Example Network

    PC IP: 192.168.1.10
    Subnet Mask: 255.255.255.0
    Default Gateway: 192.168.1.1
      

Step-by-Step Flow

  1. PC tries to open google.com
  2. Destination IP is not in local network
  3. PC sends packet to default gateway
  4. Router forwards packet to ISP / Internet
  5. Response returns through the same path
Local traffic β†’ Direct
Outside traffic β†’ Gateway

🏠 Real-Life Analogy (Very Important)

To go outside your colony, you must exit through the main gate.

πŸ’» Real-World Example (Home Network)

    Laptop IP: 192.168.0.15
    Router IP: 192.168.0.1
    Default Gateway: 192.168.0.1
      

πŸ§ͺ Cisco Packet Tracer Example

Cisco Packet Tracer Default Gateway Configuration Cisco Packet Tracer Gateway Test

PC Configuration Steps

  1. Click PC
  2. Desktop β†’ IP Configuration
  3. Enter IP, Subnet Mask, Default Gateway
    IP Address: 192.168.1.10
    Subnet Mask: 255.255.255.0
    Default Gateway: 192.168.1.1
      
Without gateway: Local ping works, Internet ping fails

❌ What Happens If Default Gateway Is Missing or Wrong?

Scenario 1: Gateway Missing

Scenario 2: Wrong Gateway

Local works + Internet fails β†’ Check default gateway

πŸ“Š Default Gateway vs IP Address vs Subnet

Term Purpose
IP Address Identity of the device
Subnet Mask Defines local network
Default Gateway Exit point to other networks
All three must be correct for proper connectivity.

🧠 Default Gateway on Different Devices

πŸ›£οΈ Advanced (Extra Knowledge – Exam Boost)

Default Route on Router

    0.0.0.0/0 β†’ ISP Router
      
Meaning: β€œSend all unknown traffic this way.”
PC uses default gateway
Router uses default route

🧠 Layer 2 vs Layer 3 Devices

Understanding Layer 2 and Layer 3 devices is a core networking concept. It explains who talks using MAC addresses, who talks using IP addresses, and who can reach the internet.

This topic is very important for CCST exams, Cisco Packet Tracer labs, and real networks built using Cisco Systems devices.

πŸ“˜ Quick OSI Context (Foundation)

OSI Layer Name What It Handles
Layer 2 Data Link MAC addresses, frames
Layer 3 Network IP addresses, routing
Devices are classified based on which OSI layer they operate on.

πŸ”΅ Layer 2 Devices

Layer 2 Switch Example Layer 2 Network Devices Layer 2 Switching Concept

πŸ“Œ What Is a Layer 2 Device?

A Layer 2 device forwards data within the same network using MAC addresses.

🧠 Key Identity

πŸ” Common Layer 2 Devices

βš™οΈ How a Layer 2 Switch Works (Step-by-Step)

    PC1 (MAC A) β†’ Switch β†’ PC2 (MAC B)
      
  1. Frame enters the switch
  2. Switch reads destination MAC address
  3. Looks up MAC address table
  4. Forwards frame to correct port
If destination MAC is unknown, the switch floods the frame.

πŸ§ͺ Example (Office LAN)

    PC ─┐
    PC ─┼── Switch ─── Printer
    PC β”€β”˜
      

❌ Limitations of Layer 2 Devices

A Layer 2 switch always needs a router to go outside the LAN.

🟒 Layer 3 Devices

Layer 3 Router Example

πŸ“Œ What Is a Layer 3 Device?

A Layer 3 device forwards data between different networks using IP addresses.

🧠 Key Identity

πŸ”€ Common Layer 3 Devices

βš™οΈ How a Router Works (Step-by-Step)

    PC β†’ Switch β†’ Router β†’ Internet
      
  1. Router receives packet
  2. Reads destination IP address
  3. Checks routing table
  4. Forwards packet to next hop

πŸ§ͺ Example (Home Network)

    Laptop β†’ Wi-Fi Router β†’ Internet
      
Router is a Layer 3 device and acts as the default gateway.

🧠 Layer 3 Switch

Layer 3 Switch Example Layer 3 Switch Routing VLANs

What It Does

    VLAN 10 ─┐
             β”œβ”€ Layer 3 Switch ─ Internet
    VLAN 20 β”€β”˜
      

πŸ” Layer 2 vs Layer 3 (Exam-Ready Comparison)

Feature Layer 2 Device Layer 3 Device
OSI Layer Layer 2 Layer 3
Uses MAC Address IP Address
Data Unit Frame Packet
Network Scope Same LAN Different networks
Internet Access ❌ No βœ… Yes
Example Switch Router
Speed Faster Slightly slower

🧠 Real-World Troubleshooting Scenarios

πŸ”§ Scenario 1: PCs Can Talk, No Internet

πŸ”§ Scenario 2: One PC Not Communicating

Switch talks MAC
Router talks IP

🌍 Local vs Remote Networks

Understanding local vs remote networks answers a simple but powerful question: β€œCan my device send data directly, or does it need a router?”

This concept is at the heart of routing fundamentals, default gateway, and Layer 2 vs Layer 3β€”and is essential for CCST exams, Cisco Packet Tracer, and real networks using Cisco Systems devices.

🧠 The Big Idea (One Line)

Local network β†’ Same subnet β†’ Direct delivery
Remote network β†’ Different subnet β†’ Via router (default gateway)

🏠 Local Network

Local Network Diagram Local Network Communication

πŸ“Œ What Is a Local Network?

πŸ”‘ How a Device Knows It’s Local

The device compares the destination IP address with its own IP address using the subnet mask.

If both belong to the same network β†’ Local traffic

πŸ§ͺ Example (Same Subnet)

    PC1: 192.168.1.10 /24
    PC2: 192.168.1.20 /24
    
    Network: 192.168.1.0/24
      

Result: Local communication

πŸ“Œ Data Path

    PC1 ── Switch ── PC2
      

🧠 Real-Life Analogy

Same building β†’ Walk directly to your neighbor’s room
No main gate needed

🧠 Key Characteristics (Exam-Ready)

🌐 Remote Network

πŸ“Œ What Is a Remote Network?

πŸ”‘ How a Device Knows It’s Remote

If destination IP does NOT match local subnet β†’
Send packet to default gateway

πŸ§ͺ Example (Different Subnet)

    PC: 192.168.1.10 /24
    Server: 10.0.0.5 /24
    
    Local:  192.168.1.0/24
    Remote: 10.0.0.0/24
      

πŸ“Œ Data Path

    PC ─ Switch ─ Router ─ Internet ─ Router ─ Server
      

🧠 Real-Life Analogy

Different city β†’ Exit colony via main gate
Travel using highways (routers)

πŸ” How a PC Decides (VERY IMPORTANT)

  1. PC wants to send data
  2. Checks destination IP
  3. Applies subnet mask
  4. Makes decision:
Same network β†’ Send directly
Different network β†’ Send to default gateway

This decision is made before any packet leaves the PC.

πŸ§ͺ Cisco Packet Tracer Behavior

Case 1: Local Ping

Case 2: Remote Ping

πŸ“Š Local vs Remote (Exam-Ready Comparison)

Feature Local Network Remote Network
Subnet Same Different
Delivery Direct Via router
Device Used Switch (Layer 2) Router (Layer 3)
Address Type MAC IP
Default Gateway ❌ Not needed βœ… Required
Speed Faster Slightly slower

🧠 Common Exam Traps

🧠 Troubleshooting Using This Concept

πŸ”§ Local works, Internet doesn’t

πŸ‘‰ Default gateway or router issue

πŸ”§ Internet works, one PC can’t talk locally

πŸ‘‰ Switch, VLAN, or subnet issue