Showing results for 
Search instead for 
Did you mean: 

How to configure Variable-Length Subnet Masks (VLSMs)



Variable-Length Subnet Masks (VLSMs) allow the use of different masks for the same network number on different interfaces, which allows the user to conserve IP addresses and more efficiently use available address space. Enhanced Interior Gateway Router Protocol (EIGRP), Intermediate System-to-Intermediate System (IS-IS), Open Shortest Path  First (OSPF), Routing Information Protocol (RIP) Version 2, and Static routes support VLSMs.  Variable-Length Subnet Masking is configured on the router by enabling routing protocols (such as EIGRP or OSPF) that support this, and by configuring the subnet masks of the various interfaces in the ip address interface sub-command. The best way to implement VLSMs is to keep the existing numbering plan in place and gradually migrate some networks to VLSMs to recover address space.

In this example, a 14-bit subnet mask is used, leaving two bits of address space reserved for serial line host addresses. There is sufficient host    address space for two host endpoints on a point-to-point serial link:

interface ethernet 0
ip address
!---8 bits of host address space reserved for ethernets

interface serial 0
ip address
!---2 bits of address space reserved for serial lines

router ospf 107
!---Router is configured for OSPF and assigned AS 107
network area
!---Specifies network directly connected to the router

For more information, refer to the  VLSM Example section of IP Addressing and Subnetting for New Users.

For related IP addressing questions, refer to TAC Case Collection (TAC CC) solution How to configure IP addressing.