RedHatEnterpriseLinux5DHCP service configuration

Source: Internet
Author: User
RedHatEnterpriseLinux5DHCP service configuration 1. check the installation package in the system. by default, the software package required for the DHCP server is not installed: rpm-qa | grepdhcp * // check whether the DHCP server software package is installed in RHEL4. D... red Hat Enterprise Linux 5 DHCP service configuration 1. check the installation package in the system. by default, the software package required for the DHCP server is not installed: rpm-qa | grep dhcp * // check whether the DHCP server software package is installed in the system. In RHEL4, the DHCP software package is in disc4. There are three software packages in total: the DHCP software package for dhcp-3.0.1-12_EL.i386.rpmdhcp-devel-3.0.1-12_EL.i386.rpmdhcpv6-0.10-8.i386.rpm in RHEL5 is in disc3 and also 3 packages. we only need to install the dhcp-3.0.1-12_EL.i386.rpm this package can run the DHCP service properly rpm-ivh dhcp-3.0.1-12_EL.i386.rpm // install the package correctly after installing the package also need to the master configuration file for the DHCP server/ etc/dhcpd. after configuring the conf file, DHCP can work normally. 2. by default, DHCP does not generate dhcpd in/etc after it is installed. conf file, which can be created manually or copied from/usr/share/doc/dhcp. conf. the sample file is under the/etc directory and renamed as dhcpd. conf to obtain the main configuration file of DHCP. for beginners like me, we can use the second method to generate the configuration file, which can reduce the chance of errors during the configuration process. dhcpd. conf. sample is an example file automatically generated by the system when installing the DHCP service package. you only need to modify the file. the configuration file has three basic formats: Declaration, parameters, and options. example: subnet 192.168.1.0 netmast 255.255.255.0 {range 192.168.1.0 192.168.1.255 ;.......} host server {hardware ethernet 0: c0: c3: 22: 46: 31; fixed-address 192.168.1.1 ;.....} all belong to the declaration class. default-lease-time 21600; max-lealse-time 43200; and so on are parameter classes. option routers 192.168.1.1; option domain-name "abc.com"; and so on belong to the option class. The option Class always starts with the keyword option, followed by the option value or specific options. after learning about the approximate format and significance of the main configuration file of the DHCP service, we can modify it, here is an example for reference: (in the following example, we can see that each statement ends with ";". remember) vi/etc/dhcpd. conf // use the vi editor to edit the configuration file ddns-update-style interim [none]; // The statement must be included; otherwise, DHCP cannot be started normally, the meaning of this statement is to specify the dns update method server-identifier 192.168.1.1; // authorize the server to run subnet 192.168.1.0 netmast 255.255.255.0 // declare a network segment, this CIDR block is equivalent to {range 192.168.1.101 192.168.1.200 in windows. // which addresses in this CIDR block are used to allocate option subnet-mask 255.255.255.0 to the client; // The netmask host SERVER assigned to the client // host declaration {hardware ethernet ........ on the host with the host name SERVER ........; (MAC address of the host) fixed-address 192.168.1.101; // This address is always assigned to the host option 192.168.1.1; // The Gateway address assigned to the host, if it is the same as the subnet declaration or global declaration, it can be omitted and not written .}} option routers 192.168.1.1; // gateway address option domain-name "abc.com"; // domain name, which must be consistent with the DNS domain name option domain-name-servers 192.168.1.1; // DNS server address default-lease-time 21600; // default lease time max-lease-time 43200; // maximum lease time 3. after the above modifications are made to start the DHCP service, restart the service process of the DHCP service: service dhcpd restart // restart the service process of the DHCP service. to enable the DHCP service to run automatically at startup, modify its running level: chkconfig -- list dhcpd // check the system level of the DHCP service process running chkconfig -- level 35 dhcpd on // Set the DHCP service process to run automatically at the 3 5 system level in the preceding configuration file, parameters and options other than {} can also be placed in {}. if they are placed in {}, these parameters and options are valid only for the current subnet declaration, if it is placed outside of {}, it indicates that these parameters and options are valid for all subnet statements. the specific location varies according to the actual situation.
 
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.