A printer that only works on its own floor
A new printer was given a static IP address by hand. Everyone on the same floor can print to it, but people in the other building can't. The printer works, the cables work and the switches work. The fault is one wrong number in its settings: the default gateway.
Five Layer 3 faults and their symptoms
| Fault | Typical symptom | How to spot it |
|---|---|---|
| Wrong IP (in the wrong subnet) | Can't even reach the gateway | Compare the host address with the gateway: same subnet? |
| Wrong mask | Some local devices work, others don't | Compare the mask with the mask on the gateway's interface |
| Wrong or no gateway | Local traffic works; other networks don't | ipconfig / ip route |
| Duplicate IP | Connection keeps dropping and coming back | Windows warning, %IP-4-DUPADDR log message on Cisco routers |
| Missing route | One remote network fails, others work | show ip route, traceroute |
Why a wrong gateway only breaks remote traffic
A host compares the destination with its own address and subnet mask (the value that shows which part of the address is the network). If the destination is in the same subnet, the host sends the packet straight to it. If not, it sends the packet to its default gateway. So a wrong gateway only breaks traffic to other networks. That is exactly what happened with the printer.
Device key: PC, floor 2 (computer) · SW1 (switch) · R1 (router) · PC, building B (laptop)
Lines show the example’s network connections. Thick links: uplinks/WAN, as labelled. The coloured path and envelope follow the current step; its text identifies the sender, receiver and traffic type.
Reading the addresses
IP labels identify interfaces or destinations. Subnet labels identify networks; /n is the prefix length. A router ID (RID) identifies a routing process and need not be a reachable interface.
An IP address alone is not a URL. A web URL includes a scheme such as https://; an address on a router or printer does not imply a website.
- PC, floor 2: IP 192.168.10.40
- Printer: GW set to .254 ✗
- R1: IP 192.168.10.1
- PC, building B: IP 192.168.30.15
- 1. Same subnet: the PC sends straight to the printer. No gateway is needed, so printing works.
- 2. From building B: the print job reaches the printer through R1.
- 3. The reply goes nowhere: the printer tries to send it to gateway 192.168.10.254, which does not exist, so the reply is never delivered. Fix: set the gateway to 192.168.10.1.
Checking address, mask and gateway on the host
C:\> ipconfig Ethernet adapter Ethernet: IPv4 Address. . . . . . . . . . . : 192.168.10.40 Subnet Mask . . . . . . . . . . . : 255.255.255.0 Default Gateway . . . . . . . . . : 192.168.10.1
ip addr and ip route.The forgotten return route
Each router on the way needs a route to the destination, and each router on the way back needs a route to the source. A ping only works if both directions work. Forgetting the return route is one of the most common mistakes when adding static routes.
Device key: PC (computer) · R1, R2 (router)
Lines show the example’s network connections. Thick links: uplinks/WAN, as labelled. The coloured path and envelope follow the current step; its text identifies the sender, receiver and traffic type.
Reading the addresses
IP labels identify interfaces or destinations. Subnet labels identify networks; /n is the prefix length. A router ID (RID) identifies a routing process and need not be a reachable interface.
An IP address alone is not a URL. A web URL includes a scheme such as https://; an address on a router or printer does not imply a website.
- PC: IP 192.168.10.40
- R2: no route to 192.168.10.0/24
- Server: IP 192.168.30.10
- 1. Going there works: R1 has a static route to 192.168.30.0/24.
- 2. Coming back fails: R2 has no route to 192.168.10.0/24, so it drops the reply. The PC only sees a timeout.
Based on Cisco documentation, not run on a lab device:
R2#show ip route 192.168.10.0 % Network not in table
R2(config)#ip route 192.168.10.0 255.255.255.0 10.0.12.1
ping 192.168.10.40 source 192.168.30.1. Using R2's LAN address as the source tests the same return path that the server's replies use.Test yourself on addressing and routing faults
A PC can reach every device in its own subnet but nothing outside it. What is the most likely fault?
A PC has 192.168.10.40/24 and gateway 192.168.1.1. What is wrong?
R1 has a route to the server's network. Traceroute from the PC shows R1 as hop 1, then only stars. What should you check on R2?