Fatskills
Practice. Master. Repeat.
Study Guide: **Switching and Routing: A Practical Guide**
Source: https://www.fatskills.com/comptia-a-exam/chapter/switching-and-routing-a-practical-guide

**Switching and Routing: A Practical Guide**

By Fatskills Exam Guides Team — the exam nerds behind 28,500+ quizzes and 2.1M practice questions across 500+ global exams.

⏱️ ~8 min read

Switching and Routing: A Practical Guide


What Is This?

Switching and routing are the backbone of modern networks. Switches connect devices within a local network (LAN), forwarding data only to the intended recipient. Routers connect multiple networks (e.g., LAN to the internet), directing traffic between them.

You use them daily—every time you load a webpage, stream a video, or send an email. Without switching and routing, the internet and corporate networks wouldn’t function.


Why It Matters

  • Enables communication: Devices (phones, laptops, servers) talk to each other efficiently.
  • Scales networks: Routers allow global connectivity; switches optimize local traffic.
  • Secures traffic: Filters malicious data, enforces access rules, and segments networks.
  • Business-critical: Downtime = lost revenue. Reliable switching/routing keeps operations running.

Industries like finance, healthcare, and cloud computing depend on fast, secure, and scalable networks.


Core Concepts


1. MAC Addresses vs. IP Addresses

  • MAC (Media Access Control) Address: A unique hardware identifier (e.g., 00:1A:2B:3C:4D:5E). Used by switches to forward frames within a LAN.
  • IP (Internet Protocol) Address: A logical address (e.g., 192.168.1.1). Used by routers to direct packets between networks.

Key difference: MACs operate at Layer 2 (Data Link), IPs at Layer 3 (Network).

2. Switching: How Data Moves Within a LAN

  • Forwarding decisions: Switches use a MAC address table to map ports to devices.
  • Broadcast vs. Unicast:
  • Broadcast: Sent to all devices (e.g., ARP requests).
  • Unicast: Sent to one device (e.g., a file download).
  • Collision domains: Modern switches (full-duplex) eliminate collisions; hubs (half-duplex) don’t.

3. Routing: How Data Moves Between Networks

  • Routing table: A router’s "map" of networks and next-hop destinations.
  • Static vs. Dynamic Routing:
  • Static: Manually configured paths (simple, but inflexible).
  • Dynamic: Protocols (e.g., OSPF, BGP) automatically update routes.
  • Default gateway: The router a device sends traffic to when the destination is outside the LAN.

4. Subnetting and CIDR

  • Subnet mask: Defines which part of an IP is the network vs. host (e.g., 255.255.255.0 = /24).
  • CIDR (Classless Inter-Domain Routing): Notation like 192.168.1.0/24 to represent a subnet.
  • Why it matters: Efficiently divides networks, reduces broadcast traffic, and improves security.

5. Network Address Translation (NAT)

  • Purpose: Lets multiple devices share one public IP (e.g., home routers).
  • How it works: Rewrites source/destination IPs in packets as they pass through the router.
  • Types:
  • Static NAT: One-to-one mapping (e.g., a public server).
  • Dynamic NAT: Many-to-many (e.g., a company’s internal devices).
  • PAT (Port Address Translation): Many-to-one (most home routers).


How It Works


Switching (Layer 2)

  1. Device A sends a frame to Device B (MAC: 00:1A:2B:3C:4D:5E).
  2. The switch checks its MAC address table:
  3. If the MAC is known, it forwards the frame only to the correct port.
  4. If unknown, it floods the frame to all ports (except the sender’s).
  5. Device B receives the frame; other devices ignore it.

Example MAC table:


Port | MAC Address
-----|------------
1    | 00:1A:2B:3C:4D:5E
2    | 00:1B:2C:3D:4E:5F
3    | (unknown)

Routing (Layer 3)

  1. Device A (192.168.1.10) wants to send data to Device C (10.0.0.5).
  2. The router checks its routing table:
  3. If 10.0.0.0/24 is directly connected, it forwards the packet to the correct interface.
  4. If not, it sends the packet to the next-hop router (e.g., 192.168.1.1).
  5. NAT (if enabled): The router rewrites the source IP to its public IP (203.0.113.1) before sending it to the internet.

Example routing table:


Destination   | Next Hop      | Interface
--------------|---------------|----------
192.168.1.0/24| Direct        | eth0
10.0.0.0/24   | 192.168.1.1   | eth0
0.0.0.0/0     | 203.0.113.254 | eth1 (default route)


