The entire process of configuring the DHCP server in CentOS5.4

Source: Internet
Author: User
First, check whether the DHCP service is installed: [root @ DHCPserver] # rpm-qdhcppackagedhcpisnotinstalled puts the disc into the optical drive and mounts it through the mount command. [Root @ DHCPserver] # mountdevcdrommntmount: blockdevicedevcdromiswrite-protected, mountingread-on first check whether the DHCP service is installed:
[Root @ DHCPserver/] # Rpm-q dhCp
Package dhcp is not install Ed
Put the CD in the optical drive and mount it CommandAttach.
[Root @ DHCPserver/] # Mount/dev/CdRom/mnt
Mount: block device/dev/cdrom is Write-Protected, mounting read-only
[Root @ DHCPserver/] # Cd/mnt/CentOS/
[Root @ DHCPserver CentOS] # Ls| GrepDhcp // view the keyword "dhcp" File
Dhcp-3.0.5-21.el5.i386.rpm
Dhcp-devel-3.0.5-21.el5.i386.rpm
Dhcpv6-1.0.10-17.el5.i386.rpm
Dhcpv6-client-1.0.10-17.el5.i386.rpm
Libdhcp-1.20-10.el5.i386.rpm
Libdhcp4client-3.0.5-21.el5.i386.rpm
Libdhcp4client-devel-3.0.5-21.el5.i386.rpm
Libdhcp6client-1.0.10-17.el5.i386.rpm
Libdhcp6client-devel-1.0.10-17.el5.i386.rpm
Libdhcp-devel-1.20-10.el5.i386.rpm
Sblim- CmpI-dhcp-0.5.5-35.el5.i386.rpm
Sblim-cmpi-dhcp-devel-1-35.el5.i386.rpm
Sblim-cmpi-dhcp-test-1-35.el5.i386.rpm
------------------ Annotation ----------------------
Dhcp-* DHCP server software package
Dhclient-* DHCP Client Software Package
Dhcp-devel-* DHCP development tool, not required
--------------------------------------------
There is a DHCP installation package in this directory. Run the rpm command to install it. [Root @ DHCPserver CentOS] # Rpm-ivh dhcp-3.0.5-21.el5.i386.rpm
Warning: dhcp-3.0.5-21.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID e8562897
Preparing... ######################################## ### [100%]
1: dhcp ####################################### #### [100%] After installation, check whether the tool is installed on the machine. [Root @ DHCPserver CentOS] # Rpm-q dhcp
The dhcp-3.0.5-21.el5 has a template under the installation directory ( /Usr/share/doc/dhcp-3.0.5/dhcpd. conf. sample), Overwrite the data by using the CP command.
[Root @ DHCPserver CentOS] # Cp/usr/share/doc/dhcp-3.0.5/dhcpd. conf. sample/etc/dhcpd. conf
Cp: overwrite "/etc/dhcpd. conf "? YUse vi to enter the dhcpd. conf configuration file for configuration.
[Root @ DHCPserver CentOS] # vi/etc/dhcpd. conf
 
 
 
  1. DdNs-upDate-Style interim; # configure to use the transitional DHCP-DNS interactive update mode.
  2. Ignore client-updates; # ignore client updates
  3.  
  4.  
  5. SuBnet 192.168.1.0 netmask 255.255.255.0 {
  6.  
  7. Option routers 192.168.1.1; # vro address
  8. Option subnet-mask limit 255.0; # subnet mask option
  9.  
  10. Option nis-domain \ "xfbaydhcp.com \";
  11. Option domain-name \ "xfbaydhcp.com \"; # domain name
  12. Option domain-name-servers 202.102.152.3; # DNS address
  13.  
  14. OptionTime-OffSet-18000; # Eastern Standard Time
  15.  
  16. Range dynamic-bootp 192.168.1.100 192.168.1.200; # the range of the rented IP Address
  17. Default-lease-time 21600; # default lease time
  18. Max-lease-time 43200; # maximum lease time
  19.  
  20. # We want the nameserver to appear at a fixed address
  21. Host ns {
  22. NExT-server marvin.RedHat.com;
  23. Hardware ethernet 12: 34: 56: 78: AB: CD;
  24. Fixed-address 207.175.42.254;
  25. }
  26. }

After the configuration is complete, the DHCP service is set up and you can start the service. [Root @ DHCPserver CentOS] # service dhcpd start ----------------------- comment ----------------- Service dhcpd start # start the service Service dhcpd stop # stop the service Service dhcpd restart # restart the service
----------------------------------------------

Linux client:
Modify the file for the ifcfg-eth0, change the BOOTPROTO option to DHCP, and get it automatically.
[Root @ localhost ~] # Vi/etc/sysconfig/network-scripts/ifcfg-eth0
# AdvaNcEd Micro Devices [AMD] 79c970 [PCnet32 LANCE]
DEVICE = eth0
BOOTPROTO =Dhcp
HWADDR = 00: 0C: 29: D1: 8D: D2
ONBOOT = dhcp
Restart the network service
[Root @ localhost ~] # Service network restart
PassIfconfigCommand to see that the IP address has been obtained

 
 
  1. eth0      Link encap:Ethernet  HWaddr 00:0C:29:D1:8D:D2      
  2.           inet addr:192.168.1.101 Bcast:192.168.1.1  Mask:255.255.255.0    
  3.           inet6 addr: fe80::20c:29ff:fed1:8dd2/64 Scope:Link    
  4.           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1    
  5.           RX packets:2093 errors:2 dropped:0 overruns:0 frame:0    
  6.           TX packets:634 errors:0 dropped:0 overruns:0 carrier:0    
  7.           collisions:0 txqueuelen:1000     
  8.           RX bytes:184237 (179.9 KiB)  TX bytes:73399 (71.6 KiB)    
  9.           Interrupt:169 Base address:0x2000     
  10.    
  11. lo        Link encap:Local Loopback      
  12.           inet addr:127.0.0.1  Mask:255.0.0.0    
  13.           inet6 addr: ::1/128 Scope:Host    
  14.           UP LOOPBACK RUNNING  MTU:16436  Metric:1    
  15.           RX packets:1129 errors:0 dropped:0 overruns:0 frame:0    
  16.           TX packets:1129 errors:0 dropped:0 overruns:0 carrier:0    
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.