Week 6 · Lesson 10

Routing to Local and Remote Networks

A host does not randomly spray packets onto the wire. It runs a short, fixed procedure for every packet: decide whether the destination is local or remote, find the right MAC address, and hand a frame to the switch. Understand this procedure and you understand the heart of Layer 3 forwarding.

CCNA 200-301 Domain 1.0 Network Fundamentals Verified 2026-10-11
Learning objectives
Part 1

The question every host asks

Before a host can put anything on the medium, it must answer one question: is the destination on my own network, or on some other network? The answer changes everything about how the packet is addressed at Layer 2. If the destination is local, the host resolves and uses the destination’s own MAC address. If the destination is remote, the host cannot reach it directly, so it sends to its default gateway — a router that knows how to leave the local network.

The logic is the same on every operating system, from Windows to Linux to a Cisco router. The detail that trips people up is how a host decides local versus remote: it uses the subnet mask and a bitwise operation called ANDing.

In this lesson · select a part to jump

Part 2

Step 1 — build the packet

The transport layer hands down a segment. IP wraps it in an IPv4 header carrying the source IP (this host) and the destination IP (the final target), a TTL, and a protocol number. The result is a packet. Crucially, at this moment the destination IP is the final destination — it is not the router, even if the router is the next device the packet will physically reach. The packet is now ready to be placed inside a frame.

Definition — local vs remote destination A destination is local when it shares the sending host’s subnet (same network address). It is remote when it lies in a different subnet. The subnet mask, not the first digits of the address, makes that call.
Key ideas & exam traps · select one

Part 3

Step 2 — local or remote? (ANDing)

The host performs a bitwise AND between the mask and the destination address, and a second AND between the mask and its own address. If the two results match, the destination is local; if they differ, it is remote. ANDing compares bit by bit: 1 AND 1 = 1, and any zero in either operand gives 0.

Take a host at 192.168.1.10/24 (mask 255.255.255.0):

Host address   192.168.1.10  AND 255.255.255.0 = 192.168.1.0   (my network)
Destination A  192.168.1.20  AND 255.255.255.0 = 192.168.1.0   = LOCAL
Destination B  192.168.2.10  AND 255.255.255.0 = 192.168.2.0   = REMOTE

Destination A produces the same network (192.168.1.0), so it is local. Destination B produces 192.168.2.0, a different network, so it is remote. Notice that the mask does the work: guessing from “the first three numbers” fails as soon as the mask is not a /24.

Exam tip If a host ANDs its own address and the destination with the same mask and gets the same network number, the traffic is local and needs no router. A different result means the host must use its default gateway.
Part 4

Step 3 — resolve the destination MAC

The packet has IP addresses, but the wire carries frames, and a frame needs MAC addresses. The host now does one of two things:

The host then builds a Layer 2 frame: source MAC = its own, destination MAC = resolved above, carrying the packet as payload with an FCS trailer. (ARP itself is covered in the data-link week; recall that it maps IP to MAC only within a local network.)

Part 5

Step 4 — the switch forwards the frame

The host places the frame on the medium. The local switch reads only the Layer 2 header. It notes the source MAC and the port it arrived on (learning), then looks up the destination MAC in its MAC address table and forwards the frame out the matching port. For remote traffic, that destination MAC is the router’s, so the frame is delivered to the router. The switch never opens the IP header and never sees the destination IP address — that is not its job.

Part 6

Step 5 — the router decides the path

The router receives the frame, checks the FCS, and strips the Layer 2 header. Now it reads the packet’s destination IP and looks it up in its routing table using longest-prefix match (Lesson 11). The lookup names an outgoing interface and usually a next-hop address. This is the only place in the journey where the IP destination is examined to choose a path.

Before forwarding, the router decrements the packet’s TTL and recomputes the IPv4 header checksum. If the TTL reaches zero, the packet is dropped and an ICMP message is sent back. The router does not change the source or destination IP address.

Part 7

Step 6 — re-encapsulate for the next hop

To put the packet back on a wire, the router must build a brand-new Layer 2 frame. The new frame uses the router’s exit-interface MAC as the source, and the next device’s MAC as the destination (found by ARP on that link). The entire old frame — header and trailer — is discarded. Only the packet survives, unchanged except for the decremented TTL and recomputed checksum.

Definition — re-encapsulation Re-encapsulation is the router’s act of wrapping the surviving Layer 3 packet inside a new Layer 2 frame for the outgoing link. New source MAC, new destination MAC, same packet.
Part 8

Step 7 — repeat at every hop

Each router along the path repeats steps 5 and 6: strip the frame, read the IP destination, look it up, decrement TTL, and build a new frame. The packet hops from link to link until it reaches a router that is directly attached to the destination network. That last router ARPs for the final host and sends the packet in a frame addressed to the host’s MAC. The destination host strips the frame, then the IP header, and delivers the segment to the correct application.

