Get the App
SLTechnology News&Howtos  ›  Servers  › 

Operations in different situations of DHCP

Shulou Source: shulou.com Published: 2022-06-02 04:03:14 10月01日 Update

DHCP server: dynamic host configuration protocol, that is, dynamic host configuration protocol.

Function: ensure that the end host automatically obtains the IP address

The original theory: Cramp S, client / server

Devices are: server, router, switch

1. On the DHCP server, configure the DHCP server IP address and the DHCP address pool for the gateway

two。 Configure the DHCP client (automatically get ip)

Demand:

Make sure that the finance department and outpatient department in the hospital belong to different network segments.

The host of each department automatically obtains the IP address

The network segments are:

Finance Department-192.168.1.0 / 24; 192.168.1.254 (Gateway) 8.8.8.8 (DNS-server)

Outpatient Department-192.168.2.0 / 24; 192.168.2.254 (Gateway) 7.7.7.7 (DNS-server)

Ensure that hosts within and between departments can Ping each other

1. On the DHCP server, configure the DHCP address pool for the gateway

two。 Configure the same gateway address on the corresponding port connected to the router as on the DHCP

Router configuration commands:

Router (config) # interface gi0/0 / / Finance Gateway Interface

Router (config-if) # no shutdown

Router (config-if) # ip address 192.168.1.254 255.255.255.0

Router (config-if) # description GW-CaiWu

Router (config) # interface gi0/0 / / outpatient gateway interface

Router (config-if) # no shutdown

Router (config-if) # ip address 192.168.2.254 255.255.255.0

Router (config-if) # description GW-MenZhen

3. Configure the DHCP client (automatically get ip)

DHCP Relay configuration: (only configured in the gateway port of the outpatient building)

Configuring the router as DHCP relay requires configuration on the gateway port of each department-

Router (config) # interface gi0/1

Router (config-if) # description GW-menzhen

Router (config-if) # ip helper-address 192.168.1.250

/ / the gateway port receives the DHCP discover at this time

After the message, the broadcast message will be unicast.

Send to the DHCP server-192.168.1.250

And the source address is 192.168.2.254

The destination address is 192.168.1.250

Router (config) # service dhcp / / as a DHCP relay, DHCP must be enabled

Note:

When there are multiple DHCP address pools on the DHCP server

The server distinguishes the address pool by the source IP address in the DHCP message.

In a DHCP relay environment, it is essentially based on the gateway IP address of each department

To decide.

On the DHCP server, configure the DHCP address pool for two gateways

At the same time, configure the Gateway IP address on the DHCP server:

Ensure that the DHCP server can respond to DHCP messages sent by DHCP clients of other departments / network segments

Tags: Address gateway configuration server service department host customer client message port network segment finance routing router finance department clinic interface different same Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information MySQL OPPO Reno Redmi Docker