domingo, 17 de abril de 2011

Como configurar un servidor dhcp en linux

Publicado por Covent en 2:29 ,
El siguiente procedimiento se ha realizado sobre Debian

1.-Instalación del servidor/demonio

apt-get install dhcp3-server
2.-Configuración
Nos aseguramos que se va a ejecutar cada vez que arranque la máquina

sysv-rc-conf dhcp3-server on
Ahora queda editar el archivo de configuración dhcpd.conf

A continuación un ejemplo práctico.

ddns-update-style none;
ignore client-updates;
authoritative;
option  local-wpad      code    252     =       text;

subnet  10.1.1.0 netmask 255.255.255.0 {

# --- default gateway
      option routers                  10.1.1.1;
# --- Netmask
      option subnet-mask              255.255.255.0;
# --- Broadcast Address
      option broadcast-address        10.1.1.255;
# --- Domain Name, set the domain name for DHCP clients
      option domain-name              "alketech.com";
# --- Domain name servers, tells the clients which DNS servers to use.
      option domain-name-servers      200.87.61.83, 8.8.8.8, 8.8.4.4, 4.2.2.2;
      option time-offset              0;      # Eastern Standard Time
# --- Proxy auto configuration file, tells client browsers which Proxy to use -- See proxy.pac examble below
      option  local-wpad      "http://10.1.1.1/proxy.pac\n";
# --- Sets the ntp server
      option ntp-servers              10.1.1.1:
# --- If you need netbios name server, set it here
#     option netbios-name-servers     10.1.1.1;
# --- Set the range of IPs available for the DHCP to give to clients
      range 10.1.1.100 10.1.1.200;
# --- Set the default lease time, how much time the client is permited to use the given IP. After that the client tries to renew the use of the IP it is already using. Actually before that time has passed.
      default-lease-time 1209600;
# --- Set the maximum lease time, after that time has passed, the client will have to ask for a new IP.
      max-lease-time 1814400;
# If you need any PC to have a fixed IP, let's say the printer server.
       host printer {
           next-server printer.alketech.com;
           hardware ethernet 00:08:a1:82:00:11;
           fixed-address 10.1.1.51;
    }
Ejemplo de proxy.pac

function FindProxyForURL(url, host) {
      // our local URLs from the domains below example.com don't need a proxy:
      if (shExpMatch(url,"*.example.com/*"))                  {return "DIRECT";}
      if (shExpMatch(url, "*.example.com:*/*"))               {return "DIRECT";}

      // URLs within this network are accessed through
      // port 8080 on fastproxy.example.com:
      if (isInNet(host, "10.0.0.0",  "255.255.248.0"))    {
         return "PROXY fastproxy.example.com:8080";
      }

      // All other requests go through port 8080 of proxy.example.com.
      // should that fail to respond, go directly to the WWW:
      return "PROXY proxy.example.com:8080; DIRECT";
   }

Back Top

0 comentarios:

Publicar un comentario