Host A 192.168.1.10/24 Router (default gw) G0/0 .1   G0/1 .1 Host B 192.168.2.10/24 Hop 1 frame src MAC = A → dst MAC = R1 Hop 2 frame src MAC = R2 → dst MAC = B router strips old frame, builds new one PRESERVED — src IP 192.168.1.10 → dst IP 192.168.2.10 The packet’s IP addresses are the same in both hops; only the MAC addresses change.
Host A decides the destination is remote, so it frames the packet to its default gateway. The router strips that frame, then builds a new frame toward Host B. The IP addresses ride along unchanged; the MAC addresses are rewritten at each hop.
Part 9

A worked two-hop example

Host A (192.168.1.10) sends to Host B (192.168.2.10). The default gateway is 192.168.1.1, the router’s LAN-side interface. Follow the addresses in each frame:

HopSource MACDestination MACSource IPDestination IP
1  Host A → Router00:11:22:33:44:AA  (Host A)00:11:22:33:44:11  (Router G0/0)192.168.1.10192.168.2.10
2  Router → Host B00:11:22:33:44:22  (Router G0/1)00:11:22:33:44:BB  (Host B)192.168.1.10192.168.2.10

Read the IP columns: they never change. Read the MAC columns: every value is different in the two hops. That is the whole lesson in one table. With more routers you would simply add more rows, each with fresh MAC addresses and the identical IP pair.

Exam tip IP addresses are end-to-end; MAC addresses are link-to-link. If a question gives a packet crossing two routers, the source and destination IP stay fixed through all three frames, while the source MAC is the sending interface of each hop and the destination MAC is the next hop.
Part 10

The default gateway, defined

The default gateway is the router interface on the host’s own subnet that the host sends packets to when the destination is remote. It is configured on the host (manually or via DHCP) and must be an address on the host’s own subnet, otherwise the host could not reach it without a gateway — a chicken-and-egg problem. Every host has exactly one default gateway per IP configuration; a router, by contrast, has a routing table full of next hops.

Cross-reference The router’s role and the default gateway were first introduced in Week 1 · Lesson 15 (OSI Model — Network Layer), and static routes for reaching remote networks are covered in Week 3 · Lesson 6 (Static Routing). This lesson is the mechanism; Lesson 11 shows the table the router consults.
Part 11

Verify your IP parameters (Windows, macOS, Linux)

Objective 1.10 asks you to verify IP parameters for the client OS — the address, mask, default gateway, and DNS servers a host is actually using. The commands differ by operating system, but they report the same four facts. Learn one per platform and recognise them all.

What you want to seeWindowsmacOSLinux
IP address & maskipconfigifconfig en0ip addr show
Full detail (gateway, DNS, MAC)ipconfig /allnetworksetup -getinfo Wi-Fiip -c addr and ip route
Default gatewayipconfig (shows it) / route printnetstat -rn or route -n get defaultip route show
DNS serversipconfig /all or nslookupscutil --dnscat /etc/resolv.conf or resolvectl status
Test reachabilityping / tracertping / tracerouteping / traceroute
MAC / ARP cachegetmac / arp -aarp -aip link / ip neigh
Windows — ipconfig /all Shows the IPv4 address, subnet mask, default gateway, DHCP server, DNS servers, and the physical (MAC) address. ipconfig /release and ipconfig /renew drop and re-request the DHCP lease; ipconfig /flushdns clears the DNS resolver cache.
macOS — ifconfig and networksetup ifconfig en0 prints the address, mask, and status: active for the Wi-Fi/Ethernet interface (en0, en1…). networksetup -getinfo Wi-Fi adds the router (default gateway) and DNS servers. scutil --dns lists the resolver configuration.
Linux — ip The modern tool is ip: ip addr show (address and mask), ip route show (the default gateway is the line beginning default via), ip link (interface and MAC), and ip neigh (the ARP/neighbour table). The older ifconfig and route -n still appear on many systems.
Reading the mask On Windows the mask is shown as a dotted quad (255.255.255.0); macOS and Linux usually show a prefix length (/24). Same information, two notations — convert as needed using the subnetting method from Week 7.
Exam tip If a host can reach its own subnet but nothing remote, the first thing to check is the default gateway. If it reaches IP addresses but not names, check the DNS servers. If two hosts on the same subnet cannot talk, compare the subnet masks — a mismatched mask can place them on different logical networks.
Reference table · select a row

Key terms

The vocabulary you need

Every term below appears in the lesson text above. Select one to read its definition, then use the quiz at the end to check what stuck.

Key terms · select a term

Part 12 · Your turn

Review

Check what you have learned with these review questions.

Review · 6 questions

Sources

Sources & references

  1. Cisco. CCNA (200-301) Exam Topics. cisco.com.
  2. IETF. Request for Comments (RFCs). rfc-editor.org.
  3. IANA. Internet Assigned Numbers Authority registries. iana.org.

Target exams: CCNA 200-301 v1.1 · CyberOps Associate 200-201. Last content verification: 2026-10-11.