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 4

VLSM: different sizes without overlap · page 3 of 3

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

Troubleshoot

A subnet on top of another

A new address was typed inside a block that is already in use. Does the router always tell you?

Not always, so an addressing check starts from the plan, not from the router’s messages.

Four checks for an addressing fault, in this order
CheckGoodBroken
Read both ends’ address and mask: show running-config | include ip address on each endthe same mask 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 outside the other end’s 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
Look for overlaps: show ip route with the address, on each routereach address is in one router’s subnet onlya connected route on the wrong router

Case 1 of 2.R2 reports an overlap

  1. Case 1 · Symptom

    Planned LAN 2 is to be built on R2’s free interface, Et0/3. The address typed is 192.168.9.65 with the mask 255.255.255.192, and R2 answers with a line that starts with %.

    Output · IOS XE 17.18.2
    R2#configure terminalEnter configuration commands, one per line.  End with CNTL/Z.R2(config)#interface Ethernet0/31R2(config-if)#ip address 192.168.9.65 255.255.255.1922% 192.168.9.64 overlaps with Ethernet0/12% 192.168.9.64 overlaps with Ethernet0/1R2(config-if)#end
    1. The line typed for LAN 2.
    2. R2 names the subnet the new address falls in, 192.168.9.64, and the interface it overlaps: Ethernet0/1, LAN 1’s. It prints the line twice.
  2. Case 1 · Command

    Read R2’s address lines from before the change: which of its subnets could the new address fall in?

  3. Case 1 · Output

    R2 printed these address lines before the new line was typed.

    Output · IOS XE 17.18.2
    R2#show running-config | include ip address ip address 192.168.9.226 255.255.255.2521 ip address 192.168.9.1 255.255.255.128 ip address 192.168.9.228 255.255.255.254 no ip address
    1. Key line LAN 1: 192.168.9.1 with 128, a /25. Its block runs from .0 to .127.
  4. Case 1 · What it means

    Et0/3 tried .64/26R2 Et0/1: LAN 1LAN 2planned.0.64.128.192
    Figure 4.4 · The tried .64/26 lies on top of LAN 1’s .0/25, on the same router; LAN 2’s plan block starts at .128.

    The branch block as a bar. Its first half is an outlined block labeled “R2 Et0/1: LAN 1”. The next quarter is an outlined block of the same kind, labeled “LAN 2 planned”; only the word “planned” tells it from a built block. The rest of the bar is empty. Above the bar, a highlighted outline over the second half of LAN 1, from .64 to its end, tagged “Et0/3 tried .64/26”. Ticks under the bar at .0, .64, .128 and .192.

    • .65 with a /26 falls in 192.168.9.64/26, and that block lies inside LAN 1’s 192.168.9.0/25: the two would share addresses.
    • The address does not come from the plan. LAN 2’s block is 192.168.9.128/26, after LAN 1, not inside it.
  5. Case 1 · Fix

    Type LAN 2’s plan address instead: 192.168.9.129 with 255.255.255.192.

    Output · IOS XE 17.18.2
    R2#configure terminalEnter configuration commands, one per line.  End with CNTL/Z.1R2(config)#interface Ethernet0/32R2(config-if)#ip address 192.168.9.129 255.255.255.192R2(config-if)#end
    1. Picks Et0/3, the interface for LAN 2.
    2. The plan’s first host of 192.168.9.128/26 and the mask of a /26. No line with % follows.

    Impact These lines set only Et0/3, which has no cable yet. The other interfaces of R2 keep their addresses.

  6. Case 1 · Proof

    R2 then lists its address lines again.

    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. Et0/3: 192.168.9.129 with 192, a /26, the fourth line, where no ip address stood before.

End of case 1. Solved: Et0/3 now holds LAN 2’s plan address.

Before you type a new address, the plan shows you whether its block is free.

Someone plans a new link at 192.168.9.200/30. Is that block free in the branch plan?

