DHCP Summary 2020 (NA)

This article is just a private note, it is only reserved as a learning resource, and cannot be reprinted without permission!

DHCP overview

DHCP (Dynamic Host Configuration Protocol) is a technology for centralized dynamic management and configuration of users.

With the continuous expansion of network scale and increase in network complexity, the number of computers often exceeds the number of IP addresses available for allocation. At the same time, with the widespread use of portable computers and wireless networks, the location of the computer often changes, and the corresponding IP address must also be updated frequently, resulting in more and more complicated network configurations. The Dynamic Host Configuration Protocol (DHCP) was developed to solve these problems.

DHCP adopts a client/server communication mode. The client makes a configuration application to the server, and the server returns the corresponding configuration information such as the IP address to the client to realize the dynamic configuration of the IP address and other information.

The early DHCP protocol is only applicable to the situation where the DHCP client and server are in the same subnet, and cannot work across network segments. In this way, it is necessary to configure a DHCP server for each subnet, which wastes resources. The introduction of DHCP relay solves this problem

 

DHCP is divided into global configuration and interface-based configuration

Global configuration:

To achieve global configuration and DHCP services for different network segments, you must use DHCP relay services

Steps

1. Execute the command system-view to enter the system view.

2. Execute the dhcp enable command to enable the DHCP service.

3. Execute the command interface interface—type interface—number to enter the interface view.

The AR2200-S supports working in the global address pool mode including Layer 3 GE interface and its sub-interfaces, Layer 3 Ethernet interface and its sub-interfaces, Layer 3 Eth-trunk interface and its sub-interfaces and VLANIF interface.

4. Execute the command ip address ip address {mask | mask—length} to configure the IP address of the interface.

After the IP address of the interface is configured, when users under this interface apply for an IP address.

If the DHCP client and the AR2200-s acting as the DHCP server are in the same network segment and there is no relay device in between, the AR2200-S will select an address pool on the same network segment as the IP address of this interface to assign IP addresses. If the interface is not configured with an IP address or there is no address pool on the same network segment as the interface address, the user cannot go online.

If the DHCP client and the AR2200-s acting as the DHCP server are in different network segments and there is a relay device in between, the AR2200-s needs to resolve the IP address specified by the giaddr field in the received DHCP request message. If the IP address does not match To the corresponding address pool, the user fails to go online.

5. Execute the command dhcp select global to configure the interface to work in the global address pool mode. Users who go online from this interface can access the global address pool.

Obtain configuration information such as IP address in.

Configure the relevant attributes of the global address pool

Configure the relevant attributes of the global address pool, including the address range, address lease period, IP addresses that do not participate in automatic allocation, and statically bound IP addresses. According to the actual needs of the client, you can choose to use dynamic address allocation or static address binding.

Steps

1. Execute the command system-view to enter the system view.

2. Execute the command ip pool ip—pool—name to enter the global address pool view

By default, no global address pool is created on the AR2200-S.

3. Execute the command network ip-address [mask (mask mask-length}] to configure the range of IP addresses that can be dynamically allocated in the global address pool.

When configuring the network segment of the address pool, only one address segment can be configured in the same address pool, and the size of the address range is set through the mask.

0 Description:

When configuring the dynamically assignable IP address range of the global address pool, please try to ensure that the address range is consistent with the network segment of the DHCP server interface or DHCP relay interface address to avoid assigning wrong IP addresses. 1. (Optional) Run the lease {day day [hour hour [minute minute]] | unlimited} command to configure the IP address lease period

By default, the lease period of an IP address is 1 day.

For different address pools, the DHCP server can specify different address lease periods, but the addresses in the same address pool all have the same period.

5. (Optional) Execute the command excluded-ip-address start-ip-address [end-ip-address] to configure the IP addresses in the address pool that do not participate in automatic allocation.

Some addresses are allocated to other services, such as being allocated to a DNS server, they cannot be allocated to clients. You can execute the excluded-ip-address command to configure the IP addresses in the address pool that do not participate in automatic allocation. If you execute this command multiple times, you can configure multiple IP addresses that do not participate in automatic allocation.

6. Execute the command gateway—list ip—address & (1-8) to configure the egress gateway address of the DHCP client.

Note: When a
DHCP client accesses a server or host outside the network segment, the data must be sent and received through the egress gateway.
In order to load balance traffic and improve network reliability, multiple egress gateways can be configured, and each address pool can be configured with up to 8 gateway addresses. The gateway address cannot be a subnet broadcast address.
7. (Optional) Execute the command static-bind ip-address mac-address to switch anaWress to bind the IP address and MAC address in the global address pool by using static address binding
.
When a user needs a fixed IP address, you can bind an IP address that is not in use in the address pool with the user's MAC address.
U Note: When
using static address binding to bind an IP address in the global address pool with a MAC address, the IP address must be within the range of IP addresses that can be dynamically allocated in the global address pool.
8. (Optional) Execute the recycle] command to configure the addresses that cannot be released in the recycle address pool.

 

Interface-based configuration:

Configure the relevant attributes of the interface address pool

