Example for Configuring a DHCP Server in a Super-VLAN
Networking Requirements
As shown in Figure 3-14, an enterprise has two departments that are allocated the same network segment to save IP address resources. Users in departments A and B belong to different VLANs. For unified management, the enterprise administrator requires that a DHCP server be deployed to dynamically allocate IP addresses to terminals in the departments. Layer 3 communication is required between users in different departments to meet service requirements.
Configuration Roadmap
Configure sub-VLANs on the Router to implement Layer 2 isolation between users in different sub-VLANs. The sub-VLANs are on the same network segment, which reduces the amount of required IP address resources.
Configure proxy ARP on the VLANIF interface of the super-VLAN to implement Layer 3 communication among sub-VLANs.
Configure a DHCP server in the super-VLAN to dynamically allocate IP addresses to terminals in departments A and B.
Procedure
- Create VLAN 2, and add Eth0/0/1 and Eth0/0/2 to VLAN 2. Create VLAN 3, and add Eth0/0/3 and Eth0/0/4 to VLAN 3.
<Huawei> system-view [Huawei] sysname Router [Router] vlan batch 2 to 4 [Router] interface Ethernet 0/0/1 [Router-Ethernet0/0/1] port link-type access [Router-Ethernet0/0/1] port default vlan 2 [Router-Ethernet0/0/1] quit [Router] interface Ethernet 0/0/2 [Router-Ethernet0/0/2] port link-type access [Router-Ethernet0/0/2] port default vlan 2 [Router-Ethernet0/0/2] quit [Router] interface Ethernet 0/0/3 [Router-Ethernet0/0/3] port link-type access [Router-Ethernet0/0/3] port default vlan 3 [Router-Ethernet0/0/3] quit [Router] interface Ethernet 0/0/4 [Router-Ethernet0/0/4] port link-type access [Router-Ethernet0/0/4] port default vlan 3 [Router-Ethernet0/0/4] quit
- Configure a super-VLAN to implement VLAN aggregation.
# Configure the super-VLAN.
[Router] vlan 4 [Router-vlan4] aggregate-vlan [Router-vlan4] access-vlan 2 to 3 [Router-vlan4] quit
# Configure the VLANIF interface.
[Router] interface vlanif 4 [Router-Vlanif4] ip address 10.1.1.12 255.255.255.0
- Configure proxy ARP.
[Router-Vlanif4] arp-proxy inter-sub-vlan-proxy enable [Router-Vlanif4] quit
- Configure a DHCP server based on the interface address pool on VLANIF 4 to dynamically allocate IP addresses to terminals in sub-VLANs.
[Router] dhcp enable [Router] interface vlanif 4 [Router-Vlanif4] dhcp select interface [Router-Vlanif4] quit
- Verify the configuration.
# After the configuration is complete, run the display ip pool interface vlanif4 command on the Router to view IP address allocation in the address pool. The Used field displays the number of used IP addresses in an address pool.
[Router] display ip pool interface vlanif4 Pool-name : Vlanif4 Pool-No : 0 Lease : 1 Days 0 Hours 0 Minutes Domain-name : huawei.com DNS-server0 : 10.1.1.2 NBNS-server0 : - Netbios-type : - Position : Interface Status : Unlocked Gateway-0 : 10.1.1.12 Network : 10.1.2.0 Mask : 255.255.255.0 VPN instance : -- Logging : Disable Conflicted address recycle interval: -- Address Statistic: Total :253 Used :4 Idle :249 Expired :0 Conflict :0 Disable :0 ------------------------------------------------------------------------------- Network section Start End Total Used Idle(Expired) Conflict Disabled ------------------------------------------------------------------------------- 10.1.2.1 10.1.2.254 253 4 249(0) 0 0 -------------------------------------------------------------------------------
Configuration Files
Router configuration file
# sysname Router # vlan batch 2 to 4 # dhcp enable # vlan 4 aggregate-vlan access-vlan 2 to 3 # interface Vlanif4 ip address 10.1.1.12 255.255.255.0 arp-proxy inter-sub-vlan-proxy enable dhcp select interface # interface Ethernet0/0/1 port link-type access port default vlan 2 # interface Ethernet0/0/2 port link-type access port default vlan 2 # interface Ethernet0/0/3 port link-type access port default vlan 3 # interface Ethernet0/0/4 port link-type access port default vlan 3 # return