Use DHCP to configure the DHCP server in RHEL5.4

Source: Internet
Author: User
To configure the DHCP server using DHCP in RHEL5.4, follow these steps: 1. install DHCP Server software check whether dhcprpm-qdhcpmount/dev/cdrom/mediarpm-ivh/media/Server/dhcp-3.0.5-21.el5.i386.rpm2, modify the DHCP master configuration file is: /etc/dhcpd. to configure the DHCP server using DHCP in RHEL5.4, follow these steps:

1. install DHCP server software
Check whether dhcp is installed
Rpm-q dhcp

Mount/dev/cdrom/media

Rpm-ivh/media/Server/dhcp-3.0.5-21.el5.i386.rpm

2. modify the DHCP master configuration file
The main configuration file is/etc/dhcpd. conf.



Configuration parameters can be generated through the DHCP template configuration file
Cat/usr/share/doc/dhcp-3.0.5/dhcpd. conf. sample>/etc/dhcpd. conf

3. modify the configuration file dhcpd. conf.
Ddns-update-style interim;
Ignore client-updates;

Subnet 192.168.100.0 netmask 255.255.255.0 {
Option routers 192.168.100.1;
Option subnet-mask limit 255.0;

Range dynamic-bootp 192.168.100.100 192.168.100.200;
Default-lease-time 21600;
Max-lease-time 43200;
}

4. start the DHCPd service
Service dhcpd start

Check whether the service port is on: netstat-anpu | grep dhcpd

5. configure the DHCP client
-- Windows client configuration
-- Linux client configuration, you can use the dhclient command

6. view the lease file on the DHCP server
Cat/var/lib/dhcpd. leases

############################ Split line, basic DHCP configuration complete #########################
7. configure the DHCP server to retain the host
Modify the main configuration file:
Ddns-update-style interim;
Ignore client-updates;

Subnet 192.168.100.0 netmask 255.255.255.0 {
Option routers 192.168.100.1;
Option subnet-mask limit 255.0;

Range dynamic-bootp 192.168.100.100 192.168.100.200;
Default-lease-time 21600;
Max-lease-time 43200;

Host linux01 {
Hardware ethernet 00: 0c: 29: fc: 68: 14;
Fixed-address 192.168.100.188;
}
}
The host declaration is used here for configuration!

8. release the IP address on the client and obtain it again.
-- Windows client configuration
Ipconfig/release
Ipconfig/renew
-- Linux client configuration
Ifdown eth0
Ifup eth0

############################ Split line, DHCP retained host configuration complete #########################
9. configure multiple DHCP scopes
Ddns-update-style interim;
Ignore client-updates;

Subnet 192.168.100.0 netmask 255.255.255.0 {
Option routers 192.168.100.1;
Option subnet-mask limit 255.0;

Default-lease-time 21600;
Max-lease-time 43200;

Host linux01 {
Hardware ethernet 00: 0c: 29: fc: 68: 14;
Fixed-address 192.168.100.188;
}
}

Subnet 172.16.1.0 netmask 255.255.255.0 {
Option routers 172.16.1.2;
Range dynamic-bootp 172.16.1.100 172.16.1.200;

Default-lease-time 21600;
Max-lease-time 43200;
}
If there are other scopes, use the subnet declaration to create them! The method is similar!

10. DHCP relay proxy configuration is required for implementation and testing of multiple DHCP scopes

(Network environment required to complete the DHCP relay proxy experiment)
11. assume that the IP address of the DHCP relay proxy server is 172.16.1.2.

12. enable route forwarding
There are two ways to enable the linux kernel route forwarding function
# Method 1:
Vi/etc/sysctl. conf
Net. ipv4.ip _ forward = 1
Run the sysctl-p command.
# Method 2:
Echo 1>/proc/sys/net/ipv4/ip_forward
(Either of the two methods can be implemented)

13. install the dhcp software package on the relay proxy server because the software program for configuring the DHCP relay proxy is in this package.
(Install DHCP software package omitted)

14. DHCP relay related programs and configuration files
/Etc/rc. d/init. d/dhcrelay DHCP relay start script
/Etc/sysconfig/dhcrelay DHCP relay configuration file
/Usr/sbin/dhcrelay DHCP Relay application

15. configure DHCP Relay (two methods are available)
# Method 1:
Vi/etc/sysconfig/dhcrelay
INTERFACES = "eth0 eth1"
DHCPSERVERS = "192.168.100.1"
# Method 2:
Dhcrelay-I eth0 192.168.100.1

16. start the dhcrelay relay service
Service dhcrelay start
Set dhcrelay to automatically start the relay service at runtime level 35
Chkconfig -- level 35 dhcrelay on

17. test the function of obtaining an IP address on the client!
 
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.