Installing and Configuring DHCP Server (DHCPd) on FreeBSD Instal lació i configuració del servidor DHCP (dhcpd) a 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, el Dynamic Host Configuration Protocol, es descriu la forma en què un sistema pot connectar-se a una xarxa i obtenir la informació necessària per a la comunicació a la xarxa.
When dhclient, the DHCP client, is executed on the client machine, it begins broadcasting requests for configuration information. Quan dhclient, el client DHCP, s'executa a la màquina client, es comença a emetre les sol licituds d'informació de configuració. By default, these requests are on UDP port 68. Per defecte aquestes peticions es realitzen al port 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. El servidor respon a port UDP 67 proporcionant al client una adreça IP i altres dades pertinents, tals com a xarxa de màscara de xarxa, router, i els servidors DNS. All of this information comes in the form of a DHCP ?lease? Tota aquesta informació ve en forma d'arrendament d'un servidor DHCP?? and is only valid for a certain time (configured by the DHCP server maintainer). i només és vàlid per a un determinat temps (configurat per l'administrador un servidor DHCP). In this manner, stale IP addresses for clients no longer connected to the network can be automatically reclaimed. D'aquesta manera, ranci adreces IP dels clients ja no està connectat a la xarxa poden ser reutilitzades.
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 Server (o dhcpd) és el servidor que proporciona el client DHCP de la informació que necessita, i és la part servidor del conjunt no està previst com a part de FreeBSD, per la qual cosa requereix la instal.lació de la net/isc-dhcp3-server port per proporcionar aquest servei.
FreeBSD comes with ISC DHCP, and it comes with FreeBSD as ports net/isc-dhcp3-server. FreeBSD ve amb ISC DHCP afegit, i ve amb FreeBSD com ports net/isc-dhcp3-server.
To install it, change to ports net/isc-dhcp3-server directory and execute the following command: Per instal lar, canviar els ports net/isc-dhcp3-server directori i executar el següent comandament:
# make install clean # Make install clean
DHCPd is configured by using a configuration file, normally dhcpd.conf located at /usr/local/etc directory. Dhcpd està configurat per mitjà d'un arxiu de configuració, normalment dhcpd.conf larà en / usr / local / etc directori. Normally there is an example configuration file which is dhcpd.conf.example at the directory. Normalment hi ha un fitxer de configuració d'exemple que es dhcpd.conf.example al directori. Copy dhcpd.conf.example to dhcpd.conf or create a new dhcpd.conf before proceeding to make changes on DHCP Server. Copia a dhcpd.conf.example dhcpd.conf dhcpd.conf o crear una nova abans de procedir a realitzar canvis en el servidor DHCP.
dhcpd.conf is comprised of declarations regarding subnets and hosts, and is perhaps most easily explained using an example : dhcpd.conf es compon de declaracions relatives a les subxarxes i els exèrcits, i és potser més fàcil d'explicar amb un exemple:
option domain-name “example.com”; (1) option domain-name "example.com"; (1)
option domain-name-servers 192.168.4.100; (2) option domain-name-servers 192.168.4.100, (2)
option subnet-mask 255.255.255.0; (3) option subnet-mask 255.255.255.0; (3)
default-lease-time 3600; (4) default-lease-time 3.600, (4)
max-lease-time 86400; (5) max-lease-time 86400; (5)
ddns-update-style none; (6) ddns-update-style none; (6)
subnet 192.168.4.0 netmask 255.255.255.0 { subnet 192.168.4.0 netmask 255.255.255.0 (
range 192.168.4.129 192.168.4.254; (7) range 192.168.4.129 192.168.4.254; (7)
option routers 192.168.4.1; (8) option routers 192.168.4.1; (8)
} )
host mailhost { servidor de correu d'acollida (
hardware ethernet 02:03:04:05:06:07; (9) hardware ethernet 02:03:04:05:06:07, (9)
fixed-address mailhost.example.com; (10) fix mailhost.example.com direcció; (10)
} )
(1) This option specifies the domain that will be provided to clients as the default search domain. (1) Aquesta opció especifica el domini que es proporcionarà als clients com el domini de cerca per defecte.
(2) This option specifies a comma separated list of DNS servers that the client should use. (2) Aquesta opció especifica una llista separada per comes dels servidors DNS que el client ha d'utilitzar.
(3) The netmask that will be provided to clients. (3) La màscara de xarxa que es proporcionarà als clients.
(4) A client may request a specific length of time that a lease will be valid. (4) Un client pot demanar un període específic de temps que un contracte d'arrendament serà vàlid. Otherwise the server will assign a lease with this expiry value (in seconds). En cas contrari el servidor assigna un contracte d'arrendament amb aquest valor (en segons).
(5) This is the maximum length of time that the server will lease for. (5) Aquesta és la longitud màxima de temps que el servidor d'arrendament per. Should a client request a longer lease, a lease will be issued, although it will only be valid for max-lease-time seconds. En cas d'una sol licitud de client a més llarg contracte d'arrendament, un contracte d'arrendament serà publicada, tot i que només serà vàlida per max-lease-time segons.
(6) This option specifies whether the DHCP server should attempt to update DNS when a lease is accepted or released. (6) Aquesta opció especifica si el servidor DHCP ha d'intentar actualitzar el DNS quan s'accepta un contracte d'arrendament o alliberats. In the ISC implementation, this option is required. En l'aplicació d'ISC, es requereix aquesta opció.
(7) This denotes which IP addresses should be used in the pool reserved for allocating to clients. (7) Això indica quina adreça IP ha de ser utilitzats a la piscina reservada per assignar als clients. IP addresses between, and including, the ones stated are handed out to clients. Les adreces IP d'aquest rang, incloent-hi els extrems, es poden lliurar als clients.
(8) Declares the default gateway that will be provided to clients. (8) Declarar la porta d'enllaç per defecte que es proporcionarà als clients.
(9) The hardware MAC address of a host (so that the DHCP server can recognize a host when it makes a request). (9) L'adreça MAC d'un host (per a que el servidor DHCP pugui identificar la màquina quan realitzi una sol licitud).
(10) Specifies that the host should always be given the same IP address. (10) Especifica que la màquina s'ha de donar sempre la mateixa adreça IP. Note that using a hostname is correct here, since the DHCP server will resolve the hostname itself before returning the lease information. Tingueu en compte que l'ús d'un nom de host és correcte en aquest cas, ja que el servidor dhcp resoldrà el nom per si mateix abans de retornar la informació al client.
Once you have finished writing your dhcpd.conf, you can proceed to start the server by issuing the following command: Un cop hagueu acabat d'escriure el fitxer dhcpd.conf es pot procedir a iniciar el servidor mitjançant l'emissió de la següent comanda:
# /usr/local/etc/rc.d/isc-dhcpd.sh start # / Usr / local / etc / rc.d / isc-start 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. Si necessita realitzar canvis en la configuració del seu servidor en el futur, és important assenyalar que l'enviament d'un senyal SIGHUP a dhcpd no dóna lloc a la configuració de l'ésser recarregades, com ho fa amb la majoria dels dimonis. A SIGTERM signal to stop the process, and then restart it using the command above. Un senyal SIGTERM per aturar el procés i, a continuació, reinicieu utilitzant la comanda anterior. For example: Per exemple:
# ps wax | grep dhcpd # Ps cera | grep dhcpd
pid of dhcpd will be shown pid del dhcpd es mostra
# kill -15 (pid of dhcpd) # Kill -15 (pid del dhcpd)
IMPORTANT : The page is machine translated and provided "as is" without warranty. IMPORTANT: La pàgina és una traducció automàtica i proporciona "com és" sense garantia. Machine translation may be difficult to understand. La traducció automàtica pot ser difícil d'entendre. Please refer to Si us plau, vegeu original English article article anglès original whenever possible. sempre que sigui possible.
Related Articles Articles relacionats
- Installing Web Server in FreeBSD 6.0 with Apache 2.2, MySQL 5.0 and PHP 5 – Part 2 Instal lació de Web Server en FreeBSD 6.0 amb Apache 2.2, MySQL 5.0 i PHP 5 - Part 2
- Installing Web Server in FreeBSD 6.0 with Apache 2.2, MySQL 5.0 and PHP 5 – Part 5 Instal lació de Web Server en FreeBSD 6.0 amb Apache 2.2, MySQL 5.0 i PHP 5 - Part 5
- Installing Web Server in FreeBSD 6.0 with Apache 2.2, MySQL 5.0 and PHP 5 – Part 3 Instal lació de Web Server en FreeBSD 6.0 amb Apache 2.2, MySQL 5.0 i PHP 5 - Part 3
- Installing Web Server in FreeBSD 6.0 with Apache 2.2, MySQL 5.0 and PHP 5 – Part 4 Instal lació de Web Server en FreeBSD 6.0 amb Apache 2.2, MySQL 5.0 i PHP 5 - Part 4
- Installing Web Server in FreeBSD 6.0 with Apache 2.2, MySQL 5.0 and PHP 5 – Part 1 Instal lació de Web Server a FreeBSD 6,0 amb Apache 2.2, MySQL 5.0 i PHP 5 - Part 1
- Tips of How to Switch between DHCP and Static IP Network Automatically in Windows Consells de com canviar entre DHCP i Static IP de xarxa automàticament a Windows
- FreeBSD 6.0 on VMware Server Time and Clock Slow Down FreeBSD 6.0 a VMware Servidor Temps i Rellotge Slow Down
- Could Not Find Valid System Volume Error When Installing Windows Server 2008 (R2) No s'ha pogut trobar un sistema vàlid Tom error en instal lar Windows Server 2008 (R2)
- Missing CD/DVD Device Driver Problem While Installing Vista on VMWare Server/ESX Missing CD / DVD controlador problema en instal lar-les en VMWare Server / ESX
- Checking Free Disk Space on FreeBSD Server Comprovació d'espai lliure al disc de servidor a FreeBSD









































