Configure DHCP server

Source: Internet
Author: User

Configure DHCP server

I. Installation

Yum install dhcpd-y

Ii. Configuration

[Root @ server03/] # rpm-qc dhcp

The dhcp configuration file is displayed.

[Root @ server03/] # vim/etc/dhcp/dhcpd. conf

Change configuration file

Option domain-name "example.com"; # specifies the domain name, indicating the domain of the DHCP server;

Default-lease-time 600;

Max-lease-time 7200; # lease period, 600 7200 is the default time, if not written, the effect is the same

Log-facility local7; # log

Subnet 192.168.4.0 netmask 255.255.255.0 {# specify the network segment

Range 192.168.4.130 192.168.4.132; # address range

}

Save and exit

Restart the hdcp service and set another virtual machine as a bridge to restart the network. You can obtain the IP address 192.168.4.131 allocated by dhcp.

On the dhcp server,

Run tail-f/var/log/messages to view dynamic log files and dhcp request messages.

Open the configuration file:

[Root @ server03/] # vim/etc/dhcp/dhcpd. conf

Add

Option routers 192.168.4.254; # Gateway

Option domain-name-servers 192.168.4.103; # dns Server

Restart the dhcpd client and restart the network to obtain the address of the gateway and dns server.

[Root @ localhost Desktop] # vim/etc/resolv. conf

You can see:

# Generated by NetworkManager

Domain example.com

Search example.com

Nameserver 192.168.4.103

Address binding:

Open the configuration file:

[Root @ server03/] # vim/etc/dhcp/dhcpd. conf

Add:

Host fantasia {

Hardware ethernet 00: 0C: 29: 60: 31: B7

Fixed-address 192.168.4.133 # The address should be out of the address pool above to prevent conflict

}

Restart the DHCP Client and restart the network. Check the ip address. The ip address is changed to the binding address just set.

OK!

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.