Routelearn.net
Course menu

Unit 14: Network TroubleshootingLesson 14.7 (7 of 10 in this unit)79 of 84 in the Network Fundamentals course

IP and gateway problems

Wrong addresses, wrong masks, wrong gateways and missing routes.

Intermediate · 7 min read

IP and gateway problems are Layer 3 faults that stop a host from reaching other devices even though its link works: a wrong IP address or subnet mask, a wrong or missing default gateway, a duplicate address, or a missing route on a router, including the route for the return traffic.

In simple terms: The cable or Wi-Fi is fine, but an address or a route is wrong, so packets can't leave the local network or can't find their way back.

A real-life situation

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.

What goes wrong at Layer 3

FaultTypical symptomHow to spot it
Wrong IP (in the wrong subnet)Can't even reach the gatewayCompare the host address with the gateway: same subnet?
Wrong maskSome local devices work, others don'tCompare the mask with the mask on the gateway's interface
Wrong or no gatewayLocal traffic works; other networks don'tipconfig / ip route
Duplicate IPConnection keeps dropping and coming backWindows warning, %IP-4-DUPADDR log message on Cisco routers
Missing routeOne remote network fails, others workshow ip route, traceroute

Why the gateway matters

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.

PC, floor 2192.168.10.40PrinterGW set to .254 ✗SW1R1192.168.10.1PC, building B192.168.30.15
  1. 1. Same subnet: the PC sends straight to the printer. No gateway is needed, so printing works.
  2. 2. From building B: the print job reaches the printer through R1.
  3. 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.

How to verify: the host side

Example output · typical of Windows, written for this lesson, not captured from a real computer
C:\> ipconfig
Ethernet adapter Ethernet:

   IPv4 Address. . . . . . . . . . . : 192.168.10.40
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : 192.168.10.1
What to look for: check three things. Is the IPv4 Address in the same subnet as the gateway? Does the Subnet Mask match the mask on the gateway's interface? Is the Default Gateway the router's real address? Here all three are correct, so ping the gateway next. On Linux, use ip addr and ip route.

Missing routes, and the return path

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.

10.0.12.0/30PC192.168.10.40R1R2no route to 192.168.10.0/24Server192.168.30.10
  1. 1. Going there works: R1 has a static route to 192.168.30.0/24.
  2. 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:

Example output · based on Cisco documentation; exact format varies by platform and software version
R2#show ip route 192.168.10.0
% Network not in table
What to look for: % Network not in table means R2 has no route to the PC's network. Without a default route either, R2 drops every reply addressed to 192.168.10.0/24.
Example output · based on Cisco documentation; exact format varies by platform and software version
R2(config)#ip route 192.168.10.0 255.255.255.0 10.0.12.1
The fix: a static route back to the PC's network, using R1's address on the shared link (10.0.12.1) as the next hop. Then test again from R2 with 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.

Check yourself

Predict · scenario 1

A PC can reach every device in its own subnet but nothing outside it. What is the most likely fault?

Predict · scenario 2

A PC has 192.168.10.40/24 and gateway 192.168.1.1. What is wrong?

Predict · scenario 3

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?