IPv4 addressing · Fundamentals · Module 2
Splitting a network into equal subnets · page 2 of 2
Show topologyHide topology
Interfaces and addresses · Et = Ethernet. LAN C, LAN D and branch LAN 2 are planned and not cabled yet.
- 192.168.8.0/26 · LAN AR1 Et0/0 192.168.8.1H1 eth0 192.168.8.10
- 192.168.8.64/26 · LAN BR1 Et0/1 192.168.8.65R3 Et0/0 192.168.8.126
- 192.168.9.224/30R1 Et0/2 192.168.9.225R2 Et0/0 192.168.9.226
- 192.168.9.228/31R2 Et0/2 192.168.9.228R4 Et0/0 192.168.9.229
- 192.168.9.0/25 · branch LAN 1 · SW1R2 Et0/1 192.168.9.1no other device yet
- 192.168.9.192/27 · branch LAN 3 · SW2R4 Et0/1 192.168.9.193no other device yet
Device icons joined by plain cables, each cable labeled with its subnet. Down the middle, top to bottom: R3, a router; R1, the HQ router; R2, the branch router; R4, a branch router; and the switch SW2. R3 is cabled to R1 (192.168.8.64/26), R1 to R2 (192.168.9.224/30), R2 to R4 (192.168.9.228/31) and R4 to SW2 (192.168.9.192/27). At the upper left, the host H1, a laptop, is cabled down from its base to R1 (192.168.8.0/26). Left of R2, the switch SW1 is cabled across to it (192.168.9.0/25).
Verify
Who answers for LAN B
When R1 sends to LAN B’s broadcast address, 192.168.8.127, who answers?
A message to the broadcast address goes to every device on LAN B, and LAN B has two, R1, which sends, and R3 (Figure 2.3).
R3 at the top and R1, the HQ router, under it, joined by one cable labeled 192.168.8.64/26 right of it. Right of the cable, at R3’s end the address ending .126, at R1’s end the address ending .65. Left of the cable, highlighted, a separate arrow points from R1 up toward R3, labeled “to .127: all of LAN B”.
ping 192.168.8.127 sends five test packets to LAN B’s broadcast address, and for each reply R1 prints a Reply line with the address of the device that answered.
R1 runs the test with LAN B as planned.
Tap a line, or “Not in the output”, then submit.
Find the first line that names the device answering for LAN B.
R1#ping 192.168.8.127
R3, the only other device on LAN B, answers every test packet sent to LAN B’s broadcast address.
- Five test packets to 192.168.8.127, LAN B’s broadcast address.
request 0is the first of the five test packets,from 192.168.8.126names the device that answered, R3, and1 msis how long the reply took.- The fifth reply, again from R3. This ping prints no Success rate line, so count the Reply lines.
No Reply line comes from .127 itself, because an address with every host bit one means “all”. It names every device of LAN B, not one of them.
Does every device on the subnet answer? Not necessarily, because a ping’s test packets to a broadcast address may be silently discarded. Each Reply line names a device on the subnet, but a device with no Reply line may still be there.
R1’s show ip interface has a Broadcast address line too, but it does not hold .127.
On R1, show ip interface, filtered for its interface toward LAN B, gives the address line and a line called Broadcast address.
R1#show ip interface Ethernet0/1 | include Internet address|Broadcast address1 Internet address is 192.168.8.65/262 Broadcast address is 255.255.255.255
Scroll sideways to see the whole output
- R1 is 192.168.8.65 with /26: LAN B’s first host.
- Broadcast address shows the address set for the interface’s broadcasts, all ones by default.
The Broadcast address line reads 255.255.255.255, the all-ones broadcast, not LAN B’s .127.
LAN B’s own broadcast address, .127, follows from the address and prefix on the first line, 192.168.8.65/26.
On another day, R2, the branch router, shows a fourth address line. The first three are R2’s other interfaces, as planned, so only the new one needs reading.
R2 shows its lines after the new one was added.
R2#show running-config | include ip address ip address 192.168.9.226 255.255.255.252 ip address 192.168.9.1 255.255.255.128 ip address 192.168.9.228 255.255.255.2541 ip address 192.168.9.129 255.255.255.192
Scroll sideways to see the whole output
- The new line, with the address, then the mask.
On IOS, the router’s own setting ip subnet-zero decides whether the router allows addresses in subnet zero.
R1 shows the line in its full settings list.
ip subnet-zero is on, so R1 allows addresses in subnet zero.
R1#show running-config all | include ip subnet-zero|ip classless1ip subnet-zero… 1 more line (see Full output)
Scroll sideways to see the whole output
- The setting is on by default.
Full output · 2 lines
R1#show running-config all | include ip subnet-zero|ip classlessip subnet-zeroip classless
Scroll sideways to see the whole output
Key idea
In R1’s ping to LAN B’s broadcast address, each Reply line named the device that answered, R3, and a missing line proves nothing. Compute the broadcast address from the address and the prefix.
Troubleshoot
R3 in the wrong block
R3 was given an address from the wrong block. What does R1 see?
| Check | Good | Broken |
|---|---|---|
Read both ends’ address and mask, with show running-config | include ip address or show ip interface on each end | the same prefix length on both ends | the masks differ |
| Work out each end’s subnet: its block, network and broadcast address | both ends in one block | one end’s address is in another block |
| Check that each address is a host address of its block | between the network and the broadcast address | it is the network or the broadcast address |
Case 1 of 2.R1’s test of R3 gets no answer
Case 1 · Symptom
R1 tests R3 and gets no answer.
R1#ping 192.168.8.126Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 192.168.8.126, timeout is 2 seconds:.....1Success rate is 0 percent (0/5)
Success rate is 0 percent, so no test was answered.
Case 1 · Command
Read R3’s address line.
Case 1 · Output
R3#show running-config | include ip address1 ip address 192.168.8.130 255.255.255.192 no ip address no ip address no ip address
Scroll sideways to see the whole output
- Key line The mask is the plan’s 255.255.255.192. The address is .130, not the plan’s .126.
Case 1 · How far it reaches
What else is affected? R1 tests R2 on its link to the branch, then pings LAN B’s broadcast address.
R1#ping 192.168.9.226Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 192.168.9.226, timeout is 2 seconds:!!!!!1Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms
Success rate is 100 percent, so R2 answers.
R1#ping 192.168.8.127Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 192.168.8.127, timeout is 2 seconds:1.....
- Five dots, so no answer comes back to R1 this time.
Case 1 · What it means
Figure 2.4 · Case 1 · R3’s .130 falls in the block that starts at .128, LAN C, not in LAN B. R3 at the top and R1 under it, joined by the LAN B cable; beside the cable, a cross tagged “no answer”. Under R1, HQ’s block as four boxes, LAN A to LAN D, each with its start. A pin on the top edge, just inside LAN B, marks “R1 .65”. The LAN C box, from .128, is highlighted, and a pin on its bottom edge, just inside it, marks “R3 .130”.
- .130 is in the block that starts at .128: R3’s subnet is 192.168.8.128/26, planned LAN C, from .128 to .191.
- R3 is cabled to LAN B but numbered in LAN C. The address R1 tests, .126, is no longer R3’s, and R1’s .65 is outside R3’s new subnet. No answer comes back to R1, not even to LAN B’s broadcast address.
- The mask is the plan’s. R2 still answers, so R1 itself works, and the changed address is on R3’s line.
Case 1 · Fix
Give R3 its plan address, 192.168.8.126, with the same mask.
R3#configure terminalEnter configuration commands, one per line. End with CNTL/Z.1R3(config)#interface Ethernet0/02R3(config-if)#ip address 192.168.8.126 255.255.255.192R3(config-if)#end
- Picks R3’s interface toward LAN B.
- The plan address with the same mask.
Impact Changing an interface’s address stops the packets sent to its old address, and can briefly stop the others that use that interface.
Case 1 · Proof
R1 tests R3 again.
R1#ping 192.168.8.126Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 192.168.8.126, timeout is 2 seconds:!!!!!1Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms
Success rate is 100 percent, so R3 answers again.
End of case 1. Solved: R3 is back in LAN B’s host range.
Case 2 of 2.The same symptom on another day
Case 2 · Symptom
R1 tests R3 and again gets no answer.
R1#ping 192.168.8.126Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 192.168.8.126, timeout is 2 seconds:.....1Success rate is 0 percent (0/5)
Success rate is 0 percent, so no test was answered.
Case 2 · Command
Run commands to narrow the cause, then choose it.
Choose the next command
Best next command:
R3# show running-config | include ip addressThe test fails toward R3: read R3’s own address line first and find its block.R3#show running-config | include ip address ip address 192.168.8.62 255.255.255.192 no ip address no ip address no ip address
Scroll sideways to see the whole output
R3#show ip interface Ethernet0/0 | include Internet address Internet address is 192.168.8.62/26
Scroll sideways to see the whole output
R1#show running-config | include ip address ip address 192.168.8.1 255.255.255.192 ip address 192.168.8.65 255.255.255.192 ip address 192.168.9.225 255.255.255.252 no ip address
Scroll sideways to see the whole output
How to reason it out
Read both ends: R1’s lines are as planned, and R3’s reads .62 with the plan’s mask.
Work out R3’s subnet: 192.168.8.0/26, from .0 to .63, LAN A.
R1’s .65 is not in it, and .126, the address R1 tests, is no longer R3’s: the two no longer share a subnet, and no answer comes back to R1.
Answer to see what it means, the fix and the proof.
Case 2 · How far it reaches
R1’s own address lines show whether anything changed on R1’s side.
R1#show running-config | include ip address ip address 192.168.8.1 255.255.255.1921 ip address 192.168.8.65 255.255.255.192 ip address 192.168.9.225 255.255.255.252 no ip address
Scroll sideways to see the whole output
- R1’s LAN B line is as planned, 192.168.8.65 with 255.255.255.192.
Case 2 · What it means
Figure 2.5 · Case 2 · R3’s .62 falls in LAN A’s block, though R3 is cabled to LAN B. R3 at the top and R1 under it, joined by the LAN B cable; beside the cable, a cross tagged “no answer”. Under R1, HQ’s block as four boxes, LAN A to LAN D, each with its start. A pin on the top edge, just inside LAN B, marks “R1 .65”. The LAN A box, from .0, is highlighted, and a pin on its bottom edge, at its right end, marks “R3 .62”: just left of R1’s pin, across the .64 boundary.
- .62 is in the block from .0 to .63: R3’s subnet is 192.168.8.0/26, LAN A.
- R3 is cabled to LAN B but numbered in LAN A, so .126 is no longer R3’s and R1’s .65 lies outside R3’s subnet. No answer comes back to R1.
- Again the block is wrong, not the mask.
Case 2 · Fix
Give R3 its plan address, 192.168.8.126, with the same mask.
Case 2 · Proof
With its plan address, R3 answers every test from R1.
R1#ping 192.168.8.126Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 192.168.8.126, timeout is 2 seconds:!!!!!1Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms
Success rate is 100 percent.
End of case 2. Solved: R3 is back in LAN B.
What both cases share follows once you have answered case 2.
Both cases
Key idea
An address belongs to the block it falls in, not to the cable it is on. Check the block, not only the mask.
Check
On R4, a branch router, with every interface as planned:
Tap a line, or “Not in the output”, then submit.
Find the line whose subnet has the broadcast address 192.168.9.223.
R4#show running-config | include ip addressScroll sideways to see the whole output
Read both outputs, then choose the most likely cause.
Symptom: R1’s test of R3 gets no answer. On R3 and on R1:
R3#show ip interface Ethernet0/0 | include Internet address Internet address is 192.168.8.130/26
Scroll sideways to see the whole output
R1#ping 192.168.9.226Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 192.168.9.226, timeout is 2 seconds:!!!!!Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms
How to reason it out
R3 reports 192.168.8.130/26: the address is .130, not the plan’s .126; the prefix is the plan’s.
R3’s subnet is 192.168.8.128/26; R1’s .65 is not in it.
Summary
“block size = 256 − 192 = 64” and “R3 · 192.168.8.126” at the top. Under them, HQ’s block as four boxes, LAN A to LAN D, starting at .0, .64, .128 and .192, with LAN B opened into three cells: “.64 network” under the left cell, “R1 .65 · hosts · R3 .126” in the middle one and “broadcast .127” under the right cell. At the foot, “LAN B · 192.168.8.64/26”.
- One mask splits the block into subnets of one size, and the first, subnet zero, is as usable as the rest.
- Block size = 256 minus the first mask octet that is not 255: 64 for /26. A subnet starts only at a multiple of its block size.
- A subnet’s first address is its network address and its last its broadcast address. The hosts lie between (LAN B, .65 to .126).
ping 192.168.8.127lists the devices that reply for LAN B. Each Reply line names one, and a missing line proves nothing. LAN B’s broadcast address itself is computed from the address and the prefix, not read from the Broadcast address line.- An address belongs to the block it falls in: R3 at .130 is cabled to LAN B but numbered in another block, and R1’s test gets no answer.
Commands
ping 192.168.8.127a ping to a subnet’s broadcast address. Each Reply line gives the address of a device that answered, and a device may also ignore the ping.
show ip interface Ethernet0/0 | include Internet addressthe interface’s address with its prefix length; work out its block from the two.
show running-config | include ip addresseach configuration line that holds “ip address”, with the address, then the mask.
show running-config all | include ip subnet-zero|ip classlessthe ip subnet-zero line, which the full settings list shows though it is the default; the filter also matches ip classless, another default line.