A VPC subnet is the basic network unit within a VPC, representing a segment of IP address space (CIDR block) implemented via overlay network technology, decoupled from the underlay network. Communication is allowed within a subnet, and by default, across all subnets within the same VPC.
VPC subnets provide IPAM and DHCP functions.
The IP Address Management (IPAM) function allocates or reclaims IP addresses for vNICs when they are created or released in a VPC subnet.
When allocating an IP address:
If you specify an unallocated IP address that is not a network address or broadcast address (that is, an available IP address) for the vNIC, the specified IP address is used. This IP address does not need to be within the VPC subnet's allocation IP pool. If you do not specify an IP address, an IP address from the allocation IP pool is automatically assigned to the vNIC.
If the VPC subnet selected for the vNIC has an allocation IP pool configured, a random available IP address is allocated from the allocation IP pool to the vNIC. Otherwise, a random available IP address is allocated from the CIDR and marked as allocated.
The vNIC IP address can be used normally in the VPC network only after it is configured on the AOC page or automatically assigned by the system. An IP address manually configured only in the guest OS is not synchronized to the VPC subnet and cannot be used as a valid IP address for the vNIC.
Reclaiming an IP address means removing the allocated mark when a vNIC is released, making the IP address available for reallocation.
The Dynamic Host Configuration Protocol (DHCP) function responds to DHCP requests from vNICs in VPC subnets and returns the corresponding DHCP option configuration. For example, after creating a virtual machine with a vNIC, when the virtual machine sends a DHCP request through the vNIC, the DHCP service responds to the request. The response includes: