DHCP server configuration under Linux

Source: Internet
Author: User

1. Install the DHCP service component:

#rpm-IVH dhcp-4.1.1-38.p1.el6.centos.x86_64.rpm or yum install DHCP

Options and Parameters:

The meaning of-i:install

-V: View more detailed installation Information screen

-H: Displays the installation progress in the installation information column

2. The full file name (list) of all files and directories of the software is listed:

#rpm-ql DHCP

Options and Parameters:

-Q:QUERY 
 
-l:list
  (Rpm-qa | grep DHCP can also view the DHCP components that are installed)

3.cp/usr/share/doc/dhcp-4.1.1/dhcpd.conf.sample/etc/dhcp/dhcpd.conf

Copy the sample document

4.vim/etc/dhcp/dhcpd.conf

Edit a configuration document

Subnet 192.168.1.0 netmask 255.255.255.0{
Range 192.168.1.200 192.168.1.220;
Option Domain-name-servers ns1.internal.example.org;
Option Domain-name "internal.example.org";
Option routers 192.168.1.1;
Option broadcast-address 192.168.1.255;
Default-lease-time 600;
Max-lease-time 7200;
}



Set a specific IP for a specific client, if you want to set ip,copy code for multiple clients, modify the hostname, and address and the specific IP you want to assign to him

Host Ice {
Hardware Ethernet 00:E0:40:02:EA:2A;
Fixed-address 192.168.1.88;
}

5. Start DHCP

/ETC/INIT.D/DHCPD restart

Service DHCPD Restart
(Boot failure, need to configure the network card IP address, need to be the same subnet 192.168.1.0 netmask 255.255.255.0. directive: ifconfig eth0 192.168.1.0 netmask 255.255.255.0; can also be configured via the image interface. directive: System-config-network opens after DHCP is set to Manual, set itself, then restart Network, service network restart)
Startup failure description problem with configuration document

6. Whether the test is successful

7: Test: First you have to have two computers, (no two computers to find sister borrowed) two computers through a network connection, the computer's virtual machine connection is set to bridge, as the client computer IP set to automatically get. Then the good character should be able to see the client computer obtains the IP, and the IP is within the IP range you set.

Of course, if the character is not good, sister does not borrow computer also has the method, we install a Windows virtual machine, and then set up the network connection also to bridge, unplug your cable, now your Linux virtual machine do server, Windows virtual machine do client, Set the Windows virtual machine acquisition IP mode to get automatically. Then, under the DOS interface, use ipconfig to view the IP addresses acquired by the Windows virtual machine. You can see that your Windows virtual machine has acquired an IP. and the IP address range is within the range of IP addresses you set.


DHCP server configuration under Linux

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.