Dhcp

From My Mnemonic Rhyme
Revision as of 09:55, 18 February 2012 by >Homaar
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

/etc/dhcp/dhcpd.conf

ddns-update-style none;
authoritative;
log-facility local7;
option wpad code 252 = text;

subnet 192.168.12.0 netmask 255.255.255.0 {
        default-lease-time 600;
        max-lease-time 7200;
#       range 192.168.12.20 192.168.12.40;
        option subnet-mask 255.255.255.0;
        option broadcast-address 192.168.12.255;
        option routers 192.168.12.10;
        option domain-name "Arbeitsgruppe";
        option domain-name-servers 192.168.12.10;
        option wpad "http://192.168.12.10/wpad.dat";
}

# Rechner mit fester IP
#------------------------------------------
group ThinClient{

    default-lease-time 604800;
    max-lease-time 604800;

    host OWClient07 {
        hardware ethernet 9c:8e:99:d7:d9:37;
        fixed-address 192.168.12.107;
        option host-name "OWClient07";
    }
    host OWClient08 {
        hardware ethernet 9c:8e:99:d7:32:13;
        fixed-address 192.168.12.108;
        option host-name "OWClient08";
    }
    host OWClient09 {
        hardware ethernet 9c:8e:99:d7:da:a1;
        fixed-address 192.168.12.109;
        option host-name "OWClient09";
    }
    host OWClient10 {
        hardware ethernet 9c:8e:99:d7:da:a0;
        fixed-address 192.168.12.110;
        option host-name "OWClient10";
    }
    host OWClient11 {
        hardware ethernet 9c:8e:99:d7:a7:2d;
        fixed-address 192.168.12.111;
        option host-name "OWClient11";
    }
    host OWClient12 {
        hardware ethernet 9c:8e:99:d7:da:a3;
        fixed-address 192.168.12.112;
        option host-name "OWClient12";
    }
}

/var/www/wpad.dat

function FindProxyForURL(url, host)
{
  lurl = url.toLowerCase();
  if (
       (lurl.substring(0, 5) == "http:") ||
       (lurl.substring(0, 4) == "ftp:" ) ||
       (lurl.substring(0, 6) == "https:")
      )

      if (
           isPlainHostName(host) ||
           isInNet(host, "192.168.4.0","255.255.255.0") ||
           (host.substring(0, 4) == "127.")
        )
         return "DIRECT";
       else
         return "PROXY 192.168.4.10:3128";
    else
      return "DIRECT";
}