IPv4 addressing · Fundamentals · Module 4
VLSM: different sizes without overlap · page 3 of 3
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).
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.
| Check | Good | Broken |
|---|---|---|
Read both ends’ address and mask: show running-config | include ip address on each end | the same mask 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 outside the other end’s 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 |
Look for overlaps: show ip route with the address, on each router | each address is in one router’s subnet only | a connected route on the wrong router |
Case 1 of 2.R2 reports an overlap
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 %.
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
- The line typed for LAN 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.
Case 1 · Command
Read R2’s address lines from before the change: which of its subnets could the new address fall in?
Case 1 · Output
R2 printed these address lines before the new line was typed.
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
Scroll sideways to see the whole output
- Key line LAN 1: 192.168.9.1 with 128, a /25. Its block runs from .0 to .127.
Case 1 · What it means
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.
Case 1 · Fix
Type LAN 2’s plan address instead: 192.168.9.129 with 255.255.255.192.
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
- Picks Et0/3, the interface for LAN 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.
Case 1 · Proof
R2 then lists its address lines again.
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
- Et0/3: 192.168.9.129 with 192, a /26, the fourth line, where
no ip addressstood before.
- Et0/3: 192.168.9.129 with 192, a /26, the fourth line, where
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.
Case 2 of 2.R1’s test of R4’s LAN gets no answer
Case 2 · Symptom
R4’s LAN interface, Et0/1, has a new address, 192.168.9.65. R1 tests it and gets no answer.
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)
- Five dots.
Success rate is 0 percent: no test was answered.
Case 2 · Command
Run commands to narrow the cause, then choose it.
Choose the next command
Best next command:
R4# show running-config | include ip addressThe test goes to R4’s new address: read R4’s address lines and work out the subnet it is in.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
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
Scroll sideways to see the whole output
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 downFull 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
Scroll sideways to see the whole output
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
Scroll sideways to see the whole output
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
How to reason it out
Read the address lines: R2’s are as planned, and R4’s LAN line reads 192.168.9.65 with 224.
Work out R4’s subnet: 192.168.9.64/27.
Look for overlaps: it lies inside R2’s 192.168.9.0/25, and R2’s route for .65 is its own LAN 1.
Answer to see what it means, the fix and the proof.
Case 2 · What it means
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.
Case 2 · Fix
The fix gives R4’s LAN interface its plan address, 192.168.9.193 with 255.255.255.224.
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
- Picks Et0/1, the interface for LAN 3.
- 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.
Case 2 · Proof
After the fix, R1 tests R4’s LAN 3 address, 192.168.9.193.
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
- Five exclamation marks: five replies.
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
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.
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
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.
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
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
How to reason it out
R2’s link line reads 192.168.9.228 with 254: the plan’s .228/31.
R4’s link line reads 192.168.9.230 with 254: .230/31, a block the plan leaves free.
Summary
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 addresstakes the plan’s first host and the mask in dotted form, andshow ip interface briefshows whether it is in place.show ip route connectedlists each connected subnet with its own prefix; the header for192.168.9.0/24saysvariably subnettedbecause 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 terminalthen
interface Ethernet0/1andip addresswith 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 briefone row per interface: the address, and Status and Protocol up when the interface works.
show ip route connectedthe 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.65the route an address falls under on this router, with the interface or the next hop it leads to.