Configure the relevant attributes of the interface address pool, including the address lease, the I address that does not participate in automatic allocation, and the statically bound I address. According to the actual needs of the client, you can choose to use dynamic address allocation or static address binding.
Steps


1. Execute the command system-view to enter the system view.
2. Execute the command dhcp enable to enable the DHCP service
. 3. Execute the command interface interface- type interface-number to enter the interface view. The
AR2200-S supports working in the interface address pool mode. There are three-layer GE interfaces and their sub-interfaces, and three-layer Ethernet. Interface and its sub-interfaces, Layer 3 Eth-trunk interface and its sub-interfaces and VLANIF interface.
4. Execute the command ip address ip= address{ mask mask- length} to configure the IP address of the interface.
5. Execute the command dhcp select interface to configure the AR2200-S to adopt the DHCP server mode of the
interface address pool. The IP address range that can be dynamically allocated by the interface address pool is the network segment where the IP address of the interface is located, and it is only valid under this interface.
6. (Optional) Run the command dhcp server lease{ day day[ hour hour[ minute minute]] unlimited} to configure the IP address lease period.
By default, the lease of the IP address is 1 day.
7. (Optional) Run the command dhcp server excluded-ip- address start-ip- address[ end-i- address], Configure the IP addresses in the address pool that do not participate in automatic allocation.
Some addresses are allocated to other services, such as being allocated to a DS server, they cannot be allocated to clients. You can execute this command to configure the IP addresses in the address pool that do not participate in automatic allocation. If you execute this command multiple times, you can configure multiple
IP addresses that do not participate in automatic allocation.
8.(Optional) Execute the command hcp server static- bind ip- address ip- address mac- address mac- address , use static address binding to bind the IP address and MAC address in the interface address pool
as a user needs to be fixed When using an IP address, you can bind an IP address that is not in use in the address pool to the user's MAC address.
Note When
using static address binding to bind the I address in the interface address pool to the MAC address, the I address must be on the interface. The address pool is within the range of I addresses that can be dynamically allocated.

DHCP relay:

Configure the specified interface to work in the DHCP relay mode.
When the client and the DHCP server are not in the same network segment, the DHCP relay is used to forward the client's request to the DHCP server.
Background information
Description
DHCP message relay between the DHCP server and the DHCP client The number of times cannot exceed 16, otherwise the DHCP message will be discarded.
After the DHCP relay function is enabled under a Super-VIlan, the DHCP Snooping function cannot be enabled under the Super-Vlan.
Operation steps
1. Execute the command system-vie to enter the system view.
2. Execute the command dhcp enable to enable the DHCP function
. 3. Execute the command interface interface- type interface- umber to enter the interface view. The
AR2200-S supports interfaces that work in DCP relay mode, including Layer 3 GE interfaces and their sub-interfaces, and Layer 3 Ethernet Interface and its sub-interfaces, Layer 3 Eth-trunk interface and its sub-interfaces and VLANIF interface.
4. Execute the command

ipadress ip-address mask mask-length}, configure the IP address of the interface.
Note When
configuring the egress gateway of the IP address pool on the server, the IP address of the egress gateway and the IP address of the DHCP relay must be exactly the same.
5. Execute the command dhcp select relay to start the DHCP relay function of the interface

Subsequent processing: When the
AR2200-S is applied as a DHCP relay, the DHCP request message sent by the client can be forwarded to the DHCP server through the DHCP relay. After enabling the relay function of the interface, you also need to configure the IP address of the DHCP server under the interface. AR2200-S supports
the following two methods to configure the IP address of the DHCP server.
Configure the destination server group for DHCP relay forwarding and configure the P relay interface to bind the DHP server group. Run the
command dhcp relay server.-ipi- address directly in the interface view. , Configure the DHCP server address that the DHCP relay agent acts.

Configure the destination server group for DHCP relay and forwarding
Configure the DHCP server group and add server address information to the server group.
Operation steps
Execute the command system-view to enter the system view.
2. Execute the command dhcp server group group-name to create a DHCP server group and enter the DHCP server group view.
Up to 64 DHCP server groups can be configured globally.
Execute the command dhcp-server ip-address[ip-address-index] to add a DHCP server to the DHCP server group.
A maximum of 8 DHCP servers can be configured under each DHCP server group. When no index is specified, the system will automatically allocate a free index

Configure the DHCP relay interface to be bound to the DHCP server group
After the relay function of the interface is enabled, the DHCP server group can be bound to the interface to specify the accessible DHCP server for the DHCP client.
Operation steps
Execute the command system-vie to enter the system view
2. Execute the command interface interface-type interface-number to enter the interface view.
AR2200-S supports working in DHCP relay mode with three-layer GE interface and its sub-interfaces, three-layer Ethernet interface and its sub-interfaces, three-layer Eth-trunk interface and its sub-interfaces and VI LANIE interface.
3. Execute the command dhcp relay server- select group-name to specify the DHCP server group corresponding to the interface.

From: HDX

Guess you like

Origin blog.csdn.net/qq_43575090/article/details/108953363