Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The method of starting dhcp Server by linux

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

How does linux start the dhcp server? This problem may be often seen in our daily study or work. I hope you can gain a lot from this question. The following is the reference content that the editor brings to you, let's take a look at it!

DHCP (Dynamic Host Configuration Protocol, dynamic Host Management Protocol) is a network protocol based on UDP protocol and only used in LAN. Its main purpose is to automatically assign IP addresses to internal equipment or network providers in LAN. It is usually used in large-scale LAN environment or there are many mobile office devices in LAN. DHCP protocol can achieve centralized management and allocation of IP addresses.

DHCP service program can enable hosts in the local area network to automatically and dynamically obtain IP address, subnet mask, gateway address and DNS server address and other information, and can effectively improve address utilization, improve configuration efficiency, and reduce management and maintenance costs.

Installation

# yum install dhcp

Configuration

There are only comment statements by default under / etc/dhcp/dhcpd.conf. You need to refer to the template file below.

# mv / usr/share/doc/dhcp-4.2.5/dhcpd.conf.example / etc/dhcp/dhcpd.conf (here my dhcp version is 4.2.5, which varies from version to version)

Standard DHCP configuration files include global configuration parameters, subnet segment declarations, address configuration options, and address configuration parameters:

Determine the global configuration of the dhcpd service

Global configuration works on the entire DHCP server and is usually placed at the beginning of the configuration file, either as a configuration parameter or as a configuration option. Common global configuration parameters and options are as follows:

Option domain-name, the default search area. Specify the default search domain for the client when resolving the hostname, and this configuration option is reflected in the client's / etc/resolv.conf configuration file.

Option domain-name-servers,DNS server address. Specify the DNS server address for the client to use when resolving the domain name, and this configuration option will also be reflected in the client's / etc/resolv.conf configuration file. When multiple DNS server addresses need to be set, they should be separated by commas.

Default-lease-time, the default lease time. In seconds, the default time at which a client can lease an IP address from a DHCP server.

Max-lease-time, maximum lease time. The unit is seconds, which represents the maximum lease time that the DHCP client is allowed to request. When the client does not request an explicit lease time, the server uses the default lease time.

Ddns-update-style, dynamic DNS update mode. Used to set the dynamic update mode of DNS data associated with the DHCP service. This parameter is rarely used in real DHCP applications, just set the value to "none".

Restart the server dhcpd and the client network, and you can see the client ip address.

Check the / var/lib/dhcpd/dhcpd.leases~ file on the server for information such as lease time:

Generally, the DHCP relay function is rarely used in daily work, or the router is responsible for the relay function, rarely using Linux system to build.

Thank you for reading! After reading the above, do you have a general idea of how linux starts the dhcp server? I hope the content of the article will be helpful to all of you. If you want to know more about the relevant articles, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report