DHCP Server Configuration management strategy

Source: Internet
Author: User
Tags dns forwarder

The role of the DHCP server:

The DHCP server has no doubt that the IP client loses some or all of its ability to access the network without running a DHCP server. It can be said that the DHCP server is one of the powerful assistants of enterprise network administrator. With the DHCP server, our network governance work becomes more and more effortless. However, although the DHCP server is not a new technology, it is not easy to configure and maintain a DHCP server well. Especially in some of the more complex large and medium-sized networks, the deployment of a DHCP server network can also involve many more complex technologies. There are many failures encountered by DHCP servers, which are plagued by IT managers in a variety of fault phenomena and problems. I believe that whether the new Contact Network rookie fame or fame has long been a technical master, the DHCP server more or less brought them some trouble.


Protocols similar to the DHCP protocol feature:

1>. The role of the ARP protocol: IP address--MAC address

2>. Rarp the role of the Protocol: the MAC address--The IP address, DHCP is actually translates the MAC address into an IP address.

3>. BOOTP the function of this protocol is to respond to a customer single IP address. However, this protocol is not a lease, once an address is assigned to the client side, the address will be permanently used by the client, even if the client does not start, the address will not respond to other clients. The Boot protocol protocol is suitable for diskless workstation construction.

What information the DHCP server can respond to a customer order:

1>ip/netmask

2>gateway

3>dns SERVER

4>. NTP SERVER

5>. WINS SERVER

The procedure for a client to complete a full DHCP request:

1>. CLIENT:DHCP Discover (client broadcast Discovery DHCP server)

2>. SERVER:DHCP offer (DHCP server response)

3>. CLIENT:DHCP request (client requests)

4>. SERVER:DHCP ACK (server sends response message with client)

Attention:

1>. The entire DHCP request process, whether it is the client or the server, sends messages that are broadcast.

2>. How the client obtains an IP address through DHCP: The client broadcasts the request IP address and, if there is a DHCP server in the local area network, responds to the IP address on the client.

3>. When there are multiple DHCP servers in the LAN, the client accepts only one of the DHCP servers and rejects the other.

Specific terms for the DHCP protocol:

Lease time: Lease duration. The client obtains the valid time of the IP address.

DHCP relay:dhcp relay, DHCP relay applies to the extended segment to obtain an IP address.

How the lease is extended during the client request process:

In the past half of the client lease time, the service side is requested to extend the lease, the server responds to the client single-ended, the lease time becomes the original lease time. When the server does not respond to the client, when the client lease remaining half the time, the service side to make a request, request extended lease time, and so on, when the lease time past 93.75%, the client will broadcast to the new DHCP server (DHCP Discover ).

DHCP server port with client-initiated:

Port number for server-initiated: (UDP)

Client-initiated port number: (UDP)


DHCP services implemented on Linux hosts

There are two ways to implement DHCP functionality:

1>. Dhcp

DHCP (Dynamic Host Configuration Protocol) is a Protocol which allows individual devices on the IP network to get their own Network configuration information (IP address, SubnetMask, broadcast address,etc.) from a DHCP server.

2>. Dnsmasq

DNSMASQ is lightweight, easy to configure DNS forwarder and DHCP server. It is designed to provide DNS and, optionally, DHCP, to a small network. It can serve the names of local machines which is not in the Globa DNS.

DNSMASQ's work is characterized by its lightweight.


The DHCP service is simply implemented on the centos7.2 host:

Experimental topology :

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M00/89/D5/wKioL1gfM6-RlDl-AAB4ey5mHqM293.png "title=" Picture 1.png "alt=" Wkiol1gfm6-rldl-aab4ey5mhqm293.png "/>


The steps are as follows :

Build a DHCP server on node1:

1>. [[email protected] ~]# Yum install-y DHCP

2>. configuration files and Unit file

DHCP configuration file :

/etc/dhcp/dhcpd.conf

/etc/dhcp/dhcpd6.conf

DHCP unit file file :

/usr/lib/systemd/system/dhcpd.service

/usr/lib/systemd/system/dhcpd6.service

3>. Modify /etc/dhcp/dhcpd.conf configuration file :

A>. Specify domain Search functionality . Specify DNS Address .

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M01/89/D8/wKiom1gfM_6xEW5hAAAJmJ8JUsU841.png "title=" Picture 2.png "alt=" Wkiom1gfm_6xew5haaajmj8jusu841.png "/>

B>. Specify the minimum default lease duration and maximum lease duration.

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/89/D5/wKioL1gfNCeycc3IAAAGBitzggE162.png "title=" Picture 3.png "alt=" Wkiol1gfnceycc3iaaagbitzgge162.png "/>

C>. Specify IP pool.

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/89/D8/wKiom1gfNE_hoAWLAAAIYntqjGA679.png "title=" Picture 4.png "alt=" Wkiom1gfne_hoawlaaaiyntqjga679.png "/>


4>. Start DHCP Service . 

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M02/89/D8/wKiom1gfNHageyQ4AAAFPNvUNuA632.png "title=" Picture 5.png "alt=" Wkiom1gfnhageyq4aaafpnvunua632.png "/>

5>. Add a default gateway :

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M02/89/D5/wKioL1gfNJSi-pHCAAAI55WeDXw594.png "title=" Picture 6.png "alt=" Wkiol1gfnjsi-phcaaai55wedxw594.png "/>

6>. Restart DHCPD service.


Node2 node test:

1>. Manual Test

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M00/89/D9/wKiom1gfNOjw11ZJAAALpc_z0vQ642.png "title=" Picture 7.png "alt=" Wkiom1gfnojw11zjaaalpc_z0vq642.png "/>

2>. view the generated IP address and gateway information.

IP Address

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M00/89/D9/wKiom1gfN7fDdI8NAAAbKp7W3Sg912.png "title=" Picture 11. PNG "alt=" Wkiom1gfn7fddi8naaabkp7w3sg912.png "/> Gateway address:650) this.width=650;" Src= "Http://s2.51cto.com/wyfs02 /m00/89/d5/wkiol1gfnqnxx8y4aaanpjlujmo784.png "title=" image 8.png "alt=" Wkiol1gfnqnxx8y4aaanpjlujmo784.png "/>


Node1 node

The DHCP server assigns the specified IP address based on the client host Nic MAC address:

To modify a configuration file: using the host option

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M00/89/D5/wKioL1gfNTnAXJqlAAAFV317JSw408.png "title=" Picture 9.png "alt=" Wkiol1gfntnaxjqlaaafv317jsw408.png "/>

Restart dhcpd Services.


Node2 node test:

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M01/89/D9/wKiom1gfNaCjVQLOAAARY44lb2o477.png "title=" Picture 10.png "alt=" Wkiom1gfnacjvqloaaary44lb2o477.png "/>



Summary of issues encountered during the modification of the configuration file:

In the modified configuration file, there must be one in subnet that is the network segment where the IP address resides.

DHCP Server Configuration management strategy

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.