We are here today to do the configuration of the DHCP server, our previous prompt to implement a DHCP server with a virtual machine
1. First of all, we need to have DHCP software, we use the following two software (can use other methods from the Internet directly installed, specific methods of network search)
dhcp-3.0pl1-23.i386.rpm
dhcp-devel-3.0pl1-23.i386.rpm
After downloading, install
# rpm-ivh/home/yanji/dhcp*.rpm
2. We update the data content of the search to find our main configuration file
# UpdateDB
# Locate Dhcpd.conf
/etc/log.d/conf/services/dhcpd.conf
/usr/share/doc/dhcp-3.0pl1/dhcpd.conf.sample
/usr/share/man/man5/dhcpd.conf.5.gz
It is not difficult for us to find a file that is dhcpd.conf.sample, this file is our most important entry point.
Next use the following command to create a new /etc/dhcpd.conf file under the destination directory, which is the DHCP configuration file
# cp/usr/share/doc/dhcp-3.0pl1/dhcpd.conf.sample/etc/dhcpd.conf
3. Let's modify this DHCP configuration file
Description
Name |
Explain |
Subnet |
Specify subnet scope |
Option routers |
Gateway |
Option Subnet-mask |
Gateway Subnet Mask |
Option Domain-name Option Domain-name-servers |
DNS, set the domain name and IP of the domain name server |
Option Time-offset |
Time zone |
Range DYNAMIC-BOOTP |
Set the address pool for DHCP |
Default-lease-time |
Default Lease Time |
Max-lease-time |
Maximum lease time |
Host |
Set the reserved host name, which is equivalent to statically assigning a |
Here is the text version of the configuration information
1ddns-update-style interim;2Ignore client-updates;3 4Subnet10.10.10.0Netmask255.255.255.0 {5 6# ---defaultGateway7Option routers10.10.10.10;8Option Subnet-mask255.255.255.0;9 TenOption Domain-name"ns.gr.org"; OneOption Domain-name-servers10.10.10.10; A -Option Time-offset28800; -# option Ntp-servers192.168.1.1; the# option Netbios-name-servers192.168.1.1; -#---selects Point-to-Point node (default isHybrid). Don'T change this unless -# --You understand Netbios very well -# option Netbios-node-type2; + -Range DYNAMIC-BOOTP10.10.10.100 10.10.10.200; + default-lease-time21600; AMax-lease-time43200; at -# We want the nameserver to appear at afixedAddress - Host boss { -next-server marvin.redhat.com; -Hardware Ethernet A: the: About: +: AB:CD; - fixed-address207.175.42.188; in } -}
4. After configuring the above content, we restart the DHCP service
# service DHCPD Start
View Daemon (/USR/SBIN/DHCPD)# Ps-ax | grep dhcpd9782? S 0:00/USR/SBIN/DHCPD
9789 pts/0 S 0:00 grep dhcpdThere is a display indicating that we have started the DHCP service, then the excitement is coming.Note:
5. Here I have done the previous few, so my current virtual machine is using Vmnet 1,ip is 10.10.10.10 (the previous article has a description )
We remove the DHCP access to the virtual machine
Then set the VMNet1 of the network adapter under Windows to get automatically
After the set up, we have done the most critical, look at the results of the time, we run cmd, input ipconfig, the following shows that our configuration is successful (we configured the last of the address pool is 200), we can use our virtual machine to do a DHCP server
5. View the lease files under Linux
# cat/var/lib/dhcp/dhcpd.leases
1# all timesinch ThisFile isinchUTC (GMT), not your local timezone. This is2# a bug, so please don'T ask about it. There is no portable -to3# Store LeasesinchThe local timezone, so please don'T Request this as a4# feature. If This isinconvenient or confusing to you, we sincerely5# apologize. Seriously, Though-don't ask.6# The format of ThisFile isDocumentedinchThe Dhcpd.leases (5) manual page.7# This lease file is written by isc-dhcp-V3.0PL18 9Lease10.10.10.200 {TenStarts1 -/Geneva/ . -: -: the; OneEnds2 -/Geneva/ - xx: -: the; A binding state active; -Next binding State Free; -Hardware Ethernetxx: -: About: C0:xx: on; theUid"\001\000pv\300\000\001"; -Client-hostname"Pc-20140925isen"; -}
The lease file exists and we can see what the lease file is when we are free.
(iii) Play with me Linux network services: DHCP service configuration