宜蘭縣教育支援平台 會員登入 會員註冊 我的i教書

« 上一篇 | 下一篇 »

原本是安裝 dnsmasq 來當做 DHCP Server,在沒有設定防火牆時,Windows Client 都可以正常取得 IP,但加上防火牆之後,Client 端變成無法自動取得 IP,試了很久都無法解決,確定防火牆設定檔是沒有問題的,所以乾脆就改用 isc-dhcp DHCP Server 了。

1. 安裝 isc-dhcp DHCP Server
# apt-get update
# apt-get install isc-dhcp-server

etting up isc-dhcp-server (4.3.1-6+deb8u2) ...
Generating /etc/default/isc-dhcp-server...
[FAIL] Starting ISC DHCP server: dhcpd[....] check syslog for diagnostics. ... f
 failed!
invoke-rc.d: initscript isc-dhcp-server, action "start" failed.

安裝完成會出現 failed 的訊息,是因為還沒有設定的關係!

2. 停止原本的 dnsmasq
# /etc/init.d/dnsmasq stop

3. 設定 dnsmasq 開機不執行
# update-rc.d dnsmasq remove

4. 設定 isc-dhcp Server  派送 IP 的網路卡
# vim /etc/default/isc-dhcp-server
INTERFACES="br0"

5. 修改 /etc/dhcp/dhcpd.conf 設定檔
# cp /etc/dhcp/dhcpd.conf /etc/dhcp/dhcpd.conf.$(date +%F)
# grep -vE '^$|^#' /etc/dhcp/dhcpd.conf
ddns-update-style none;
option domain-name "lwrt.org";
option domain-name-servers 168.95.1.1,140.111.66.1;
default-lease-time 7200;
max-lease-time 10800;
log-facility local7;
subnet 192.168.84.0 netmask 255.255.255.0 {
  range 192.168.84.101 192.168.84.120;
  option routers 192.168.84.1;
  option subnet-mask 255.255.255.0;
  option broadcast-address 192.168.84.0;
}
host passacaglia {
  hardware ethernet 61:62:63:64:d7:cc;
  fixed-address 192.168.84.101;
}

6. 測試一下試定檔是否正常
# /usr/sbin/dhcpd -t
Internet Systems Consortium DHCP Server 4.3.1
Copyright 2004-2014 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/
Config file: /etc/dhcp/dhcpd.conf
Database file: /var/lib/dhcp/dhcpd.leases
PID file: /var/run/dhcpd.pid

7. 啟動 isc-dhcp DHCP Server
# /etc/init.d/isc-dhcp-server start

8. 設定開機時啟動 isc-dhcp DHCP Server
# update-rc.d isc-dhcp-server defaults

如果你的網誌不支援引用網址自動搜尋功能,那麼你可以使用下列的直接引用網址來引用本文章:

http://blog.ilc.edu.tw/blog/trackback.php?id=682124