Case 2 of 2.R1’s test of R4’s LAN gets no answer

  1. Case 2 · Symptom

    R4’s LAN interface, Et0/1, has a new address, 192.168.9.65. R1 tests it and gets no answer.

    Output · IOS XE 17.18.2
    R1#ping 192.168.9.65Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 192.168.9.65, timeout is 2 seconds:1.....2Success rate is 0 percent (0/5)
    1. Five dots.
    2. Success rate is 0 percent: 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
    R2#show ip route 192.168.9.65Routing entry for 192.168.9.0/25  Known via "connected", distance 0, metric 0 (connected, via interface)  Routing Descriptor Blocks:  * directly connected, via Ethernet0/1      Route metric is 0, traffic share count is 1
    Output · IOS XE 17.18.2
    R4#show running-config | include ip address ip address 192.168.9.229 255.255.255.254 ip address 192.168.9.65 255.255.255.224 no ip address no ip address
    Output · IOS XE 17.18.2
    R4#show ip interface briefInterface Ethernet0/0IP-Address 192.168.9.229OK? YESMethod manualStatus upProtocol upInterface Ethernet0/1IP-Address 192.168.9.65OK? YESMethod manualStatus upProtocol upInterface Ethernet0/2IP-Address unassignedOK? YESMethod unsetStatus administratively downProtocol downInterface Ethernet0/3IP-Address unassignedOK? YESMethod unsetStatus administratively downProtocol down
    Full output · 5 lines
    R4#show ip interface briefInterface              IP-Address      OK? Method Status                ProtocolEthernet0/0            192.168.9.229   YES manual up                    up      Ethernet0/1            192.168.9.65    YES manual up                    up      Ethernet0/2            unassigned      YES unset  administratively down down    Ethernet0/3            unassigned      YES unset  administratively down down    
    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.254 no ip address
    Output · IOS XE 17.18.2
    R4#show ip route connectedCodes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area        N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2       E1 - OSPF external type 1, E2 - OSPF external type 2, m - OMP       n - NAT, Ni - NAT inside, No - NAT outside, Nd - NAT DIA       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2       ia - IS-IS inter area, * - candidate default, U - per-user static route       H - NHRP, G - NHRP registered, g - NHRP registration summary       o - ODR, P - periodic downloaded static route, l - LISP       a - application route       + - replicated route, % - next hop override, p - overrides from PfR       & - replicated local route overrides by connected Gateway of last resort is not set       192.168.9.0/24 is variably subnetted, 4 subnets, 3 masksC        192.168.9.64/27 is directly connected, Ethernet0/1L        192.168.9.65/32 is directly connected, Ethernet0/1C        192.168.9.228/31 is directly connected, Ethernet0/0L        192.168.9.229/32 is directly connected, Ethernet0/0
    Cause
  3. Answer to see what it means, the fix and the proof.

  4. Case 2 · What it means

    R2branch routerSW1switchR4branch routerto .65R4 Et0/1: .64/27LAN 1.0.64.128R2 Et0/1: LAN 1
    Figure 4.5 · R4’s .64/27 lies inside R2’s LAN 1, so R2 sends what is meant for .65 into its own LAN.

    R2, the branch router, at the top, joined by a cable to the switch SW1 at its left and by another to R4, a branch router, under it. Under the cable to SW1, a separate arrow pointing from R2 toward SW1, tagged “to .65”. Under the devices, a block named LAN 1 for R2’s LAN, and a highlighted outline at .64/27 inside it, tagged “R4 Et0/1: .64/27”. Ticks at .0, .64 and .128. Under the ticks, “R2 Et0/1: LAN 1”.

    • R4’s .65 with a /27 is in .64/27: inside R2’s LAN 1, .0/25. The plan gives R4’s LAN .192/27.
    • R1’s test for .65 goes through R2, and R2’s route for .65 is its own LAN 1, on Ethernet0/1. So R2 sends the test into LAN 1, not on to R4, and no answer comes back to R1.
    • R4 took the line without a % message. When both subnets sat on R2, R2 reported the overlap; here they sit on two routers. No message does not mean that the address fits the plan.
  5. Case 2 · Fix

    The fix gives R4’s LAN interface its plan address, 192.168.9.193 with 255.255.255.224.

    Output · IOS XE 17.18.2
    R4#configure terminalEnter configuration commands, one per line.  End with CNTL/Z.1R4(config)#interface Ethernet0/12R4(config-if)#ip address 192.168.9.193 255.255.255.224R4(config-if)#end
    1. Picks Et0/1, the interface for LAN 3.
    2. The plan’s first host of 192.168.9.192/27 and the mask of a /27. No line with % follows.

    Impact Changing an interface’s address stops the packets sent to its old address, and can briefly stop the others that use that interface.

    Type a command, or tap one, then run it.

    Ticket: R1’s test of R4’s LAN address gets no answer. On R4, give the LAN interface its address from the plan.

    Output · IOS XE 17.18.2
  6. Case 2 · Proof

    After the fix, R1 tests R4’s LAN 3 address, 192.168.9.193.

    Output · IOS XE 17.18.2
    R1#ping 192.168.9.193Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 192.168.9.193, timeout is 2 seconds:1!!!!!2Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/2 ms
    1. Five exclamation marks: five replies.
    2. Success rate is 100 percent: R4 answers on its plan address.

