Huawei ensp experiment - DHCP networking experiment based on global address pool

Preface

This experiment is based on Huawei ensp. The version number is 1.3.00.100 V100R003C00SPC100. It is for learning and reference only and is not for any commercial use.
For specific DHCP commands, please see the series of article links, Computer Network Experiment (Huawei eNSP Simulator) - Chapter 8 Dynamic Host Configuration Protocol (DHCP)< /span>

Purpose

An enterprise has three offices in different departments on the same network. In order to save resources and reduce manual configuration costs, the hosts of the three departments are dynamically assigned IP addresses through the DHCP protocol. The network segment of department 1 is 192.168.10.0/24, and the hosts and Other devices are added to VLAN 10, and the address lease period is unlimited; Department 2's network segment is 192.168.20.0/24, and the host and other devices are added to VLAN 20, and the address lease period is unlimited; Department 3's network segment is 192.168. 30.0/24, the host and other devices join VLAN 30, and the address lease period is one month (30 days). Configure a global address pool on the core switch LSW1, and use dynamic address allocation to allocate IP addresses to hosts in the three departments. In addition, each department needs to set excluded addresses X.X.X.128-X.X.X.254 for future use.

Experiment content

First, draw the topology diagram as follows:
Insert image description here
Create three interface address pools on the core switch LSW1 and configure the IP address range, DNS address, gateway, and non-allocation of the address pools. Address and address pool lease period.
Select DHCP as the IPv4 acquisition method for all PCs:
Insert image description here
1. Enable the DHCP configuration function
Enter the command dhcp in LW1 enable, start dhcp service:

[Huawei]dhcp enable

2. Create an address pool interface address pool and address pool attributes
Configure the IP address range, DNS address, gateway, addresses not participating in allocation and address pool lease period of the address pool, Among them, ip pool 名称, creates a global address pool, and the pool is followed by the name of the global address pool; network ip地址 mask 子网掩码, the IP address here is a range, setting the range of the global address pool; dns-list, configure the DNS address; gatway-list ip地址, set the gateway of the PC; excluded-ip-address followed by two addresses, indicating the reserved IP address range; lease unlimited means that the dhcp address lease will never expire. A separate lease followed by day X hour X minute X means that the lease period is X days X hours X minutes.

The detailed commands are as follows:

[Huawei]ip pool 1	
[Huawei-ip-pool-1]network 192.168.10.0 mask 24
[Huawei-ip-pool-1]dns-list 192.168.10.1
[Huawei-ip-pool-1]gateway-list 192.168.10.1
[Huawei-ip-pool-1]excluded-ip-address 192.168.10.128 192.168.10.254
[Huawei-ip-pool-1]lease unlimited 
[Huawei-ip-pool-1]quit

[Huawei]ip pool 2
[Huawei-ip-pool-2]network 192.168.20.0 mask 24
[Huawei-ip-pool-2]dns-list 192.168.20.1
[Huawei-ip-pool-2]gateway-list 192.168.20.1
[Huawei-ip-pool-2]excluded-ip-address 192.168.20.128 192.168.20.254
[Huawei-ip-pool-2]lease unlimited 
[Huawei-ip-pool-1]quit

[Huawei]ip pool 3
[Huawei-ip-pool-3]network 192.168.30.0 mask 24
[Huawei-ip-pool-3]dns-list 192.168.30.1
[Huawei-ip-pool-3]gateway-list 192.168.30.1
[Huawei-ip-pool-3]excluded-ip-address 192.168.30.128 192.168.30.254
[Huawei-ip-pool-3]lease day 30 hour 00 minute 00 
[Huawei-ip-pool-3]quit

Insert image description here
3. Configure the address allocation method under the VLANIF interface
Add the interfaces to the corresponding VLANs, and enable the PCs under the VLAN interfaces to obtain addresses from respective global address pools, as follows Command:

[Huawei]vlan batch 10 20 30

[Huawei]interface GigabitEthernet 0/0/1	
[Huawei-GigabitEthernet0/0/1]port link-type access 	
[Huawei-GigabitEthernet0/0/1]port default vlan 10
[Huawei-GigabitEthernet0/0/1]q
[Huawei]interface GigabitEthernet 0/0/2
[Huawei-GigabitEthernet0/0/2]port link-type access
[Huawei-GigabitEthernet0/0/2]port default vlan 20
[Huawei-GigabitEthernet0/0/2]interface GigabitEthernet 0/0/3
[Huawei-GigabitEthernet0/0/3]port link-type access
[Huawei-GigabitEthernet0/0/3]port default vlan 30
[Huawei-GigabitEthernet0/0/3]q

[Huawei]interface vlanif 10
[Huawei-Vlanif10]ip address 192.168.10.1 24
[Huawei-Vlanif10]dhcp select global
[Huawei-Vlanif10]interface vlanif 20	
[Huawei-Vlanif20]ip address 192.168.20.1 24
[Huawei-Vlanif20]dhcp select global
[Huawei-Vlanif20]interface vlanif 30
[Huawei-Vlanif30]ip address 192.168.30.1 24
[Huawei-Vlanif30]dhcp select global
[Huawei-Vlanif30]q

Experimental results

You can enter the command ipconfig in the command line of the PC to query the corresponding IPv4 address, as follows:
Insert image description here
And the same department can ping, for example, PC4 in department 2 can pass Ping the IP address of PC5 using the command:
Insert image description here
In addition, you can also use the command dis ip pool to view its assigned DHCP information.

Guess you like

Origin blog.csdn.net/qq_43085848/article/details/134898562