Configuring an IP Address for a VLAN Interface 129address, and the part corresponding to the remaining “0” bits in the mask is thehost address. If there is no subnet division, the subnet mask uses the default valueand the length of 1s in the mask is equal to the net-id length. Therefore, for IPaddresses of classes A, B and C, the default values of the corresponding subnetmasks are 255.0.0.0, 255.255.0.0 and 255.255.255.0 respectively.The mask can be used to divide a Class A network containing more than16,000,000 hosts or a Class B network containing more than 60,000 hosts intomultiple small networks. Each small network is called a subnet. For example, forthe Class B network address 138.38.0.0, the mask 255.255.224.0 can be used todivide the network into eight subnets: 138.38.0.0, 138.38.32.0, 138.38.64.0,138.38.96.0, 138.38.128.0, 138.38.160.0, 138.38.192.0 and 138.38.224.0 (seeFigure 38). Each subnet can contain more than 8000 hosts.Figure 38 Subnet division of the IP addressConfiguring an IPAddress for a VLANInterfaceA VLAN interface obtains an IP address with an IP address configurationcommand. Generally, it is enough to configure one IP address for a VLANinterface. However, you can configure up to eight IP addresses for a VLANinterface so that the interface can be connected to several subnets. Among theseIP addresses, one is the primary IP address and the others are secondary ones.10001010, 00100110, 000 00000, 00000000ClassB138.38.0.0Subnet mask255.255.224.011111111, 11111111, 111 00000, 0000000011111111, 11111111, 000 00000, 00000000Standardmask255.255.0.0Subnet address:000 Subnet address: 138.38. 0. 0001 Subnet address: 138.38. 32. 0010 Subnet address: 138.38. 64. 0011 Subnet address: 138.38. 96. 0100 Subnet address: 138.38.128. 0101 Subnet address: 138.38.160. 0110 Subnet address: 138.38.192. 0111 Subnet address: 138.38.224. 0Subnetnumber HostnumberSubnet address:10001010, 00100110, 000 00000, 00000000ClassB138.38.0.0Subnet mask255.255.224.011111111, 11111111, 111 00000, 0000000011111111, 11111111, 000 00000, 00000000Standardmask255.255.0.0Subnet address:000 Subnet address: 138.38. 0. 0001 Subnet address: 138.38. 32. 0010 Subnet address: 138.38. 64. 0011 Subnet address: 138.38. 96. 0100 Subnet address: 138.38.128. 0101 Subnet address: 138.38.160. 0110 Subnet address: 138.38.192. 0111 Subnet address: 138.38.224. 0Subnetnumber HostnumberSubnet address:10001010, 00100110, 000 00000, 00000000ClassB138.38.0.0Subnet mask255.255.224.011111111, 11111111, 111 00000, 0000000011111111, 11111111, 000 00000, 00000000Standardmask255.255.0.0Subnet address:000 Subnet address: 138.38. 0. 0001 Subnet address: 138.38. 32. 0010 Subnet address: 138.38. 64. 0011 Subnet address: 138.38. 96. 0100 Subnet address: 138.38.128. 0101 Subnet address: 138.38.160. 0110 Subnet address: 138.38.192. 0111 Subnet address: 138.38.224. 0Subnetnumber HostnumberSubnet address:10001010, 00100110, 000 00000, 00000000ClassB138.38.0.0Subnet mask255.255.224.011111111, 11111111, 111 00000, 0000000011111111, 11111111, 000 00000, 00000000Standardmask255.255.0.0Subnet address:000 Subnet address: 138.38. 0. 0001 Subnet address: 138.38. 32. 0010 Subnet address: 138.38. 64. 0011 Subnet address: 138.38. 96. 0100 Subnet address: 138.38.128. 0101 Subnet address: 138.38.160. 0110 Subnet address: 138.38.192. 0111 Subnet address: 138.38.224. 0Subnetnumber HostnumberSubnet address:Table 74 Configure an IP address for a VLAN interfaceOperation Command DescriptionEnter system view system-view -Enter VLAN interface view interface Vlan-interface vlan-id -Configure an IP addressfor a VLAN interfaceip address ip-address { mask |mask-length } [ sub ]RequiredBy default, a VLANinterface has no IP address.