Network Infrastructure and Connectivity · Topic 3 of 9
Troubleshooting IPv4 Addressing
Troubleshoot IPv4 configuration, assignment and subnetting: wrong mask, wrong gateway, overlapping subnets, duplicates, and public versus private ranges.
- 7 min
- Usable hosts equal 2 to the host bits, minus 2. Block size equals 256 minus the mask octet.
- The first address of a subnet is the network address. The last is the broadcast. Neither goes on a host.
- A host and its default gateway must share the same subnet.
What it is
An IPv4 address is 32 bits, split by the subnet mask into a network part and a host part. Every IPv4 fault in this objective comes down to a host or interface whose address, mask or gateway does not fit the subnet it should be in.
Troubleshooting means comparing what a device has with what the design says it should have. You do this with show ip interface brief, show running-config interface, and ipconfig or ip address on hosts.
The objective also covers public and private addresses, because a private address that reaches the internet unchanged, or a range used twice, causes faults of its own.
How it works
Check the address, then the mask, then the gateway, then whether the range is public, private or special.
The key numbers
For any address and mask, find four values: the network address (host bits all 0), the broadcast address (host bits all 1), the usable range between them, and the number of usable hosts, which is 2 to the power of the host bits, minus 2.
The quick method uses the block size, which is 256 minus the mask value in the interesting octet. For 192.168.10.37/26 the block size is 64, so the subnet starts at 192.168.10.0 and the broadcast is 192.168.10.63.
| Prefix | Mask | Block size | Usable hosts |
|---|---|---|---|
| /24 | 255.255.255.0 | 256 | 254 |
| /25 | 255.255.255.128 | 128 | 126 |
| /26 | 255.255.255.192 | 64 | 62 |
| /27 | 255.255.255.224 | 32 | 30 |
| /28 | 255.255.255.240 | 16 | 14 |
| /29 | 255.255.255.248 | 8 | 6 |
| /30 | 255.255.255.252 | 4 | 2 |
A /32 identifies one host, used for loopbacks. A /31 is allowed on point-to-point links and uses both addresses.
Fault 1: wrong mask on a host
A wrong mask makes a host misjudge which addresses are local. If the mask is too short (it covers too many addresses), the host ARPs directly for addresses that are really in another subnet, instead of using the gateway.
Example: the LAN is 192.168.10.0/26 (hosts .1 to .62) and another subnet, 192.168.10.64/26, sits behind the router. A PC at 192.168.10.50 configured with mask 255.255.255.0 thinks 192.168.10.100 is on its own link, so it ARPs for it and never gets an answer.
If the mask is too long (it covers too few addresses), the host sends traffic for real local hosts to the gateway, which may or may not be able to deliver it. The symptom is partial: some destinations work and others do not, depending on which side of the wrong boundary they sit.
Fault 2: wrong default gateway
The gateway must be inside the host's own subnet and is normally the router interface address (or a first hop redundancy virtual address). A gateway outside the subnet is unreachable, so the host can talk locally but not beyond.
C:\> ipconfig
IPv4 Address. . . . . . . . . . . : 192.168.10.50
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.20.1
Here the gateway 192.168.20.1 is in a different subnet from the host. Compare it with the router: show ip interface brief should list 192.168.10.1 on the interface facing this LAN.
Another version of this fault is a gateway set to the subnet's broadcast address, or to the network address. Neither is a valid host address.
Fault 3: overlapping subnets
Two subnets overlap when they share any addresses. A router will not accept two interfaces in overlapping ranges:
Router(config-if)# ip address 192.168.1.65 255.255.255.0
% 192.168.1.0 overlaps with GigabitEthernet0/0
Overlap also appears between sites: 10.0.0.0/22 covers 10.0.0.0 to 10.0.3.255, so a second subnet 10.0.3.0/24 sits inside it. The routing table then holds a more specific route that steals traffic meant for part of the larger subnet.
The most common cause is reusing the same private range, such as 192.168.1.0/24, at two sites that are later joined by a VPN. The fix is to renumber one site, or translate between them with NAT.
Fault 4: duplicate addresses and assignment problems
Two devices with the same address cause intermittent failures, because ARP replies come from different MAC addresses. A typical source is a static address inside a DHCP pool that was not excluded.
Assignment faults also include a host that should use DHCP but has a static address, and the reverse. ipconfig /all shows whether DHCP is enabled.
A host that shows 169.254.x.x has no DHCP answer. This is a self-assigned link-local address, so look at the DHCP path, not at the cable.
Public, private and special ranges
RFC 1918 defines the private blocks. They are not routed on the internet, and they need NAT to reach it.
| Range | Prefix | Note |
|---|---|---|
| 10.0.0.0 to 10.255.255.255 | 10.0.0.0/8 | Private |
| 172.16.0.0 to 172.31.255.255 | 172.16.0.0/12 | Private |
| 192.168.0.0 to 192.168.255.255 | 192.168.0.0/16 | Private |
| 127.0.0.0/8 | Loopback | |
| 169.254.0.0/16 | Link-local, self-assigned | |
| 100.64.0.0/10 | Shared address space used by service providers, not RFC 1918 |
Most other unicast addresses outside the special ranges are public. 172.32.1.1 and 172.15.1.1 are public even though they start with 172.
The private block 172.16.0.0/12 ends at 172.31.255.255. An address such as 172.32.1.1 is public.
A private address used as a source on the internet gets no reply, because the return packets cannot be routed back. If a host reaches local resources but not the internet, check that NAT is in place on the edge router.
Work out the host's subnet first. If the gateway, the destination or the router interface falls outside it, you have found the fault.
Common mistakes
Putting a gateway in a different subnet. The host can only reach its own subnet.
Assigning the network or broadcast address to a host. Both are reserved in every subnet.
Treating all of 172.x as private. Only 172.16.0.0 through 172.31.255.255 is private.
Reusing the same private range at every site. It overlaps when the sites are joined.
Blaming the cable for a 169.254 address. The link works. The DHCP exchange failed.
What to remember for the exam
- Usable hosts equal 2 to the host bits, minus 2. Block size equals 256 minus the mask octet.
- The first address of a subnet is the network address. The last is the broadcast. Neither goes on a host.
- A host and its default gateway must share the same subnet.
- A wrong mask makes a host treat remote addresses as local.
- Interfaces on one router cannot have overlapping subnets.
- 169.254.0.0/16 is self-assigned and means DHCP did not answer.
- Private ranges: 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16. Private addresses need NAT to reach the internet.
- Duplicate addresses cause intermittent failures.
Check yourself
A PC has 192.168.10.50, mask 255.255.255.0, and gateway 192.168.20.1. What is wrong and what is the symptom?
The gateway is outside the PC's subnet, so the PC can reach local hosts but nothing beyond its own subnet.
Why does a router reject ip address 192.168.1.65 255.255.255.0 on a second interface when the first holds 192.168.1.1/24?
The two subnets overlap, because both cover 192.168.1.0 to 192.168.1.255.
Which of 172.15.4.1, 172.20.4.1 and 172.32.4.1 are public?
172.15.4.1 and 172.32.4.1 are public. Only 172.16.0.0 through 172.31.255.255 is private.
Topic 3 of 9 in Network Infrastructure and Connectivity
Test yourself on Network Infrastructure and Connectivity
The full Cisco CCNA 200-301 v2.0 question bank has 1,242 questions, with timed practice exams and an explanation for every answer.
This study guide is independent and is not affiliated with, endorsed by, or sponsored by Cisco. Vendor names, certification names and exam codes are trademarks of their respective owners and are used for identification only.