Configure the DHCP server and dhcp server

Source: Internet
Author: User

Configure the DHCP server and 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!

 


How to configure a dhcp server

For Windows systems, do the following:
Choose "start"> "Control Panel"> "add or delete program"> "network service" (you can double-click or click Details)> "Dynamic Host Configuration Protocol .. Then wait for the installation. After the installation is complete, you can see DHCP in the management tool !!
For a Linux system, follow these steps:
1. Attach the disc first # mount/dev/cdrom/media

2. then install the DHCP Server Installation Package # rpm-ivh/media/Server/dhcp-3.0.5-3.el5.i386.rpm

3. Copy the configuration sample file of the dhcp server to/etc and change it to dhcpd. conf.
# Cd/usr/share/doc/dhcp-3.0.5/
# Cp dhcpd. conf. sample/etc/dhcpd. conf this step will show whether to overwrite or not, just write y.

4. modify the configuration file of the dhcp server: # vim/etc/dhcpd. conf
In this step, I cannot insert an image. I will explain the following points to modify:
(1) option routers IP Address
Purpose: Specify the default gateway for the client.
(2) option subnet-mask subnet mask
Purpose: set the subnet mask of the client.
(3) option domain-name-servers IP Address
Purpose: Specify the DNS server address for the client.

5. Start the dhcp server: # service dhcpd restart
If possible, perform the following steps:
# Iptables-F clear firewall rules

Now, go to the client to automatically obtain the IP address !!

If you are a fool routing, you can start the DHCP service and there is nothing to do with it.

If you still do not understand, please contact me, I will give you information... QQ--651750543

Please add some points. It took a lot of effort !! Thank you !!

How to configure a dhcp server

For Windows systems, do the following:
Choose "start"> "Control Panel"> "add or delete program"> "network service" (you can double-click or click Details)> "Dynamic Host Configuration Protocol .. Then wait for the installation. After the installation is complete, you can see DHCP in the management tool !!
For a Linux system, follow these steps:
1. Attach the disc first # mount/dev/cdrom/media

2. then install the DHCP Server Installation Package # rpm-ivh/media/Server/dhcp-3.0.5-3.el5.i386.rpm

3. Copy the configuration sample file of the dhcp server to/etc and change it to dhcpd. conf.
# Cd/usr/share/doc/dhcp-3.0.5/
# Cp dhcpd. conf. sample/etc/dhcpd. conf this step will show whether to overwrite or not, just write y.

4. modify the configuration file of the dhcp server: # vim/etc/dhcpd. conf
In this step, I cannot insert an image. I will explain the following points to modify:
(1) option routers IP Address
Purpose: Specify the default gateway for the client.
(2) option subnet-mask subnet mask
Purpose: set the subnet mask of the client.
(3) option domain-name-servers IP Address
Purpose: Specify the DNS server address for the client.

5. Start the dhcp server: # service dhcpd restart
If possible, perform the following steps:
# Iptables-F clear firewall rules

Now, go to the client to automatically obtain the IP address !!

If you are a fool routing, you can start the DHCP service and there is nothing to do with it.

If you still do not understand, please contact me, I will give you information... QQ--651750543

Please add some points. It took a lot of effort !! Thank you !!

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.