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
- 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
- Ddns-update-style interim;
# Configure to use the transitional DHCP-DNS interactive update mode.
No Java code in my graph
- Ignore client-updates;
This line of code indicates # ignore client updates
Java code
- Option domain-name"Example.org";
# Setting domain names for customers
Java code
- Option domain-name-servers192.168.1.1;
# Set a Domain Name Server for the customer
Java code
- # Option ntp-servers192.168.1.1;
Set the NTP server.
Java code
- Option time-offset-18000; # Eastern Standard Time
# Set the offset time.
Java code
- Default-Lease-time21600;
# Set the default address lease period.
Java code
- Subnet192.168.0.0Netmask255.255.255.0{
- Range192.168.0.200192.168.0.240
- }
# Set a dynamic address pool.
Java code
- Max-lease-time43200;
# Set the maximum address lease period for the client
Java code
- Default-Lease-time21600;
# Set the default address lease period.
Java code
- 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.