In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces "the configuration method of Linux DHCP server". In the daily operation, I believe that many people have doubts about the configuration method of Linux DHCP server. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful for you to answer the doubts about "configuration method of Linux DHCP server". Next, please follow the editor to study!
1. Install the dhcp package
# rpm-ivh dhcp-3.0.1-12_EL.i386.rpm
two。 Profile dhcpd.conf
Since dhcpd.conf is not included in the package by default, create a
# cp / usr/share/doc/dhcp-3.0.2/dhcpd.conf.sample / etc/dhcpd.conf
3. Edit dhcpd.conf
# vi / etc/dhcpd.conf
Basic format of the configuration file
Subnet 192.168.1.0 netmask 255.255.255.0 {range 192.168.1.100 192.168.1.200}
(in a subnet where the network address is 192.168.1.0 and the subnet mask is 255.255.255.0, the ip address is used for dynamic address assignment by DHCP clients from 192.168.1.100 to 192.168.1.200)
You can include three basic formats of declarations, parameters and options in the dhcpd.conf configuration file
Subnet is a commonly used declaration, and the settings in the declaration (what is in curly braces) are valid throughout the scope of the declaration
Set the network address of the subnet after the Subnet keyword and the subnet mask after the netmask keyword
The parameter consists of a setting item and a setting value. Depending on the location of the parameter, the position of the parameter can act on the global or specified declaration, and the parameter ends with ";", such as:
Default-lease-time 21600; (default release time)
Max-lease-time 43200; (maximum release time)
Options are always guided by the option keyword, followed by specific options and option settings. Options can be applied globally or in a declaration depending on where they are located, and options end with ";", such as:
Option routers 192.168.1.1 (Gateway)
Opyion subnet-mask 255.255.255.0 (subnet mask)
Use the host declaration to set host properties
Host server01 {
Hardware Ethernet 0:c0:c3:22:46:81
Fixed-address 192.168.1.11
Option subnet-mask 255.255.255.0
Option routers 192.168.1.1
}
In the above configuration example, a host named server01 is declared using host, whose MAC address is 0:c0:c3:22:46:81, the ip address assigned to the host is 192.168.1.11, the subnet mask set for the host is 255.255.255.0, and the gateway address is 192.168.1.1.
Files that need to be configured for multiple network interfaces
# vi / etc/sysconfig/dhcpd
DHCPDARGS=eth0
Indicates that dhcp will only provide DHCP services on the eth0 network interface.
Start and stop of 4.dhcpd service
The startup script for the Dhcpd service is located at / etc/init.d/dhcpd
Start the dhcpd service
# service dhcpd start
Stop the dhcpd service
# service dhcpd stop
Modify startup status
# chkconfig-level 35 dhcpd on
At this point, the study on the "configuration method of Linux DHCP server" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.