Deploy and configure DHCP server experiment: automatically assign IP addresses and network configuration
【Purpose】
- Deploy a DHCP server.
- Familiar with the configuration method of the DHCP server.
- Verify topology.
【Experimental Topology】
The experimental topology is shown in the figure.
The device parameters are shown in the table below.
equipment |
interface |
IP address |
subnet mask |
default gateway |
DHCPSERVE |
F0/0 |
172.16.10.1 |
255.255.255.0 |
172.16.10.254 |
【Experimental content】
- Configure DHCP server
- PC1 Acquisition Test
【Experimental steps】
- Configure DHCP server
The basic configuration of DHCPSERVER is as follows:
Router>enable
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname DHCPSERVER
DHCPSERVER(config)#interface f0/0
DHCPSERVER(config-if)#ip address 192.168.10.1 255.255.255.0
DHCPSERVER(config-if)#no shutdown
DHCPSERVER(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
DHCPSERVER(config-if)#exit
DHCPSERVER(config)#ip dhcp pool dhcp
DHCPSERVER(dhcp-config)#network 192.168.10.0 255.255.255.0
DHCPSERVER(dhcp-config)#default-router 192.168.10.1
DHCPSERVER(dhcp-config)#dns-server 8.8.8.8
DHCPSERVER(dhcp-config)#domain-name dhcptest
DHCPSERVER(dhcp-config)#?
default-router Default routers
dns-server Set name server
domain-name Domain name
exit Exit from DHCP pool configuration mode
network Network number and mask
no Negate a command or set its defaults
option Raw DHCP options
DHCPSERVER(dhcp-config)#lease 10 //This command is not supported in PT
DHCPSERVER(dhcp-config)#end
DHCPSERVER#
%SYS-5-CONFIG_I: Configured from console by console
DHCPSERVER#wr
Building configuration...
[OK]
DHCPSERVER#
2. PC1 get test
(1) PC1 obtains the IP address
3. View DHCPSERVER information
DHCPSERVER#show ip dhcp pool
Pool dhcp :
Utilization mark (high/low) : 100 / 0
Subnet size (first/next) : 0 / 0
Total addresses : 254
//A total of 254 addresses in the address pool
Leased addresses : 1
//1 address has been allocated
Excluded addresses : 0
Pending event : none
1 subnet is currently in the pool
// There is a subnet in the current address pool
Current index IP address range Leased/Excluded/Total
192.168.10.1 192.168.10.1 - 192.168.10.254 1 / 0 / 254
//The next address index to be allocated, address pool range and the number of allocated addresses
DHCPSERVER#show ip dhcp binding
//This command checks the binding status of the IP address
IP address Client-ID/ Lease expiration Type
Hardware address
192.168.10.2 0040.0B3C.7E8D -- Automatic
//The above output shows that the DHCP client got the IP address 192.168.10.2
4. DHCP exclusion address configuration
DHCPSERVER(config)#ip dhcp excluded-address 192.168.10.1 192.168.10.100
//Exclude the first 100 addresses of the DHCP address pool
//The above output shows that after the DHCP server excludes the address, the address obtained by the PC starts from 192.168.10.100
【Experimental Knowledge Points】
- Basic principles and functions of DHCP: Dynamic Host Configuration Protocol (DHCP) is a protocol for automatically assigning IP addresses and other network configuration information. The DHCP server acts as an allocator in the network. It dynamically allocates available IP addresses, subnet masks, default gateways, DNS servers, and other network configuration information by receiving DHCP requests from client devices, thereby simplifying network management and The process of device configuration.
- Networking basics: An IP address is a unique identifier for every device on a network. The subnet mask is used to determine the network portion and the host portion of an IP address. The default gateway is the exit point for communications from other subnets in the network. Understanding these fundamental concepts is critical to understanding how a DHCP server assigns IP addresses and configuration information.
- How to configure the DHCP server: Configuring the DHCP server involves setting the host name, interface parameters and DHCP pool. A hostname is a string that is given to a device to identify and differentiate it. Interface parameters include IP address and subnet mask, which are used to determine the address range of the network where the DHCP server is located. DHCP pool configuration includes specifying the network range, default gateway, DNS server, and domain name of the IP address pool. These configuration information will be used to assign IP address and other configuration information when the DHCP server receives the client's request.
- DHCP lease time: The IP address and other configuration information assigned by the DHCP server to the client have a lease time, that is, the validity period. The lease time defines the time period during which the client can use these configuration information. Before the lease expires, the client can renew the lease or request to update the configuration information. The lease time can be configured according to network requirements.
- Device configuration commands: When configuring network devices, you need to be familiar with the commands of the device operating system, such as Cisco IOS. These commands are used to set the device's hostname, interface IP address, subnet mask, enable interface, etc. By using these commands, you can perform basic configuration and operations on the device.
- Understanding of experimental topology: experimental topology refers to the physical connection and layout between devices in the network. In this experiment, you need to understand the devices and connection methods in the experimental topology diagram, as well as the role and role of each device. This will help you understand where the DHCP server is on the network and how it connects to other devices.
- Basic operations of network devices: When conducting experiments, you need to know how to log in to the command line interface of network devices, and perform operations such as configuring, saving configurations, and verifying configurations. These operations involve logging in to the device through methods such as Telnet, SSH, or serial port, and using the operating system commands of the device for configuration and management.
- By in-depth understanding of these knowledge points, you will be able to fully grasp the concepts and steps required for the DHCP server configuration experiment, and be able to successfully configure and verify the functions of the DHCP server.