Hands-On / Getting Started


Prerequisites

  • Hardware: 2+ computers, a switch, a router (or use virtual labs like Cisco Packet Tracer, GNS3).
  • Software: Wireshark (for packet analysis), PuTTY (for router CLI access).
  • Knowledge: Basic IP addressing, command-line familiarity.

Step 1: Build a Simple Switched Network

  1. Connect two computers to a switch.
  2. Assign static IPs in the same subnet (e.g., 192.168.1.10/24 and 192.168.1.20/24).
  3. Ping one computer from the other:
    bash
    ping 192.168.1.20
  4. Expected outcome: Successful ping; the switch forwards frames based on MAC addresses.

Step 2: Configure a Router for Internet Access

  1. Connect a router to the switch and a modem (or use a virtual router).
  2. Configure the router’s LAN interface:
    bash
    # Example Cisco IOS commands
    enable
    configure terminal
    interface GigabitEthernet0/0
    ip address 192.168.1.1 255.255.255.0
    no shutdown
  3. Configure NAT (if using a public IP):
    bash
    ip nat inside source list 1 interface GigabitEthernet0/1 overload
    access-list 1 permit 192.168.1.0 0.0.0.255
  4. Set the default gateway on a computer to 192.168.1.1.
  5. Expected outcome: Computers can access the internet; the router translates private IPs to public.

Step 3: Observe Traffic with Wireshark

  1. Install Wireshark on a computer.
  2. Start capturing on the network interface.
  3. Ping another device and observe:
  4. ARP request: "Who has 192.168.1.20? Tell 192.168.1.10."
  5. ICMP echo request/reply: The actual ping packets.
  6. Expected outcome: Understand how switches and routers handle traffic.

Common Pitfalls & Mistakes


1. Misconfigured Subnet Masks

  • Mistake: Using /24 when /16 is needed (or vice versa).
  • Result: Devices can’t communicate; traffic leaks to wrong networks.
  • Fix: Double-check subnet masks and CIDR notation.

2. Forgetting the Default Gateway

  • Mistake: Not setting a default gateway on devices.
  • Result: Devices can’t reach external networks (e.g., the internet).
  • Fix: Always configure the default gateway (usually the router’s LAN IP).

3. Switch Loops (Broadcast Storms)

  • Mistake: Connecting two switches with multiple cables without STP (Spanning Tree Protocol).
  • Result: Network meltdown; switches flood traffic endlessly.
  • Fix: Enable STP or use port aggregation (LACP) for redundancy.

4. Incorrect NAT Configuration

  • Mistake: Not defining "inside" and "outside" interfaces for NAT.
  • Result: Devices can’t access the internet.
  • Fix: Explicitly mark interfaces: bash ip nat inside # On the LAN interface ip nat outside # On the WAN interface

5. Overlooking Security (ACLs, Firewalls)

  • Mistake: Leaving default passwords or open ports.
  • Result: Network breaches or unauthorized access.
  • Fix: Change default credentials, use ACLs (Access Control Lists), and disable unused services.


Best Practices


For Switching

  • Use VLANs: Segment traffic (e.g., separate VoIP, guest Wi-Fi, and corporate data).
  • Enable STP: Prevent loops in redundant topologies.
  • Port security: Limit MAC addresses per port to prevent unauthorized devices.
  • Monitor traffic: Use tools like PRTG or SolarWinds to detect anomalies.

For Routing

  • Avoid static routes for large networks: Use dynamic routing (OSPF, BGP) for scalability.
  • Implement QoS: Prioritize critical traffic (e.g., VoIP, video conferencing).
  • Log and alert: Set up syslog for router events (e.g., failed login attempts).
  • Backup configs: Save router configurations regularly.

For Both

  • Document everything: Network diagrams, IP schemas, and device configs.
  • Test changes in a lab: Never deploy untested configurations in production.
  • Plan for redundancy: Use multiple paths, failover routers, and UPS for power.


Tools & Frameworks

Tool/Framework Use Case When to Use
Cisco Packet Tracer Simulate networks (switches, routers). Learning, testing configs.
GNS3 Advanced network emulation (real OS images). Complex topologies, cert prep.
Wireshark Packet analysis and troubleshooting. Debugging connectivity issues.
pfSense Open-source firewall/router. Small business or home networks.
Ubiquiti UniFi Managed switches and wireless APs. SMBs, home labs.
Juniper Junos Enterprise-grade routing/switching. Large networks, ISPs.
OpenWRT Customizable router firmware. DIY routers, IoT networks.


