Step 1: Turn the server and client into the same Network Segment II: mount the disc: mount-tiso9660/dev/cdrom/media/cdrom set the Server IP address to 192.168.1.1 III: Install the DHCP service: cd/media/cdrom/RedHat/RPMSrpm-ivhdhcp-3.0 -....... (Press the table key) cp/usr/share/doc/dhcp-3.0.1/dhcpd. conf. sam
Step 1: Change the server and client to the same network segment
Ii. Attach a CD: mount-t iso9660/dev/cdrom/media/cdrom
Set the Server IP address to 192.168.1.1
Iii. Install the DHCP service:
Cd/media/cdrom/RedHat/RPMS
Rpm-ivh dhcp-3.0-... (press table key)
Cp/usr/share/doc/dhcp-3.0.1/dhcpd. conf. sample/etc/dhcpd. conf
4. Configure the DHCP service
Vi/etc/dhcpd. conf
The modification content is as follows:
Ddns-update-style interim;
Ignore client-updates;
Subnet 192.168.1.0 netmask 255.255.255.0 {
Option routers 192.168.1.1;
Option subnet-mask limit 255.0;
Option domain-name "test.com ";
Option domain-name-servers 192.168.1.1, 172.16.1.1;
Option time-offset-18000;
Range dynamic-bootp 192.168.1.10 192.168.1.254;
Default-lease-time 21600;
Max-lease-time 43200;
Host ns {
Hardware ethernet 12: 34: 56: 78: AB: CD;
Fixed-address 192.168.1.2;
}
}
The IP addresses of the above 192.168.1.0 CIDR block must be changed to their own environment, and the host ns should be set separately.
5. Start the service
Service dhcpd start
You can also view the dhcp service lease file: more/var/lib/dhcp/dhcpd. leases
View the log file tail/var/log/messages
6. Use the client for verification and set it to automatically obtain the ip address.
The client can be XP, ipconfig, or release.
Ipconfig/renew
It can also be linux: dhclient