1
Configuring dynamic IPv4 address
assignment
Introduction
The following example describes the basic procedure to configure an interface as a DHCP server for
dynamic IPv4 address assignment.
Network configuration
, the core switch has three VLANs. Host A, Host B, and Host C are in VLAN 5,
VLAN 6, and VLAN 7, respectively. Configure the core switch as a DHCP server to meet the following
requirements:
•
The clients on subnets 192.168.5.0/24, 192.168.6.0/24, and 192.168.7.0/24 can obtain IP
addresses through DHCP.
•
The IP addresses of VLAN-interface 5, VLAN-interface 6, and VLAN-interface 7 on the switch
are 192.168.5.254/24, 192.168.6.254/24, and 192.168.7.254/24, respectively.
•
For the hosts in subnet 192.168.5.0/24, the DNS server IP address is 192.168.5.100 and the
gateway IP address is 192.168.5.254/24.
•
For the hosts in subnet 192.168.6.0/24, the DNS server IP address is 192.168.6.100 and the
gateway IP address is 192.168.6.254/24.
•
For the hosts in subnet 192.168.7.0/24, the DNS server IP address is 192.168.7.100 and the
gateway IP address is 192.168.7.254/24.
Figure 1 Network diagram
Procedure
# Enable DHCP on the switch.
<Switch> system-view
[Switch] dhcp enable
Switch
GE1/0/5
VLAN 5
Host A
VLAN 6
Host B
VLAN 7
Host C
GE1/0/7
GE1/0/6