What's changed: Initial version
4.3Basic routing concepts
Covers the default gateway as the exit when leaving your own network (to another network), the difference between an L2 switch (forwarding within one segment by MAC) and an L3 switch (which can also route between networks), and how forwarding changes by whether the destination is on the local network or a remote network—as the foundation for telling "does this destination go via the gateway or arrive directly."
Many faults of the form "I reach people in the same room but only the outside server is unreachable" are about the exit to another network. Every time, a PC decides: if the destination is on its own network (the local network), hand it directly to the peer; if on a different network (a remote network), hand it to the default gateway, the "exit to the outside." This section covers the role of that exit and the difference between an L2 switch (handling within one segment) and an L3 switch (which can also route between networks), as the introductory basis for telling "does this destination go directly or via the gateway."
4.3.1Default gateway and local/remote
- A local network destination is on the same network (same subnet) as you; it is reached directly by switching within one segment, without a router. A remote network destination is on a different network and cannot be reached directly—it must go through the "exit to the outside."
- The default gateway is the address of the router (or L3 switch) that serves as the exit to hand a packet to when the destination is on another (remote) network. A PC first decides "is the destination on my own network?"; if not, it sends to the default gateway, and from there the router routes it to the final destination.
- So a missing or wrong default gateway produces the classic symptom of "communicating within the same network but unable to leave for the outside (the internet or another subnet)." The standard move is to check the gateway value with
ipconfig(Windows).
4.3.2L2 switch vs. L3 switch
- An L2 switch forwards frames within one segment (the same network) by looking at MAC addresses. It does not make cross-network decisions (routing); packets bound for another network are left to the device acting as the default gateway. The ordinary "switch" is this.
- An L3 switch adds to fast L2 switching the ability to route between networks by looking at IP addresses. Its benefit is serving as the exit that interconnects multiple internal networks (VLANs)—the default-gateway role—in a single box. It performs a router-like role at high speed within the LAN.
- The knack for telling them apart: "is the destination on my own network (reached by L2 switching) or another network (routing needed)?" Grasp the division—reaching within one network is switching, reaching another network is routing.
Most-tested: a local destination (same subnet) is switched directly, while a remote destination (another network) is routed via the default gateway; an L2 switch forwards within one segment by MAC and does not route, while an L3 switch can also route between networks by IP; a missing gateway is the classic "cannot leave for the outside" symptom.
Suppose a user reports: "I can open the shared folder at the next desk, but only a server in another department and the internet are completely unreachable." A layer-and-routing view lets you pinpoint the cause quickly. First, "I reach the next desk (the same network, the local network)" means this PC's physical connection and the switch's switching within one segment are working. The problem is that "only another department and the internet (a different network, a remote network) are unreachable," the classic pattern where the exit to another network—the default gateway—is suspect. Checking this PC's IP address and default gateway with ipconfig (Windows) often reveals the gateway address blank or off by one from the correct value. A PC first decides "is the destination on my own network?"; if yes it switches directly, if no it hands off to the default gateway—so a missing gateway produces exactly this "inside OK, outside NG" symptom. Note that as the exit bundling multiple internal networks (VLANs), an L3 switch often performs that routing role (the default gateway) in one box at high speed, so knowing "which device is the gateway" from the diagram speeds isolation. At the introductory stage, more than complex route calculation, being able to clearly draw the line "local is direct, remote is via the gateway" is the key to solving this kind of trouble.
| Aspect | To a local network | To a remote network |
|---|---|---|
| Destination location | The same network as you (same subnet) | A different network |
| How it is delivered | Switching within one segment | Routed via the default gateway |
| Handled mainly by | L2 switch | Router / L3 switch |
| If the gateway is unset | Little affected (inside still works) | Unreachable (cannot leave) |
Trap: "A default gateway is needed even to communicate with a peer on the same network" is wrong—within the local network (same subnet), delivery is direct via switching, and a default gateway is needed only for a remote (another-network) destination. Also wrong: "an L2 switch can look at IP and route to another network"—an L2 switch only forwards within one segment by MAC, and inter-network routing is the job of a router or L3 switch.
4.3.3Section summary
- A local network (same subnet) destination is switched directly; a remote network one is routed via the default gateway
- An L2 switch forwards within one segment by MAC (no routing); an L3 switch can also route between networks by IP
- "Inside works but only the outside is unreachable" is the classic missing/wrong default-gateway symptom—check the setting with
ipconfig
Sign in to track progress — Log in.
Quick check
(just a quick review)Q1. A PC can open a shared folder within its own network but cannot reach another department's server or the internet. Which setting should you check first?
Q2. You explain the difference between an L2 switch and an L3 switch to a new hire. Which statement is most accurate?
Q3. When a PC sends data to a destination, what does it basically decide before sending? Which is most appropriate?
Keep track of your progress
The full study guide is free to read. Sign up free to practice with the question bank, track what you have read, review your mistakes, and highlight passages.

