https://manuais.iessanclemente.net/index.php?title=Configuraci%C3%B3n_de_DHCP_Server_en_Debian&feed=atom&action=historyConfiguración de DHCP Server en Debian - Historial de revisiones2024-03-28T15:42:27ZHistorial de revisiones de esta página en el wikiMediaWiki 1.36.2https://manuais.iessanclemente.net/index.php?title=Configuraci%C3%B3n_de_DHCP_Server_en_Debian&diff=28923&oldid=prevVeiga: /* Instalación de DHCP3 */2012-10-01T18:04:38Z<p><span dir="auto"><span class="autocomment">Instalación de DHCP3</span></span></p>
<p><b>Página nueva</b></p><div>=== Teoría de DHCP ===<br />
[[Servizo_DHCP]]<br />
<br />
=== Instalación de DHCP3 ===<br />
* Atención si estamos trabajando en una red con VLAN y el servidor DHCP está fuera del alcance de nuestra VLAN, necesitaremos configurar en el switch que gestiona la VLAN un IP_Helper para redireccionar las peticiones DHCP al servidor DHCP central.<br />
<br />
* Instalar dhcp3-server:<br />
<source lang="bash"><br />
# Para instalarlo:<br />
apt-get install dhcp3-server<br />
<br />
# Los ficheros de configuración se encuentran en:<br />
/etc/dhcp3/ y /etc/default/isc-dhcp-server<br />
</source><br />
<br />
* Editar el fichero /etc/default/isc-dhcp-server para indicar la interfaz de escucha del DHCP:<br />
<source lang="bash"><br />
nano /etc/default/isc-dhcp-server<br />
<br />
# Defaults for dhcp initscript<br />
# sourced by /etc/init.d/dhcp<br />
# installed at /etc/default/isc-dhcp-server by the maintainer scripts<br />
#<br />
# This is a POSIX shell fragment<br />
#<br />
<br />
# On what interfaces should the DHCP server (dhcpd) serve DHCP requests?<br />
# Separate multiple interfaces with spaces, e.g. "eth0 eth1".<br />
INTERFACES="eth0"<br />
</source><br />
<br />
* Ejemplo del fichero por defecto /etc/dhcp/dhcpd.conf:<br />
<source lang="bash"><br />
#<br />
# Sample configuration file for ISC dhcpd for Debian<br />
#<br />
#<br />
<br />
# The ddns-updates-style parameter controls whether or not the server will<br />
# attempt to do a DNS update when a lease is confirmed. We default to the<br />
ddns-update-style none;<br />
<br />
# option definitions common to all supported networks...<br />
option domain-name "example.org";<br />
option domain-name-servers ns1.example.org, ns2.example.org;<br />
<br />
default-lease-time 600;<br />
max-lease-time 7200;<br />
<br />
# If this DHCP server is the official DHCP server for the local<br />
# network, the authoritative directive should be uncommented.<br />
#authoritative;<br />
<br />
# Use this to send dhcp log messages to a different log file (you also<br />
# have to hack syslog.conf to complete the redirection).<br />
log-facility local7;<br />
<br />
# No service will be given on this subnet, but declaring it helps the <br />
# DHCP server to understand the network topology.<br />
<br />
#subnet 10.152.187.0 netmask 255.255.255.0 {<br />
#}<br />
<br />
# This is a very basic subnet declaration.<br />
<br />
#subnet 10.254.239.0 netmask 255.255.255.224 {<br />
# range 10.254.239.10 10.254.239.20;<br />
# option routers rtr-239-0-1.example.org, rtr-239-0-2.example.org;<br />
#}<br />
<br />
# This declaration allows BOOTP clients to get dynamic addresses,<br />
# which we dont really recommend.<br />
<br />
#subnet 10.254.239.32 netmask 255.255.255.224 {<br />
# range dynamic-bootp 10.254.239.40 10.254.239.60;<br />
# option broadcast-address 10.254.239.31;<br />
# option routers rtr-239-32-1.example.org;<br />
#}<br />
<br />
# A slightly different configuration for an internal subnet.<br />
#subnet 10.5.5.0 netmask 255.255.255.224 {<br />
# range 10.5.5.26 10.5.5.30;<br />
# option domain-name-servers ns1.internal.example.org;<br />
# option domain-name "internal.example.org";<br />
# option routers 10.5.5.1;<br />
# option broadcast-address 10.5.5.31;<br />
# default-lease-time 600;<br />
# max-lease-time 7200;<br />
#}<br />
<br />
# Hosts which require special configuration options can be listed in<br />
# host statements. If no address is specified, the address will be<br />
# allocated dynamically (if possible), but the host-specific information<br />
# will still come from the host declaration.<br />
<br />
#host passacaglia {<br />
# hardware ethernet 0:0:c0:5d:bd:95;<br />
# filename "vmunix.passacaglia";<br />
# server-name "toccata.fugue.com";<br />
#}<br />
<br />
# Fixed IP addresses can also be specified for hosts. These addresses<br />
# should not also be listed as being available for dynamic assignment.<br />
# Hosts for which fixed IP addresses have been specified can boot using<br />
# BOOTP or DHCP. Hosts for which no fixed address is specified can only<br />
# be booted with DHCP, unless there is an address range on the subnet<br />
# to which a BOOTP client is connected which has the dynamic-bootp flag<br />
# set.<br />
#host fantasia {<br />
# hardware ethernet 08:00:07:26:c0:a5;<br />
# fixed-address fantasia.fugue.com;<br />
#}<br />
<br />
# You can declare a class of clients and then do address allocation<br />
# based on that. The example below shows a case where all clients<br />
# in a certain class get addresses on the 10.17.224/24 subnet, and all<br />
# other clients get addresses on the 10.0.29/24 subnet.<br />
<br />
#class "foo" {<br />
# match if substring (option vendor-class-identifier, 0, 4) = "SUNW";<br />
#}<br />
<br />
#shared-network 224-29 {<br />
# subnet 10.17.224.0 netmask 255.255.255.0 {<br />
# option routers rtr-224.example.org;<br />
# }<br />
# subnet 10.0.29.0 netmask 255.255.255.0 {<br />
# option routers rtr-29.example.org;<br />
# }<br />
# pool {<br />
# allow members of "foo";<br />
# range 10.17.224.10 10.17.224.250;<br />
# }<br />
# pool {<br />
# deny members of "foo";<br />
# range 10.0.29.10 10.0.29.230;<br />
# }<br />
#}<br />
</source><br />
<br />
* '''Fichero de logs del dhcp server:'''<br />
Se encuentra en /var/log/syslog<br />
<br />
<br />
* Para iniciar / parar el servicio DHCP:<br />
<source lang="bash"><br />
service isc-dhcp-server start | stop | status<br />
</source><br />
--[[Usuario:Veiga|Veiga]] 20:04 1 oct 2012 (CEST)</div>Veiga