CentOS Installation and configuration DHCP service

Source: Internet
Author: User

CentOS installation process and configuration method

First, the installation process

There are two methods: one is to use the own RPM installation package, and the other is to install it online using the Yum command.

1. Inspection and installation

to see if DHCP is installed on the server

RPM-QA |grep DHCP

Mount the disc image (Mount process slightly) into the disc directory

RPM-IVH Dhcp.x86_64.12.4.2.5-36.el7.centos

RPM-IVH Dhcp.x86-devel_64.12.4.2.5-36.el7.centos

Using RPM-QL DHCP

Detects all files installed by the installation package locate the configuration file to configure

2. Configuration

Copy the sample file into the DHCP configuration file

Cp/usr/share/doc/dhcp-*/dhcpd.conf.sample/etc/dhcp/dhcpd.conf

Configure the configuration file

Vim/etc/dhcp/dhcpd.conf

Configure the address pool, lease time, and maximum lease time, DNS, subnet mask, default gateway, domain name, etc. in the appropriate location

Ddns-update-style Interim

Ignore client-updates;

Subnet 192.168.1.0 netmask 255.255..255.0 {

Option routers 192.168.20.2;

Option Subnet-mask 255.255.255.0;

Option Domain-name "guedu.com";

Option Domain-name-servers 192.168.20.131;

Option time-offset-18000;

Range DYNAMIC-BOOTP 192.168.20.200 192.168.20.240;

Default-lease-time 21600;

Max-lease-time 43200;

       host pc1 {      #为某一台主机单独配置静态IP                hardware ethernet 00:12:34:56:78:90;                fixed-address 192.168.188.111;

}

}

3. Configure the network card

Vim/etc/sysconfig/network-scripts/ifcfg-eth0


Hwaddr=00:0c:29:88:9c:d7

Type=ethernet

Bootproto=static

Defroute=yes

Peerdns=yes

Peerroutes=yes

Ipv4_failure_fatal=no

Ipv6init=yes

Ipv6_autoconf=yes

Ipv6_defroute=yes

Ipv6_peerdns=yes

Ipv6_peerroutes=yes

Ipv6_failure_fatal=no

Name= "Eth0"

uuid=a5f6bbea-d088-4b25-a2db-246821fa587a

Onboot=yes

ipaddr=192.168.20.128

netmask=255.255.255.0

The client will BOOTPROTO=DHCP server-side bootproto=static

Service Network restart

Summarize

DHCP provides a secure, reliable, and simple TCP/IP network configuration that ensures that no address conflicts occur and that IP addresses are reserved centrally through address assignment. DHCP provides dynamic assignment of the IP address of the computer, and the system administrator controls the assignment of the IP address by qualifying the lease time, which limits the time that a computer can use an IP address that has been assigned to it

CentOS Installation and configuration DHCP service

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.