[Router] dhcp enable
Step 2 Configure the address assignment method for the VLANIF interfaces.
# Add Ethernet 0/0/0 and Ethernet 0/0/1 to the corresponding VLANs respectively.
[Router] vlan batch 10 20
[Router] interface ethernet 0/0/0
[Router-Ethernet0/0/0] port hybrid pvid vlan 10
[Router-Ethernet0/0/0] port hybrid untagged vlan 10
[Router-Ethernet0/0/0] quit
[Router] interface ethernet 0/0/1
[Router-Ethernet0/0/1] port hybrid pvid vlan 20
[Router-Ethernet0/0/1] port hybrid untagged vlan 20
[Router-Ethernet0/0/1] quit
# Configure the clients connected to VLANIF 10 to obtain IP addresses from the interface address
pool.
[Router] interface vlanif 10
[Router-Vlanif10] ip address 10.1.1.1 255.255.255.0
[Router-Vlanif10] dhcp select interface
[Router-Vlanif10] quit
# Configure the clients connected to VLANIF 20 to obtain IP addresses from the interface address
pool.
[Router] interface vlanif 20
[Router-Vlanif20] ip address 10.1.2.1 255.255.255.0
[Router-Vlanif20] dhcp select interface
[Router-Vlanif20] quit
Step 3 Configure the attributes related to DNS and NetBOIS services for the interface address pool.
# Configure the DNS and NetBOIS services for VLANIF 10 address pool.
[Router] interface vlanif 10
[Router-Vlanif10] dhcp server domain-name huawei.com
[Router-Vlanif10] dhcp server dns-list 10.1.1.2
[Router-Vlanif10] dhcp server nbns-list 10.1.1.3
[Router-Vlanif10] dhcp server excluded-ip-address 10.1.1.2
[Router-Vlanif10] dhcp server excluded-ip-address 10.1.1.3
[Router-Vlanif10] dhcp server netbios-type b-node
Step 4 Configure the IP address lease for the interface address pool.
# Set the IP address lease for Office 1 to 30 days.
[Router] interface vlanif 10
[Router-Vlanif10] dhcp server lease day 30
[Router-Vlanif10] quit
# Set the IP address lease for Office 2 to 20 days.
[Router] interface vlanif 20
[Router-Vlanif20] dhcp server lease day 20
[Router-Vlanif20] quit
Step 5 Verify the configuration.
Run the display ip pool interface command on the Router. You can view the configurations of
the interface address pool.
[Router] display ip pool interface vlanif10
Pool-name : vlanif10
Pool-No : 0
Lease : 30 Days 0 Hours 0 Minutes
Domain-name : huawei.com
DNS-Server0 : 10.1.1.2
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - IP Service 6 DHCP Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright © Huawei Technologies Co., Ltd.
162