To better understand the VLSM process, go back to the previous example.
In the previous example, shown in Figure 1, the network 192.168.20.0/24 was subnetted into eight equal sized subnets; seven of the eight subnets were allocated. Four subnets were used for the LANs and three subnets for the WAN connections between the routers. Recall that the wasted address space was in the subnets used for the WAN connections, because those subnets required only two usable addresses: one for each router interface. To avoid this waste, VLSM can be used to create smaller subnets for the WAN connections.
To create smaller subnets for the WAN links, one of the subnets will be divided. In Figure 2, the last subnet, 192.168.20.224/27, will be further subnetted.
Recall that when the number of needed host addresses is known, the formula 2^n-2 (where n equals the number of host bits remaining) can be used. To provide two usable addresses, 2 host bits must be left in the host portion.
2^2 - 2 = 2
Because there are 5 host bits in the 192.168.20.224/27 address space, 3 bits can be borrowed, leaving 2 bits in the host portion.
The calculations at this point are exactly the same as those used for traditional subnetting. The bits are borrowed and the subnet ranges are determined.
As shown in Figure 2, this VLSM subnetting scheme reduces the number addresses per subnet to a size appropriate for the WANs. Subnetting subnet 7 for WANs, allows subnets 4, 5, and 6 to be available for future networks, as well as several other subnets available for WANs.