DHCP server practices-Linux Enterprise Application-Linux server application information. For more information, see the following section. Main configuration options 1. Default Gateway 2. IP address 3. subnet mask 4. DNS server address 5. Lease time
Rpm package on 4th disc dhcp-3.0.3-26.i386.rpm
Compilation and installation methods
# Tar zxvf dhcp-latest.tar.gz
# Cd dhcp-3.0.3
#./Configure
# Make
# Make install
# Vi/etc/dhcpd. conf
# Touch/var/state/dhcp/dhcpd. leases rpm installation without touch. The file is installed in/var/lib/dhcpd. leases by default.
# Dhcpd
Main configuration options
1. Default Gateway
2. IP Address
3. Subnet Mask
4. DNS server address
5. Lease time
/Etc/dhcpd. conf:
Ddns-update-style none; Mandatory
Subnet 192,168.0 .0 netmask 255.255.255.0 {specified service scope
Option routers 192.168.0.22
Option subnet-mask limit 255.0
Option domain-name "chinaitlab.com ";
Option domain-name-servers 192.168.0.22;
Range 192.168.0.128 192.168.0.254;
Default-lease-time 21600; 6 hours
Max-lease-time 43200; 12 hours
Host mail {assign a fixed IP address based on the NIC address
Hardware Ethernet 12: 34: 56: 78: AB: cd;
Fixed-address 192.168.0.5;
}
}
The default port of the server is UDP67.
Linux client Configuration
Modify/etc/sysconfig/network-scripts/ifcfg-eth0:
DEVICE = eth0
ONBOOT = yes
BOOTPROTO = dhcp
Or use netconfig to configure the dynamic address, and then run # service network restart
Perform the specified operation one minute later:
# At now + 1 minutes
At> service network restart
Ctrl + D end
Debugging server:
# Tail/var/log/messages view log information
# More/var/lib/dhcpd. leases view IP Address Allocation
Debug the client:
Under unix:
# Dhclient eth0 DHCP Client tool, refresh the network adapter eh0, send a broadcast, and request an IP address again
Under windows:
C: \> ipconfig/renew
Application Cases
Requirements:
Configure a DHCP server to allocate addresses to 100 hosts and use the 192.168.0.0/24 network segment. The static host address is as follows:
Default Gateway: 192.168.0.254
DNS server: 192.168.0.1
Email server: 192.168.0.2
DHCP server: 192.168.0.254
Solution:
Option routers 192.168.0.254;
Option domain-name-server 192.168.0.1;
Range 192.168.0.3 192.168.0.102;
Host ns {
Hardware Ethernet 12: 24: 34: 34: as: de;
Fixed-address 192.168.0.1;
}
Host mail {
Hardware Ethernet 12: 34: 56: 78: AB: cd;
Fixed-address 192.168.0.2;
}
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