FC9下安裝配置DHCP伺服器
1:利用yum安裝dhcp-4.0.0-14.fc9.i386.rpm
yum install dhcp
------------------------------------------------------------------------------
[root@localhost dhcp-3.0.7]# yum install dhcp
Loaded plugins: refresh-packagekit
fedora | 2.4 kB 00:00
primary.sqlite.bz2 | 6.1 MB 05:27
updates | 2.3 kB 00:00
primary.sqlite.bz2 | 296 kB 00:29
Setting up Install Process
Parsing package install arguments
Resolving Dependencies
--> Running transaction check
---> Package dhcp.i386 12:4.0.0-14.fc9 set to be updated
--> Finished Dependency Resolution
Dependencies Resolved
=============================================================================
Package Arch Version Repository Size
Installing:
dhcp i386 12:4.0.0-14.fc9 fedora 804 k
Transaction Summary
Install 1 Package(s)
Update 0 Package(s)
Remove 0 Package(s)
Total download size: 804 k
Is this ok [y/N]: y
Downloading Packages:
(1/1): dhcp-4.0.0-14.fc9.i386.rpm | 804 kB 00:41
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing: dhcp ######################### [1/1]
Installed: dhcp.i386 12:4.0.0-14.fc9
Complete!
--------------------------------------------------------------------------------
2:cd usr/share/doc/dhcp-4.0.4
3:複制一個配置執行個體到/etc目錄下
cp dhcpd.conf.sample /etc/dhcpd.conf
4:修改chcpd.conf檔案
# dhcpd.conf
# option definitions common to all supported networks...
option domain-name "elab.org"; #定義domain名稱
option domain-name-servers 192.168.40.8,192.168.40.9,192.168.40.12; #定義DNS伺服器,可以添加多個,用逗号隔開
option broadcast-address 192.168.63.255; #為用戶端制定廣播位址
option routers 192.168.41.253; #為用戶端制定網關
default-lease-time 60000; #指定預設的租約期限
max-lease-time 720000; #指定最大租約期限
# option netbios-name-servers 192.168.40.#; #可以指定wins伺服器
ddns-update-style ad-hoc #定義所支援的DNS動态更新類型(必選)
subnet 192.168.32.0 netmask 255.255.224.0 #定義作用域(IP子網)
{
range 192.168.43.1 192.168.55.255; #定義用戶端擷取位址的範圍
host 405zx01 { hardware ethernet 00:19:21:48:A2:2A; fixed-address 192.168.54.1;} #為指定用戶端綁定IP位址
host 403zl30 { hardware ethernet 00:19:21:48:9E:23; fixed-address 192.168.43.50;}
}
5:檢視DHCP服務情況
chkconfig --list |dhcpd
6:啟動dhcp服務
service dhcpd start
7:設定開機自啟動dhcpd服務
chkconfig dhcpd on