Instalación del servidor DHCP en Linux Redhat

Tema en 'Manuales' iniciado por Daxtrox, 11 Nov 2010.

  1. Daxtrox

    Daxtrox Usuario Habitual nvl.3 ★
    87/163

    Registrado:
    12 Abr 2009
    Mensajes:
    17.081
    Me Gusta recibidos:
    9
    Instalación del servidor DHCP en Linux Redhat


    Descargar e instalar el paquete DHCP

    Antes de instalar el paquete, revisamos que el servidor dhcp no haya sido instalado anteriormente, tecleando el comando:

    Insertar CODE, HTML o PHP:
    root:~# ntsysv
    Si aparece instalado lo activamos, dentro del comando ntsysv o tecleando lo siguiente;

    Insertar CODE, HTML o PHP:
    root:~# chkconfig dhcpd on
    De lo contrario, en Redhat Enterprise 5 buscamos el paquete dhcp-3.0.5-3.el5.i386.rpm y lo instalamos:

    Insertar CODE, HTML o PHP:
    root:~# rpm -ivh dhcp-3.0.5-3.el5.i386.rpm

    Configuración del servicio DHCP en Linux Redhat Enterprise

    Para configurar el servidor de asignacion dinamica de direcciones IP editamos el archivo /etc/dhcp*/dhcpd.conf 0 /etc/dhcpd.conf (dependiendo de la version). De no existir este archivo, la instalacion crea un archivo de configuracion de ejemplo en /usr/share/doc/dhcp-<version-number>/dhcpd.conf.sample.

    Ahora debemos sacar una copia de este archivo para poder trabajar en nuestra configuración:

    Insertar CODE, HTML o PHP:
    root:~# cp /usr/share/doc/dhcp-3.0pl1/dhcpd.conf.sample /etc/dhcpd.conf
    Un rápido vistazo al archivo de configuración nos muestra lo siguiente:

    Insertar CODE, HTML o PHP:
    ddns-update-style interim
    ignore client-updates
    
    subnet 192.168.1.0 netmask 255.255.255.0 {
    
       # The range of IP addresses the server
       # will issue to DHCP enabled PC clients
       # booting up on the network
    
       range 192.168.1.201 192.168.1.220;
    
       # Set the amount of time in seconds that
       # a client may keep the IP address
    
      default-lease-time 86400;
      max-lease-time 86400;
    
       # Set the default gateway to be used by
       # the PC clients
    
       option routers 192.168.1.1;
       # Don't forward DHCP requests from this
       # NIC interface to any other NIC
       # interfaces
    
       option ip-forwarding off;
    
       # Set the broadcast address and subnet mask
       # to be used by the DHCP clients
    
      option broadcast-address 192.168.1.255;
      option subnet-mask 255.255.255.0;
    
       # Set the NTP server to be used by the
       # DHCP clients
    
      option ntp-servers 192.168.1.100;
    
       # Set the DNS server to be used by the
       # DHCP clients
    
      option domain-name-servers 192.168.1.100;
    
       # If you specify a WINS server for your Windows clients,
       # you need to include the following option in the dhcpd.conf file:
    
      option netbios-name-servers 192.168.1.100;
    
       # You can also assign specific IP addresses based on the clients'
       # ethernet MAC address as follows (Host's name is "laser-printer":
    
      host laser-printer {
          hardware ethernet 08:00:2b:4c:59:23;
         fixed-address 192.168.1.222;
       }
    }
    #
    # List an unused interface here
    #
    subnet 192.168.2.0 netmask 255.255.255.0 {
    }
    
    En mi versión de producción utilizo algo como lo siguiente, lo cual he comentado o borrado todo el contenido para agregar al final del archivo de configuración:

    Insertar CODE, HTML o PHP:
    option domain-name              "prueba.cl";
    option domain-name-servers 192.168.1.10;
    option netbios-name-servers 192.168.1.11;
    default-lease-time              600;
    max-lease-time                  7200;
    authoritative;
    subnet 192.168.1.0 netmask 255.255.255.0 {
    option broadcast-address 192.168.1.255;
    option routers          192.168.1.1;
    option subnet-mask      255.255.255.0;
    host jefea { #Nombre en la red de la máquina de windows
    option host-name "jagencia.bancoreformador.com"; #Opcional
    hardware ethernet 00:E0:7D:74:C1:73; #Direccion MAC de la PC.
    fixed-address 192.168.1.50; #Direccion IP con la cual va a trabajar la PC.
    }
    host servidor_archivos {
    option host-name "archivos.prueba.cl";
    hardware ethernet 00:A1:DD:74:C3:F2;
    fixed-address 192.168.1.60;
    }
    }
    Luego de editar, guardamos la configuracion y tecleamos (siempre como root);

    Insertar CODE, HTML o PHP:
    root:~# service dhcpd start
    root:~# service dhcpd stop
    root:~# service dhcpd restart
    Revisamos que el servicio este siendo ejecutado en el sistema operativo, tecleando

    Insertar CODE, HTML o PHP:
    root:~# pgrep dhcpd
    11629 #Numero de proceso pid.
    Revisar la bitacora del servidor dhcpd, tecleando
    root:~# tail -f /var/log/syslog
    
    ::portalnet::
     
  2. the kamikase

    the kamikase Usuario Maestro nvl. 6 ★ ★ ★ ★
    697/812

    Registrado:
    19 Sep 2008
    Mensajes:
    70.248
    Me Gusta recibidos:
    49
  3. electrodumix25

    electrodumix25 Usuario Casual nvl. 2
    37/41

    Registrado:
    19 Oct 2008
    Mensajes:
    1.182
    Me Gusta recibidos:
    10
    demas que a mas de alguien le servira , gracias por tu aporte.
     
  4. Daxtrox

    Daxtrox Usuario Habitual nvl.3 ★
    187/244

    Registrado:
    12 Abr 2009
    Mensajes:
    17.081
    Me Gusta recibidos:
    9

    ojalas esa es la gracia xd ahora estoy haciendo uno sobre apache ftp y dhcp :yeah:
     
  5. electrodumix25

    electrodumix25 Usuario Casual nvl. 2
    37/41

    Registrado:
    19 Oct 2008
    Mensajes:
    1.182
    Me Gusta recibidos:
    10

    quedamos a la espera entonces... jijiji saludos mennnn.
     
  6. deathblade

    deathblade Usuario Nuevo nvl. 1
    1/41

    Registrado:
    6 Sep 2009
    Mensajes:
    10
    Me Gusta recibidos:
    0
    justo lo que necesitaba, a ver si así me queda un poquito mas claro
    :wena:
     
  7. AL2_

    AL2_ Usuario Habitual nvl.3 ★
    187/244

    Registrado:
    25 Abr 2009
    Mensajes:
    20.338
    Me Gusta recibidos:
    14
    Muchas gracias
     
  8. janod21

    janod21 Usuario Habitual nvl.3 ★
    132/163

    Registrado:
    9 Ago 2007
    Mensajes:
    7.236
    Me Gusta recibidos:
    305
    gracias me imagino que es transferible a fedora
     
  9. aronarr

    aronarr Usuario Casual nvl. 2
    87/163

    Registrado:
    17 Abr 2008
    Mensajes:
    6.174
    Me Gusta recibidos:
    7
    espero me sirva para la prueba de mañana