xkonekt
Language: EN
  • English
  • Türkçe
  • Español, Coming soon
  • Português, Coming soon
  • Deutsch, Coming soon
  • Français, Coming soon

IPv4 addressing · Fundamentals · Module 2

Splitting a network into equal subnets · page 2 of 2

Show topologyHide topology
R3routerH1hostR1HQ routerR2branch routerSW1switchR4branch routerSW2switch192.168.8.0/26192.168.8.64/26192.168.9.224/30192.168.9.228/31192.168.9.0/25192.168.9.192/27

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
Topology · R1 joins HQ’s LAN A and LAN B and the link to the branch; the branch block is split into LANs and links of different sizes, and R2 and R4 hold the branch LANs.

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).

R3routerR1HQ router192.168.8.64/26.126.65to .127: all of LAN B
Figure 2.3 · LAN B holds R1 and R3, and a message to .127 goes to every device on it.

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.

Output · IOS XE 17.18.2
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.

  1. Five test packets to 192.168.8.127, LAN B’s broadcast address.
  2. request 0 is the first of the five test packets, from 192.168.8.126 names the device that answered, R3, and 1 ms is how long the reply took.
  3. 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.

Output · IOS XE 17.18.2
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
  1. R1 is 192.168.8.65 with /26: LAN B’s first host.
  2. 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.

Output · IOS XE 17.18.2
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
  1. The new line, with the address, then the mask.
Which subnet does R2’s last line belong to, and what are its first host and broadcast address?

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.

Output · IOS XE 17.18.2
R1#show running-config all | include ip subnet-zero|ip classless1ip subnet-zero… 1 more line (see Full output)
  1. The setting is on by default.
Full output · 2 lines
R1#show running-config all | include ip subnet-zero|ip classlessip subnet-zeroip classless

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?

Three checks for a wrong address, in this order
CheckGoodBroken
Read both ends’ address and mask, with show running-config | include ip address or show ip interface on each endthe same prefix length on both endsthe masks differ
Work out each end’s subnet: its block, network and broadcast addressboth ends in one blockone end’s address is in another block
Check that each address is a host address of its blockbetween the network and the broadcast addressit is the network or the broadcast address

Case 1 of 2.R1’s test of R3 gets no answer

  1. Case 1 · Symptom

    R1 tests R3 and gets no answer.

    Output · IOS XE 17.18.2
    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)
    1. Success rate is 0 percent, so no test was answered.
  2. Case 1 · Command

    Read R3’s address line.

  3. Case 1 · Output

    Output · IOS XE 17.18.2
    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
    1. Key line The mask is the plan’s 255.255.255.192. The address is .130, not the plan’s .126.
  4. 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.

    Output · IOS XE 17.18.2
    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
    1. Success rate is 100 percent, so R2 answers.
    Output · IOS XE 17.18.2
    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.....
    1. Five dots, so no answer comes back to R1 this time.
  5. Case 1 · What it means

    R3routerR1HQ routerLAN Bno answer192.168.8.0/24LAN A.0LAN B.64LAN C.128LAN D.192R1 .65R3 .130
    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.
  6. Case 1 · Fix

    Give R3 its plan address, 192.168.8.126, with the same mask.

    Output · IOS XE 17.18.2
    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
    1. Picks R3’s interface toward LAN B.
    2. 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.

  7. Case 1 · Proof

    R1 tests R3 again.

    Output · IOS XE 17.18.2
    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
    1. 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

  1. Case 2 · Symptom

    R1 tests R3 and again gets no answer.

    Output · IOS XE 17.18.2
    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)
    1. Success rate is 0 percent, so no test was answered.
  2. Case 2 · Command

    Run commands to narrow the cause, then choose it.

    Choose the next command

    Output · IOS XE 17.18.2
    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
    Output · IOS XE 17.18.2
    R3#show ip interface Ethernet0/0 | include Internet address  Internet address is 192.168.8.62/26
    Output · IOS XE 17.18.2
    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
    Cause
  3. Answer to see what it means, the fix and the proof.

  4. Case 2 · How far it reaches

    R1’s own address lines show whether anything changed on R1’s side.

    Output · IOS XE 17.18.2
    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
    1. R1’s LAN B line is as planned, 192.168.8.65 with 255.255.255.192.
  5. Case 2 · What it means

    R3routerR1HQ routerLAN Bno answer192.168.8.0/24LAN A.0LAN B.64LAN C.128LAN D.192R1 .65R3 .62
    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.
  6. Case 2 · Fix

    Give R3 its plan address, 192.168.8.126, with the same mask.

  7. Case 2 · Proof

    With its plan address, R3 answers every test from R1.

    Output · IOS XE 17.18.2
    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
    1. 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.

R3 keeps the plan’s mask but is given 192.168.8.100/26. Which subnet is R3 in, and is R1’s .65 inside it?

Check

What is the block size of a /27?
For 192.168.8.200/27, which are the network address, first host, last host and broadcast address?

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.

Output · IOS XE 17.18.2
R4#show running-config | include ip address
Which subnet holds 192.168.8.70/28?

Read both outputs, then choose the most likely cause.

Symptom: R1’s test of R3 gets no answer. On R3 and on R1:

Output · IOS XE 17.18.2
R3#show ip interface Ethernet0/0 | include Internet address  Internet address is 192.168.8.130/26
Output · IOS XE 17.18.2
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
Cause

Summary

block size = 256 − 192 = 64R3 · 192.168.8.126LAN A.0LAN B.64LAN C.128LAN D.192R1 .65 · hosts · R3 .126.64 networkbroadcast .127LAN B · 192.168.8.64/26
Figure 2.2, recap · LAN B is 192.168.8.64/26, with network .64, hosts .65 to .126, broadcast .127.

“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.127 lists 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.127

    a 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 address

    the interface’s address with its prefix length; work out its block from the two.

  • show running-config | include ip address

    each configuration line that holds “ip address”, with the address, then the mask.

  • show running-config all | include ip subnet-zero|ip classless

    the ip subnet-zero line, which the full settings list shows though it is the default; the filter also matches ip classless, another default line.