[Osaka/Yokohama/Tokushima] Looking for infrastructure/server side engineers!

[Osaka/Yokohama/Tokushima] Looking for infrastructure/server side engineers!

[Deployed by over 500 companies] AWS construction, operation, maintenance, and monitoring services

[Deployed by over 500 companies] AWS construction, operation, maintenance, and monitoring services

[Successor to CentOS] AlmaLinux OS server construction/migration service

[Successor to CentOS] AlmaLinux OS server construction/migration service

[For WordPress only] Cloud server “Web Speed”

[For WordPress only] Cloud server “Web Speed”

[Cheap] Website security automatic diagnosis “Quick Scanner”

[Cheap] Website security automatic diagnosis “Quick Scanner”

[Reservation system development] EDISONE customization development service

[Reservation system development] EDISONE customization development service

[Registration of 100 URLs is 0 yen] Website monitoring service “Appmill”

[Registration of 100 URLs is 0 yen] Website monitoring service “Appmill”

[Compatible with over 200 countries] Global eSIM “Beyond SIM”

[Compatible with over 200 countries] Global eSIM “Beyond SIM”

[If you are traveling, business trip, or stationed in China] Chinese SIM service “Choco SIM”

[If you are traveling, business trip, or stationed in China] Chinese SIM service “Choco SIM”

[Global exclusive service] Beyond's MSP in North America and China

[Global exclusive service] Beyond's MSP in North America and China

[YouTube] Beyond official channel “Biyomaru Channel”

[YouTube] Beyond official channel “Biyomaru Channel”

Getting started with DHCP for the first time

My name is Ito and I am an infrastructure engineer.

Do you know what DHCP is?
In fact, it exists nearby.

Can I connect to the internet at home or at work?

If you think it can be done, there is a high possibility that you are already using DHCP.

In this article, I would like to shed some light on DHCP, which is active in the shadows.

What is DHCP?

DHCP stands for Dynamic Host Configuration Protocol, which roughly describes a protocol that assigns configuration information to clients within the network so that they can communicate .

When you connect a LAN cable to your PC, the pooled IP address is passed from the DHCP server, and the gateway and DNS server information is also passed and set up.

So, the PC can simply be plugged in and booted up, and there is no need to set up the network.

At this time, there is a DHCP server within the LAN, and the PC that is assigned an IP address from that server is called DHCP client

You can also use the internet on your PC at home without having to set up a network. That's what "DHCP" is. At home, routers usually act as DHCP.

The following are the settings that can be configured on the DHCP server.

  • IP address
  • subnet mask
  • default gateway
  • DNS server

In addition, there are other DHCP settings as follows.

  1. Lease period for various addresses
  2. Setting the scope (subnet range)
  3. Setting a reservation to assign a fixed IP to a specific PC

A brief explanation of each of the three settings is as follows.

Lease period The period during which the assigned IP address can be used, and when the lease period ends, the DHCP client will obtain an IP address again.
scope 1 scope = 1 subnet. For example, "192.168.1.2 to 192.168.1.129" and "192.168.1.130 to 192.168.1.253" are scopes.
reservation A function that continues to assign the same IP address to DHCP clients with specific functions (e.g. servers)

This is the setting, but how is DHCP assigned an IP address?

More specific movements of DHCP

To use DHCP, the DHCP client must be in a state that can receive IP addresses.
DHCP is a "protocol that dynamically configures hosts," meaning that DHCP client C must set the "network settings to be dynamically configured."

dhcp
This is the situation on Windows. By default, Windows is set to receive DHCP, so you don't need to worry about it too much.

For Windows 10, you can check below.
Check the properties of the target network from [Control Panel] - [Network and Sharing Center] - [Change adapter settings]

If you need to statically allocate an IP address, please do so manually as described above.

When a DHCP client receives an IP address

I will briefly outline the process by which a DHCP client receives an IP address.

  1. Broadcast a request to "I want an IP address" when starting the client (DHCPDISCOVER)
  2. The DHCP server broadcasts the setting “Please accept this IP address” (DHCPOFFER)
  3. The client broadcasts a request saying "Then use this IP address" (DHCPREQUEST)
  4. DHCP server returns OK/NG (DHCPACK/DHCPNAK)

What do you think? The key is to communicate several times over the broadcast. After all, the IP address has not been determined.

It is also expected that there will be multiple DHCP servers.

When the IP address lease period is about to end

When an IP address is assigned, the given IP address and the MAC address of the DHCP client are linked to the lease period of the target IP address. Therefore, even if the DHCP client and the server do not communicate, the target IP address will remain in place.

However, if communication is not being communicated after the lease period has passed, the target IP address will return to the DHCP server.
Also, when connected to the network, the above-mentioned reception will be performed.

Now, I will write a little more detailed information about leases.

  1. When the lease period is halved, send a request to extend the use of the same IP address to the server (do the same thing as when receiving an IP address)
  2. If you send an extension request to the DHCP server and there is no response (DHCPACK), it will fail.
  3. Periodically sends an extension request to the DHCP server
  4. If the lease expires without a response, the IP address will be leased.

What do you think? The clever thing about DHCP is that it basically tries to use the same IP address.
By doing this, you will not have to think about setting the IP address again.
This means that the load on the DHCP server will not increase.

This is how DHCP works.
So why is there a protocol called DHCP?
It would be nice if everything was allocated statically. . . Isn't that what you think?

What are the benefits of DHCP?

If you don't use DHCP, you have to configure "IP address/gateway/DNS server" for all devices...
just thinking about it gives me chills.

Administrators in internal systems departments, etc. will benefit greatly from this.
This is because if you assign statically, you have to manage which device has which IP address. .

The big advantage is that centralized management is possible with just a DHCP server.

On the other hand, the disadvantage is that if the DHCP server goes down and cannot be recovered,
all DHCP clients may be unable to communicate.
It's a big deal, but since it's a rare accident, it might not be something to worry about.

summary

What did you think?
You may not be used to hearing about DHCP, but your home PC probably uses DHCP.
We also use DHCP to assign IP addresses to each client.

DHCP is convenient, but if you don't decide on the configuration at the construction stage, you may end up in trouble.
If the IP is not returned even after the lease period has passed,
it is possible that there will be a shortage of IPs and users will get angry.

Please plan your use accordingly.

If you want to consult a cloud professional

At Beyond, we use the technical capabilities we have cultivated as a multi-cloud integrator and managed service provider (MSP) since our founding to design, build, and migrate using various cloud/server platforms such as AWS, GCP, Azure, and Oracle Cloud. I went there.

We provide custom-made cloud/server environments that are optimized for customers according to the specifications and functions of the systems and applications they require, so if you are interested in the cloud, please feel free to contact us. .

● Cloud/server design/construction
● Cloud/server migration/migration
● Cloud/server operation, maintenance, and monitoring (24 hours a day, 365 days a year)

If you found this article helpful , please give it a like!
0
Loading...
0 votes, average: 0.00 / 10
1,745
X facebook Hatena Bookmark pocket
[Webinar] Introduction to Multi-Cloud: Which cloud is best for your business? Get the latest information on the 8 major clouds!

[Webinar] Introduction to Multi-Cloud: Which cloud is best for your business? Get the latest information on the 8 major clouds!

[Webinar] From the operational structure to specific steps! A complete overview of cloud server operation and maintenance

[Webinar] From the operational structure to specific steps! A complete overview of cloud server operation and maintenance

The person who wrote this article

About the author