End of case 2. Solved: R4’s LAN 3 is back on its own block.

What both cases share follows once you have answered case 2.

Both cases

Key idea

Keep the plan, and check every new address against it before you type it; when a test fails, read the routing tables for the address.

Check

In a VLSM plan, which need is placed first?
The branch needs one more LAN, for up to 14 hosts. Where does it go in the branch plan?

R4 lists its connected routes, with every interface as planned.

Tap a line, or “Not in the output”, then submit.

Find the subnet that came from the need of 20 hosts.

Output · IOS XE 17.18.2
R4#show ip route connected… 13 more lines (see Full output)
Full output · 20 lines
R4#show ip route connectedCodes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area        N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2       E1 - OSPF external type 1, E2 - OSPF external type 2, m - OMP       n - NAT, Ni - NAT inside, No - NAT outside, Nd - NAT DIA       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2       ia - IS-IS inter area, * - candidate default, U - per-user static route       H - NHRP, G - NHRP registered, g - NHRP registration summary       o - ODR, P - periodic downloaded static route, l - LISP       a - application route       + - replicated route, % - next hop override, p - overrides from PfR       & - replicated local route overrides by connected Gateway of last resort is not set       192.168.9.0/24 is variably subnetted, 4 subnets, 3 masksC        192.168.9.192/27 is directly connected, Ethernet0/1L        192.168.9.193/32 is directly connected, Ethernet0/1C        192.168.9.228/31 is directly connected, Ethernet0/0L        192.168.9.229/32 is directly connected, Ethernet0/0
A plan for 192.168.9.0/24 has placed .0/25, .128/26 and .192/27. Is 192.168.9.224/30 free?

Read both outputs, then choose the most likely cause.

Symptom: R2’s test of 192.168.9.229, R4’s end of their link, gets no answer. Compare both routers’ address lines with the plan.

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.254 no ip address
Output · IOS XE 17.18.2
R4#show running-config | include ip address ip address 192.168.9.230 255.255.255.254 ip address 192.168.9.193 255.255.255.224 no ip address no ip address
Cause

Summary

LAN 1: 100 hosts.0/25LAN 2: 50 hosts.128/26LAN 3: 20 hosts.192/27Link R1 to R2: 2 hosts.224/30Link R2 to R4: 2 hosts.228/31LAN 1LAN 2LAN 3.240Zoom from .224.232/29 freeR1 to R2.230 freeR2 to R4Free: .230/31 · .232/29 · .240/28
Figure 4.2, recap · Every need fits, each on its own boundary, with no gap between the blocks. Left free for later: .230/31, .232/29 and .240/28.

The five needs, largest first, each with its block: LAN 1 .0/25, LAN 2 .128/26, LAN 3 .192/27, the link from R1 to R2 .224/30 and the link from R2 to R4 .228/31. Under them, the block 192.168.9.0/24 as a bar filled in that order, and a row that draws the part from .224 wider. At the foot is the line “Free: .230/31 · .232/29 · .240/28”.

  • VLSM gives each need the smallest subnet that holds it, all from one block; the address plan records each need, its block and the blocks left free.
  • Placed largest first, each with the longest prefix that still holds its hosts and at the first free multiple of its block size, the branch LANs get .0/25, .128/26 and .192/27, and the plan’s links .224/30 and .228/31, with no overlap and no gap.
  • ip address takes the plan’s first host and the mask in dotted form, and show ip interface brief shows whether it is in place.
  • show ip route connected lists each connected subnet with its own prefix; the header for 192.168.9.0/24 says variably subnetted because the subnets under it have different prefix lengths.
  • R2 reported an overlap between two of its own interfaces (% 192.168.9.64 overlaps with Ethernet0/1); R4 took an overlapping address without a message, and the plan and the routing tables showed it.

Commands

  • configure terminal

    then interface Ethernet0/1 and ip address with the address and the mask in dotted form. Changing an address stops the packets sent to the old address, and can briefly stop the others that use that interface.

  • show ip interface brief

    one row per interface: the address, and Status and Protocol up when the interface works.

  • show ip route connected

    the connected subnets, each with its prefix; a header line says variably subnetted when the subnets under it have different prefix lengths.

  • show ip route 192.168.9.65

    the route an address falls under on this router, with the interface or the next hop it leads to.