Installing and Configuring DHCP Server (DHCPd) on FreeBSD安裝和配置DHCP伺服器( dhcpd )在FreeBSD
DHCP, the Dynamic Host Configuration Protocol, describes the means by which a system can connect to a network and obtain the necessary information for communication upon that network. DHCP的,動態主機配置協議,描述的方法,使系統可以連接到網絡上,並且獲得必要的信息溝通後,該網絡。
When dhclient, the DHCP client, is executed on the client machine, it begins broadcasting requests for configuration information.當dhclient , DHCP客戶端,並執行客戶端的機器,它開始廣播請求配置信息。 By default, these requests are on UDP port 68.默認情況下,這些要求對UDP端口68 。 The server replies on UDP 67, giving the client an IP address and other relevant network information such as netmask, router, and DNS servers.服務器的答复UDP的67 ,給予客戶一個IP地址和其他相關的網絡信息,如網絡掩碼,路由器和DNS伺服器。 All of this information comes in the form of a DHCP ?lease?所有這方面的資料來,在形式的一個DHCP ?契約? and is only valid for a certain time (configured by the DHCP server maintainer).是僅適用於一定時間內(所設定的DHCP伺服器的維護者) 。 In this manner, stale IP addresses for clients no longer connected to the network can be automatically reclaimed.以這種方式,陳舊的IP地址為客戶不再連接到網絡可以自動填海。
DHCP Server (or DHCPd) is the server that provides the DHCP client the information it needed, and it’s the server portion of the suite is not provided as part of FreeBSD, and so it needs to install from the net/isc-dhcp3-server port to provide this service. DHCP伺服器(或dhcpd )是服務器提供DHCP客戶端的信息需要,它的服務器部分套房是沒有提供的一部分, FreeBSD的,因此它需要安裝從net/isc-dhcp3 -服務器端口提供這項服務。
FreeBSD comes with ISC DHCP, and it comes with FreeBSD as ports net/isc-dhcp3-server. FreeBSD的附帶的ISC DHCP和它與FreeBSD的港口net/isc-dhcp3-server 。
To install it, change to ports net/isc-dhcp3-server directory and execute the following command:把它安裝,改變港口net/isc-dhcp3-server目錄並執行以下命令:
# make install clean # make install的清潔
DHCPd is configured by using a configuration file, normally dhcpd.conf located at /usr/local/etc directory. dhcpd配置使用配置文件,通常位於dhcpd.conf在/ usr / local / etc目錄。 Normally there is an example configuration file which is dhcpd.conf.example at the directory.通常就是一個例子配置文件,這是dhcpd.conf.example在目錄中。 Copy dhcpd.conf.example to dhcpd.conf or create a new dhcpd.conf before proceeding to make changes on DHCP Server.複製dhcpd.conf.example到dhcpd.conf或創建一個新的dhcpd.conf ,然後才作出改變對DHCP伺服器。
dhcpd.conf is comprised of declarations regarding subnets and hosts, and is perhaps most easily explained using an example : dhcpd.conf組成的聲明關於子網和主機,也許是最容易解釋,使用一個例子:
option domain-name “example.com”; (1)選擇的網域名稱“ example.com ” ; ( 1 )
option domain-name-servers 192.168.4.100; (2)選擇的網域名稱伺服器192.168.4.100 ; ( 2 )
option subnet-mask 255.255.255.0; (3)選項的子網-遮罩255.255.255.0 ; ( 3 )
default-lease-time 3600; (4)默認情況下-租賃-時間36 00;( 4 )
max-lease-time 86400; (5)最大租賃時間86400 ; ( 5 )
ddns-update-style none; (6) ddns更新式無; ( 6 )
subnet 192.168.4.0 netmask 255.255.255.0 { 192.168.4.0子網的網絡掩碼255.255.255.0 (
range 192.168.4.129 192.168.4.254; (7)範圍192.168.4.129 192.168.4.254 ; ( 7 )
option routers 192.168.4.1; (8)選擇路由器192.168.4.1 ; ( 8 )
} )
host mailhost {東道國mailhost (
hardware ethernet 02:03:04:05:06:07; (9)硬件以太網02:03:04:05:06:07 ; ( 9 )
fixed-address mailhost.example.com; (10)固定地址mailhost.example.com ; ( 10 )
} )
(1) This option specifies the domain that will be provided to clients as the default search domain. ( 1 )此選項指定的網域將提供給客戶作為默認的搜索域。
(2) This option specifies a comma separated list of DNS servers that the client should use. ( 2 )此選項指定了一個逗號分隔的列表的DNS伺服器的客戶端應該使用。
(3) The netmask that will be provided to clients. ( 3 )網絡掩碼將提供給客戶。
(4) A client may request a specific length of time that a lease will be valid. ( 4 )客戶端可能會要求一個具體的時間長度,一個契約將無效。 Otherwise the server will assign a lease with this expiry value (in seconds).否則,服務器將指派一個契約與此屆滿值(以秒計算) 。
(5) This is the maximum length of time that the server will lease for. ( 5 ) ,這是最高的時間長度,該服務器將契約。 Should a client request a longer lease, a lease will be issued, although it will only be valid for max-lease-time seconds.應客戶要求一個較長的租約,租賃,會發出,雖然它只會有效期為最大值-租賃-時間秒。
(6) This option specifies whether the DHCP server should attempt to update DNS when a lease is accepted or released. ( 6 )此選項指定是否DHCP伺服器應嘗試以更新DNS時,契約是接受或釋放。 In the ISC implementation, this option is required.在國際科學委員會執行,此選項是必需的。
(7) This denotes which IP addresses should be used in the pool reserved for allocating to clients. ( 7 )這是指其中的IP地址應該用在游泳池預留作分配給客戶。 IP addresses between, and including, the ones stated are handed out to clients. IP地址之間,並包括,那些聲明,交給了客戶。
(8) Declares the default gateway that will be provided to clients. ( 8 )宣布,默認網關將提供給客戶。
(9) The hardware MAC address of a host (so that the DHCP server can recognize a host when it makes a request). ( 9 )的硬件MAC地址的主機(使DHCP伺服器可自動識別主機時,提出要求) 。
(10) Specifies that the host should always be given the same IP address. ( 10 )訂明,東道國應始終被置於相同的IP地址。 Note that using a hostname is correct here, since the DHCP server will resolve the hostname itself before returning the lease information.請注意,使用主機名是正確的在這裡,因為DHCP伺服器將解決主機本身,然後返回租賃的信息。
Once you have finished writing your dhcpd.conf, you can proceed to start the server by issuing the following command:一旦您寫完您的dhcpd.conf ,您就可以著手啟動服務器發出以下命令:
# /usr/local/etc/rc.d/isc-dhcpd.sh start #為/ usr /本地的/ etc / rc.d /的ISC - dhcpd.sh開始
Should you need to make changes to the configuration of your server in the future, it is important to note that sending a SIGHUP signal to dhcpd does not result in the configuration being reloaded, as it does with most daemons.如果您需要作出改變的配置您的服務器在未來的日子,這是很重要的注意,派遣一個sighup信號, dhcpd沒有結果,在被重新配置,因為這是與大多數的後台程序。 A SIGTERM signal to stop the process, and then restart it using the command above. 1 sigterm信號停止的過程中,然後重新啟動它使用命令以上。 For example:例如:
# ps wax | grep dhcpd #的PS蠟| grep dhcpd
pid of dhcpd will be shown 的PID dhcpd將顯示
# kill -15 (pid of dhcpd) #殺死-15 ( PID控制的dhcpd )
IMPORTANT : This is a machine translated page which is provided "as is" without warranty. 重要說明 :這是一個機器翻譯網頁是“按原樣”提供的擔保。 Machine translation may be difficult to understand.機器翻譯可能很難理解。 Please refer to請參閱 original English article原來的英語文章 whenever possible.只要有可能。
Share and contribute or get technical support and help at分享和貢獻,或取得技術的支持和幫助,在 My Digital Life Forums 我的數字生活論壇 . 。
Related Articles相關文章
- Installing Web Server in FreeBSD 6.0 with Apache 2.2, MySQL 5.0 and PHP 5 - Part 4安裝Web服務器在FreeBSD的6.0與2.2的Apache , MySQL 5.0的和PHP 5 -第4部分
- Installing Web Server in FreeBSD 6.0 with Apache 2.2, MySQL 5.0 and PHP 5 - Part 3安裝Web服務器在FreeBSD的6.0與2.2的Apache , MySQL 5.0的和PHP 5 -第3部分
- Checking Free Disk Space on FreeBSD Server檢查可用磁盤空間在FreeBSD服務器
- FreeBSD 6.0 on VMware Server Time and Clock Slow Down在FreeBSD 6.0就VMware服務器的時間和時鐘放緩
- Installing Web Server in FreeBSD 6.0 with Apache 2.2, MySQL 5.0 and PHP 5 - Part 2安裝Web服務器在FreeBSD的6.0與2.2的Apache , MySQL 5.0的和PHP 5中-第2部分
- Installing Web Server in FreeBSD 6.0 with Apache 2.2, MySQL 5.0 and PHP 5 - Part 5安裝Web服務器在FreeBSD的6.0與2.2的Apache , MySQL 5.0的和PHP 5 -第5部分
- FreeBSD Apache HTTP Accept Filter Error FreeBSD上的Apache的HTTP接受過濾器的錯誤
- Update FreeBSD Ports Collection Up to Date and Latest更新FreeBSD的港口收集到的日期和最新
- Lindy Mini NAS Enclosure lindy迷你的NAS文
- Update FreeBSD Ports Collection to Latest Version with Security Update with Portmanager and Portaudit更新FreeBSD的港口收集到最新版本,與安全性更新與portmanager和portaudit
































