10G Core Routing Switch User Manual
陈泽科技有限公司
- - 27 - -
www.stephen-tele.com
Subnet and Mask
Nowadays, with rapid development of the Internet, IP addresses are depleting very fast.The traditional IP address
allocation method wastes IP addresses greatly. In order to make full use of the available IP addresses, the concept of
mask and subnet is proposed. A mask is a 32-bit number corresponding to an IP address. The number consists of 1s
and 0s. Principally, these 1s and 0s can be combined randomly. However, the first consecutive bits are set to 1s when
designing the mask. The mask divides the IP address into two parts: subnet address and host address. The bits 1s in the
address and the mask indicate the subnet address and the other bits indicate the host address.If there is no sub-net
division, then its sub-net mask is the default value and the length of "1" indicates the net-id length. Therefore, for IP
addresses of classes A, B and C, the default values of corresponding sub-net mask 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 than 16,000,000 hosts
or a Class B network containing more than 60,000 hosts into multiple small networks. Each small network is called a
subnet. For example, for the Class B network address 138.38.0.0, the mask 255.255.224.0 can be used to divide the
network into 8 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 (Refer to the following figure). Each subnet can contain more than 8000 hosts.
Figure
Subnet division of IP address
6.3.2.
Assigning IP Address for a VLAN
Beginning in privileged EXEC mode, follow these steps to configure the IP address of the VLAN interface.
Command
Purpose
Step 1
config terminal
Enter global configuration mode.
Step 2
Interface vlan
vlan_id
Enter interface configuration mode, and enter the
interface to be configured as a Layer 3 interface.
Step 3
ipaddress
ip-address net-mask
Configure the IP address and IP subnet.
Step 4
end
Return to privileged EXEC mode.
Step 5
show Interface vlan
vlan_id
Verify your entries.
Step 6
Copy
running-config
startup-config
(Optional) Save your entries in the configuration file.