Real-World Use Cases


1. Corporate Office Network

  • Scenario: A company with 500 employees needs secure, segmented access.
  • Solution:
  • Switches: Connect workstations, printers, and VoIP phones (VLANs for departments).
  • Routers: Route traffic between VLANs and to the internet (NAT, ACLs for security).
  • Firewalls: Filter malicious traffic (e.g., block social media during work hours).

2. Data Center Interconnect

  • Scenario: A cloud provider needs low-latency, high-bandwidth connections between servers.
  • Solution:
  • Layer 2 switching: High-speed fabric (e.g., Cisco Nexus) for server-to-server traffic.
  • Layer 3 routing: BGP to connect to other data centers and ISPs.
  • Load balancers: Distribute traffic across servers (e.g., F5 BIG-IP).

3. Home Network with IoT Devices

  • Scenario: A smart home with cameras, thermostats, and voice assistants.
  • Solution:
  • Switch: Connect wired devices (e.g., NAS, gaming PC).
  • Router: Segment IoT devices into a separate VLAN for security.
  • Firewall: Block IoT devices from accessing the main network.


Check Your Understanding (MCQs)


Question 1

A switch receives a frame with a destination MAC address not in its table. What does the switch do? - A: Drops the frame.
- B: Sends the frame to all ports except the sender’s.
- C: Forwards the frame to the default gateway.
- D: Sends an ARP request to find the MAC.

Correct Answer: B
Explanation: Switches flood unknown unicast frames to all ports (except the source) to locate the device.
Why the Distractors Are Tempting: - A: Incorrect; switches don’t drop unknown frames (unlike routers with no route).
- C: Incorrect; switches don’t use default gateways (that’s a router function).
- D: Incorrect; ARP is used to map IPs to MACs, not for unknown MACs.


Question 2

A router’s routing table has the following entries:


192.168.1.0/24  Direct  eth0
10.0.0.0/8      192.168.1.2  eth0
0.0.0.0/0       203.0.113.1  eth1

Where will the router send a packet destined for 10.5.6.7? - A: Directly to 10.5.6.7 via eth0.
- B: To 192.168.1.2 via eth0.
- C: To 203.0.113.1 via eth1.
- D: Drops the packet.

Correct Answer: B
Explanation: The router matches 10.5.6.7 to 10.0.0.0/8 and forwards it to 192.168.1.2 (the next hop).
Why the Distractors Are Tempting: - A: Incorrect; 10.5.6.7 isn’t directly connected (no "Direct" route).
- C: Incorrect; the default route (0.0.0.0/0) is only used if no other match exists.
- D: Incorrect; routers don’t drop packets unless no route exists.


Question 3

You configure NAT on a router to allow internal devices (192.168.1.0/24) to access the internet. After setup, devices can ping external IPs but can’t browse websites. What’s the most likely issue? - A: The router’s default gateway is misconfigured.
- B: DNS settings are missing on the internal devices.
- C: The NAT ACL is blocking HTTP traffic.
- D: The router’s WAN interface is down.

Correct Answer: B
Explanation: Ping uses ICMP (works), but browsing requires DNS resolution (fails if DNS isn’t configured).
Why the Distractors Are Tempting: - A: Incorrect; if the default gateway were wrong, ping wouldn’t work.
- C: Incorrect; NAT ACLs typically allow all outbound traffic by default.
- D: Incorrect; if the WAN interface were down, ping wouldn’t work.


Learning Path


Beginner (0–3 Months)

  1. Learn networking basics:
  2. OSI model, TCP/IP, IP addressing, subnetting.
  3. Resources: Computer Networking: A Top-Down Approach (Kurose & Ross), Cisco’s Networking Academy.
  4. Hands-on with switches:
  5. Configure a basic LAN (static IPs, VLANs).
  6. Tools: Cisco Packet Tracer, home lab with a managed switch.
  7. Hands-on with routers:
  8. Set up a home router, configure NAT, static routes.
  9. Tools: pfSense, OpenWRT, or a used Cisco router.

Intermediate (3–12 Months)

  1. Dynamic routing:
  2. Learn OSPF, EIGRP, or BGP (start with OSPF).
  3. Labs: GNS3 with Cisco/Juniper images.
  4. Network security:


ADVERTISEMENT