IPv4 addressing · Fundamentals · Module 4
VLSM: different sizes without overlap · page 2 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).
Configure
Type the plan on R2
R2’s LAN 1 interface has no address yet. How is the /25 from the plan typed?
The plan gives branch LAN 1 the block 192.168.9.0/25. R2’s interface on it takes the first host address, 192.168.9.1, and the mask of a /25, 255.255.255.128.
Four lines do it on R2: configure terminal to enter configuration mode, interface Ethernet0/1 to pick LAN 1’s interface, ip address with the address and the mask, and end to leave. The prompt shows where you are.
Type the lines on R2.
1R2#configure terminalEnter configuration commands, one per line. End with CNTL/Z.2R2(config)#interface Ethernet0/13R2(config-if)#ip address 192.168.9.1 255.255.255.1284R2(config-if)#end
configure terminalEnter configuration mode. New prompt:R2(config)#interface Ethernet0/1Pick LAN 1’s interface. New prompt:R2(config-if)#ip address 192.168.9.1 255.255.255.128The address, then the mask in dotted form.endLeave configuration mode. New prompt:R2#
R2’s Et0/1 now has the plan’s address and mask. No line printed a message.
Impact These lines change only Et0/1. The other interfaces of R2 keep their addresses.
Is the new address in place? show ip interface brief lists each interface with its address and its status.
Right after, R2 lists its interfaces.
- Et0/1: 192.168.9.1, with Status and Protocol
up. - The fourth interface, with no address and
administratively down, turned off in its settings.
Full output · 5 lines
R2#show ip interface briefInterface IP-Address Status ProtocolEthernet0/0 192.168.9.226 up upEthernet0/1 192.168.9.1 up upEthernet0/2 192.168.9.228 up upEthernet0/3 unassigned administratively down down
Scroll sideways to see the whole output
Key idea
Type the plan’s first host and the mask in dotted form; show ip interface brief shows whether the address is in place.
Verify
R2’s connected subnets
R2 holds three subnets of the branch block, each with its own prefix. How does its routing table show that?
Of R2’s four interfaces (Figure 4.3), three have an address.
R2, the branch router, joined by one cable each to R1, the HQ router, above it, to the switch SW1 at its left and to R4, a branch router, under it. At R2’s end of each cable, the interface name on one side of the cable and, on the other, the last octet of its address with the prefix: Et0/0 and .226/30 on the cable to R1; Et0/1 and .1/25 on the cable to SW1; Et0/2 and .228/31 on the cable to R4. A short stub at R2’s lower right, with no cable, ends beside the tag “Et0/3, no address”.
A router lists the subnet of each addressed interface that is up as a connected route, code C, and its own address in it as a local route, code L, with a /32. So expect three C lines and three L lines.
show ip route connected prints these lines under a header for the block they belong to, after the code legend and the gateway line.
R2 lists its connected routes, with every interface as planned.
Tap a line, or “Not in the output”, then submit.
Find the line that says the branch block holds subnets of different prefix lengths.
R2#show ip route connected… 13 more lines (see Full output)
192.168.9.0/24is the branch block, named above its subnets.variably subnettedmeans that the subnets under this header have different prefix lengths, as they do here with VLSM.7 subnets, 5 maskscounts every route R2 has inside the block.- LAN 1: 192.168.9.0/25 on Ethernet0/1.
- The link to R1: 192.168.9.224/30 on Ethernet0/0.
- The link to R4: 192.168.9.228/31 on Ethernet0/2.
- The three L lines: R2’s own address on each interface, as a
/32.
Full output · 22 lines
R2#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, 7 subnets, 5 masksC 192.168.9.0/25 is directly connected, Ethernet0/1L 192.168.9.1/32 is directly connected, Ethernet0/1C 192.168.9.224/30 is directly connected, Ethernet0/0L 192.168.9.226/32 is directly connected, Ethernet0/0C 192.168.9.228/31 is directly connected, Ethernet0/2L 192.168.9.228/32 is directly connected, Ethernet0/2
Why does the header count 7 subnets when six lines follow? It counts every route inside the block: the three C routes, the three L routes and one that is not connected, a route to LAN 3, 192.168.9.192/27, toward R4, which this command leaves out. Its /27 is the fifth mask, after /25, /30, /31 and /32.
You can check R4’s table against the plan the same way.
R4#show ip route connected… 13 more lines (see Full output)Gateway of last resort is not set 1 192.168.9.0/24 is variably subnetted, 2 subnets, 2 masksC 192.168.9.228/31 is directly connected, Ethernet0/0L 192.168.9.229/32 is directly connected, Ethernet0/0
- The header for the branch block in R4’s table.
Full output · 18 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, 2 subnets, 2 masksC 192.168.9.228/31 is directly connected, Ethernet0/0L 192.168.9.229/32 is directly connected, Ethernet0/0
With its plan address, 192.168.9.193 with the mask of a /27, R4’s LAN 3 interface adds the missing subnet.
Key idea
R2 lists each connected subnet with its own prefix length; variably subnetted means the block holds subnets of different prefix lengths.