DNS & DHCP & Iptables - CentOS-4.4安裝DHCP
linn - 星期三 八月 09, 2006 9:41 am 文章主題: CentOS-4.4安裝DHCP yum -y install dhcp dhcp-devel 範例檔 /usr/share/doc/dhcp-3.0.3/dhcpd.conf.sample 依照範例檔修改就OK了 /var/lib/dhcpd/dhcpd.leases 若沒有這個檔就touch他 這也是租用明細檔 Windows Server DHCP服役七年也除役了 from : http://www.lhes./phpbb2/printview.php?t=372&start=0 快速建構DHCP Service (For CentOS) (1) 將 sample檔拷貝到 /etc/ 下(若原本已存在請覆蓋掉)
CODE:
cp /usr/share/doc/dhcp-3.0.1/dhcpd.conf.sample /etc/dhcpd.conf
(2)編輯設定檔
CODE:
vi /etc/dhcpd.conf
CODE:
ddns-update-style interim;
ignore client-updates; subnet 192.168.0.0 netmask 255.255.255.0 { # --- default gateway #設定預設閘道(必要) option routers 192.168.0.1; #設定子遮罩(必要) option subnet-mask 255.255.255.0; #若您有使用NIS服務當作帳號認證請設定,一般狀況下不需要 # option nis-domain "domain.org"; #若您有使設定網域服務請設定,一般狀況下不需要 # option domain-name "domain.org"; #設定主要及次要DNS服務 option domain-name-servers 168.95.1.1; option domain-name-servers 210.66.72.1; option time-offset -18000; # Eastern Standard Time # option ntp-servers 192.168.1.1; # option netbios-name-servers 192.168.1.1; # --- Selects point-to-point node (default is hybrid). Don‘t change this unless # -- you understand Netbios very well # option netbios-node-type 2; #設定IP範圍及租期 range dynamic-bootp 192.168.0.200 192.168.0.230; default-lease-time 21600; max-lease-time 43200; #若您有給予特定主機固定IP請依下列設定 # we want the nameserver to appear at a fixed address # host ns { # next-server marvin.redhat.com; # hardware ethernet 12:34:56:78:AB:CD; # fixed-address 207.175.42.254; # } } (3) 檢查/var/lib/dhcp/dhcpd.leases 是否存在,若是沒有請創建一個空檔案即可 (4) 啟動服務
CODE:
service dhcpd start
(5)測試 ![]() ![]() (6)完成 |
|