UbuntuLinuxDHCP allocates IP addresses through MAC

Source: Internet
Author: User
For the company, if the employee's IP address is obtained automatically, IP conflicts often occur, especially for employees who often use laptops, and the network is often changed, therefore, IP addresses are more prone to conflicts. The solution is to bind an IP address to the company's server (UbuntuLinux) through a MAC, so that the client automatically obtains the IP address and will not change. Dynamichostconfigurationprotocol is a dynamic host Allocation Protocol. It is used to distribute IP addresses to hosts in a network segment. For the company, if an employee's IP address is automatically obtained, IP conflicts often occur, especially for employees who often use laptops, the network is often changed, so IP addresses are more prone to conflicts.

The solution is to bind an IP address to the company's server (Ubuntu Linux) through a MAC, so that the client automatically obtains the IP address and will not change.

Dhcp (dynamic host configuration protocol) is a dynamic host Allocation protocol. It is used to dynamically allocate IP addresses and configure related network environments to hosts in a network segment, for example, we use the dhcp protocol for adsl dialing.




Dhcp settings

1.The dhcp configuration file is/etc/dhcpd. conf, but this file does not exist by default. You need to use its template to create a configuration file. Template location in/usr/share/doc/dhcp-3.0p11/dhcpd. conf. sample

Execute Command
Java code
  1. Sudo vim/etc/dhcpd. conf
 
Note the path in the preceding command. If you rewrite it to your path, find the dhcpd. conf file.

After opening the file,



Description of the Code

Java code
  1. Ddns-update-style interim;
 
# Configure to use the transitional DHCP-DNS interactive update mode.

No Java code in my graph
  1. Ignore client-updates;
 
This line of code indicates # ignore client updates

Java code
  1. Option domain-name"Example.org";
 
# Setting domain names for customers

Java code
  1. Option domain-name-servers192.168.1.1;
 
# Set a Domain Name Server for the customer

Java code
  1. # Option ntp-servers192.168.1.1;
 
Set the NTP server.

Java code
  1. Option time-offset-18000; # Eastern Standard Time
  
# Set the offset time.

Java code
  1. Default-Lease-time21600;
 
# Set the default address lease period.

Java code
  1. Subnet192.168.0.0Netmask255.255.255.0{
  2. Range192.168.0.200192.168.0.240
  3. }

# Set a dynamic address pool.

Java code
  1. Max-lease-time43200;
 

# Set the maximum address lease period for the client

Java code
  1. Default-Lease-time21600;
 

# Set the default address lease period.

Java code
  1. Option subnet-mask255.255.255.0;
 
# Set the client Subnet Mask



In the figure above, the host is set,
The first is to set the names of multiple hosts, and the second is to set the host in the group. In fact, both methods are the same and can be used.
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.