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

How to set up Linux-DHCP Server

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

This article introduces you how to set up a Linux-DHCP server, the content is very detailed, interested friends can refer to, hope to be helpful to you.

DHCP server:

Function: provide dynamic ip to every host in the LAN

Mode of communication:

Client: use 255.255.255.255 to broadcast the same DHCP client to send DCHP Discover packets.

DHCP: after receiving the packet data, send back a DHCP offer packet with the IP,MASK,NETWORK, gateway, etc., which DHCP gives to the client, as well as the lease date.

Client: after receiving the message, send a DHCP request packet for confirmation.

DHCP: after receiving the message, reconfirm it.

Install DHCP:

Yum search dhcpd

Yum install dhcpd

View the installed files:

Rpm-ql dhcpd

Edit / etc/dhcp/dhcpd.conf file

7 option domain-name "localhost"; set the domain name of this machine

8 option domain-name-servers 192.168.29.0,192.168.29.100; set DNS server IP

nine

10 default-lease-time 600; default lease time

11 max-lease-time 7200; maximum lease time in seconds

23 log-facility local7

28 subnet 192.168.29.0 netmask 255.255.255.0 {

29}

32 subnet NETWOEK NETMASK Subnet Mask

33 subnet 192.168.29.0 netmask 255.255.255.0 {

34 range 192.168.29.100 192.168.29.150; assign ip range

35 option routers 192.168.29.2; Gateway

38}

"host assigns ip to fixed hosts"

65 host RedHatserver {host "character creation"

66 hardware ethernet 00VOCVERV 29VOV 4BRO BRV 1BRU 6A; "assign MAC of the host"

67 fixed-address 192.168.29.250; ip

68 option routers 192.168.29.3; Gateway

69 option domain-name "you"; domain name

70 option domain-name-servers 114.114.114.1148.8.8; DNS server address

71}

The configuration file takes effect from local to global.

Default-lease-time 600

Max-lease-time 7200; it can also be set for a particular host

Client:

Configuration / etc/sysconfig/network-script/ifcfg-eth0 file

Put BOOTPROTO=dhcp in it

If the virtual machine is configured as a DHCP server, the appeal settings are the same, but:

And make sure

The client needs to set up the figure as above.

The server starts the DHCP service:

Service dhcpd start

Or / etc/rc.d/init.d/dhcpd start

Dynamic ip can be obtained when the client is booted normally.

On how to build a Linux-DHCP server to share here, I hope that the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

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