【文章內容簡介】
會發(fā)之前發(fā)過的dhcprequest包(包含之前請求的信息),這時接到包的服務器會優(yōu)先分配原先的地址,并回復一個信息。如果ip已被占用,這回復dhcpnack(告訴客戶端ip有人用了),那么客戶端就要重新發(fā)dhcpdiscover包了。,時間到了的話服務器就會回收地址,若要延期就得更新ip租約。一般情況下在租約過半時,客戶端就會發(fā)送更新租約的信息,若得不到確認信息的話,到了四分之三的租約時間客戶端就不能再使用這個ip了。,這時候客戶端就會發(fā)送一個dhcplerease的命令。(不知道這和我們可以隨時改ip有不有關系,我們臨時改ip是不是也發(fā)這么一個包)。接下來是安裝和配置過程:粗體部分是我們需要編輯配置的[root@node1 桌面] yum y install dhcp (配好庫是前提)[root@node1 桌面] cp /usr/share/doc//etc/dhcp/在我們安裝完包以后,一般都會有一個配置文件的范例,為了方便節(jié)約時間,我們會選擇復制這個文件,再對文件進行編輯配置, Sample configuration file for ISC dhcpd option definitions mon to all supported networks...option domainname 。option domainnameservers , 。defaultleasetime 600。maxleasetime 7200。#這是對服務器域名的配置,在本實驗中并沒有用,我們可以略過這部分 This is a very basic subnet declaration.#基本的子網聲明subnet netmask {#這是服務器所處的網段,以及它的子網掩碼 range 。#我們dhcp服務器可以提供的ip地址范圍 option routers 。#(路由的選擇) filename 。這是我們啟動要用到的文件,增加 tftpserver 需要推送給客戶端的啟動文件(bootstrap)因為 tftp 的默認目錄是 /tftpboot,所以文件的絕對路徑就是: /tftpboot/ nextserver 。告訴客戶端在獲取到 文件之后去哪里獲取其余的啟動文件} This declaration allows BOOTP clients to get dynamic addresses, which we don39。t really remend.subnet netmask { range dynamicbootp 。 option broadcastaddress 。 option routers 。}有好幾個范本供我們選擇,不用的我們可以刪掉,也可以打上注釋 A slightly different configuration for an internal subnet.subnet netmask { range 。 option domainnameservers 。 option domainname 。 option routers 。 option broadcastaddress 。 defaultleasetime 600。 maxleasetime 7200。} Hosts which require special configuration options can be listed in host statements. If no address is specified, the address will be allocated dynamically (if possible), but the hostspecific information will still e from the host declaration.host passacaglia { hardware ethernet 0:0:c0:5d:bd:95。 filename 。 servername 。} Fixed IP addresses can also be specified for hosts. These addresses should not also be listed as being available for dynamic assignment. Hosts for which fixed IP addresses have been specified can boot using be booted with DHCP, unless there is an address range on the subnet set.host fantasia { hardware ethernet 08:00:07:26:c0:a5。 fixedaddress 。} You can declare a class of clients and then do address allocation in a certain class get addresses on the , and all other clients get addresses on the class foo { match if substring (option vendorclassidentifier, 0, 4) = SUNW。}sharednetwork 22429 { subnet netmask { option routers 。 } subnet netmask { option routers 。 } pool { allow members of foo。 range 。 } pool { deny members of foo。 range 。 }}后面的這一部分跟本次設計關系不大,其實并沒有用到,目前我也看不大懂。開機自啟動[root@node1 ~] service dhcpd startStarting dhcpd: [ OK ][root@node1 ~] chkconfig dhcpd on TFTP服務的安裝與配置TFTP是一種文件傳輸?shù)姆眨糜诜掌髋c客戶端進行文件的傳輸,不過它只能進行簡單的文件傳輸,這個服務的開銷并不大,所以并不能進行大文件的傳輸,多用于小文件的傳輸。它沒有FTP那么強大,但是tftp適用于udp,有些時候還是tftp更方便。它默認占用的端口號是69。接下來我們來進行安裝:先安裝守護進程 xinetd (tftp是屬于它的)[root@node1 ~] yum install xinetd yserver | kB 00:00 ... Resolving Dependencies Running transaction check Package 2: set to be updated Finished Dependency ResolutionDependencies Resolved================================================================================ Package Arch Version Repository Size================================================================================Installing: xinetd i686 2: server 121 kTransaction Summary================================================================================Install 1 Package(s)Upgrade 0 Package(s)Total download size: 121 kInstalled size: 258 kIs this ok [y/N]: yDownloading Packages:Running rpm_check_debugRunning Transaction TestTransaction Test SucceededRunning Transaction Installing : 2: 1/1 Installed: 2: Complete![root@node1 ~] yum install tftpserver y [root@node1 ~] vim /etc/(編輯配置文件) default: off description: The tftp server serves files using the trivial file transfer \ workstations, download configuration files to networkaware printers, \ and to start the installation process for some operating systems.service tf