#
# Sample configuration file for ISC dhcpd for Debian
#
# $Id: dhcpd.conf,v 1.1.1.1 2002/05/21 00:07:44 peloy Exp $
#
# The ddns-updates-style parameter controls whether or not the server will
# attempt to do a DNS update when a lease is confirmed. We default to the
# behavior of the version 2 packages ('none', since DHCP v2 didn't
# have support for DDNS.)

# ARE YOU HERE TO CONFIGURE NETBOOT FOR A HOST?
# You don't need to copy the files to caffeine's TFTP server and choose that
# distro here anymore. See http://wiki.csclub.uwaterloo.ca/Netboot.
#
# Just make sure the generic menu bootloader is selected as the filename
# for that host, and that the menu has been updated to include the distro
# you want to install.
#
# This reduces effort from O(mn) to O(m+n).

# mac is insane
option mac-nc-client-unknown code 220 = string;
option mac-nc-client-id code 221 = string;
option mac-version code 230 = string;
option mac-username code 232 = text;
option mac-password code 233 = text;
option mac-nb-img code 234 = string;
option mac-apps-img code 235 = string;
option mac-machine-name code 237 = text;
option mac-client-nb-img code 238 = string;

#PXE options
option pxemagic   code 209 = string;
option configfile code 209 = text;
option pathprefix code 210 = text;
option arch code 93 = unsigned integer 16;

# 129.97.134.41: CSC NTP (currently hosted on ranch since it will serve time-critical NFS)
# 129.96.129.9:  ntp.uwaterloo.ca
option ntp-servers 129.97.134.41, 129.97.129.9;

# option definitions common to all supported networks...
option domain-name "csclub.uwaterloo.ca";
option domain-search "csclub.uwaterloo.ca", "uwaterloo.ca";
option domain-name-servers 129.97.134.4, 129.97.18.20, 129.97.2.1, 129.97.2.2;
#option domain-name-servers 129.97.2.1, 129.97.2.2;
                           # IPv6: [2620:101:f000:401::9], [2620:101:f000:401::11];

default-lease-time 600;
max-lease-time 43200;
log-facility local7;

allow booting;
allow bootp;

authoritative;

# PXE options
next-server 129.97.134.17;

if exists user-class and option user-class = "iPXE" {
   filename "menu/menu.ipxe";
} else {
   if option arch != 0 {
      #filename "menu/ipxe.efi";
      filename "menu/undionly.kpxe";

      # Enable if you need secure boot support (only supports tftp loading)
      # filename "grub/grubnetx64.efi.signed";
   } else {
      filename "menu/undionly.kpxe";
   }
}

####################################################
# SUBNETS
####################################################

# MC VLAN 134 (129.97.134.0/24)
# mso
subnet 129.97.134.0 netmask 255.255.255.0 {
   range 129.97.134.150 129.97.134.159;
   option routers 129.97.134.1;
   option broadcast-address 129.97.134.255;
}

# MC VLAN 427 (129.97.31.128/26)
# mso-user
subnet 129.97.31.128 netmask 255.255.255.192 {
   range 129.97.31.170 129.97.31.190;
   option routers 129.97.31.129;
   option broadcast-address 129.97.31.191;
}

# MC VLAN 520 (10.15.134.0/24)
# mso-private
subnet 10.15.134.0 netmask 255.255.255.0 {
   option routers 10.15.134.254;
   option broadcast-address 10.15.134.255;
}

# MC VLAN 521 (172.19.4.96/28)
# mso-private2 (Printers, IOT)
subnet 172.19.4.96 netmask 255.255.255.240 {
   option routers 172.19.4.97;
   option broadcast-address 172.19.4.111;
}

# PHYS VLAN 506 - 129.97.18.16/28
# csc-data1
subnet 129.97.18.16 netmask 255.255.255.240 {
   option routers 129.97.18.17;
   option broadcast-address 129.97.18.31;
}

# MC VLAN 529 (172.19.168.0/27)
# csc-cloudmgmt
subnet 172.19.168.0 netmask 255.255.255.224 {
  option routers 172.19.168.1;
  option broadcast-address 172.19.168.31;
}

# MC VLAN 530 (172.19.168.32/27)
# csc-storage
subnet 172.19.168.32 netmask 255.255.255.224 {
  option routers 172.19.168.33;
  option broadcast-address 172.19.168.63;
}

####################################################
# HOSTS
####################################################

# Computer Science Club
group {
   option domain-name      "cloud.csclub.uwaterloo.ca";
   default-lease-time 43200;
   max-lease-time 86400;

   host db1 {
      hardware ethernet     52:54:00:e0:5a:fa;
      #fixed-address         172.19.168.4;
      fixed-address         10.15.134.51;
   }

  host network-test {
      hardware ethernet     52:54:00:fc:9b:5c;
      fixed-address         172.19.168.35;
   }

   host controller1 {
      hardware ethernet     52:54:00:e0:b5:c1;
      # fixed-address         10.15.134.50;
      fixed-address         172.19.168.6;
   }

   host compute1 {
      hardware ethernet     52:54:00:6f:e3:e8;
      fixed-address         10.15.134.55;
   }

   host compute2 {
      hardware ethernet     52:54:00:20:91:2f;
      fixed-address         10.15.134.56;
   }

   host network1 {
      hardware ethernet     52:54:00:87:2e:3d;
      fixed-address         10.15.134.60;
   }

   host block1 {
      hardware  ethernet    52:54:00:63:36:0d;
      fixed-address         10.15.134.52;
   }

   host object1 {
      hardware ethernet     52:54:00:30:37:35;
      fixed-address         172.19.168.10;
   }

   host router1 {
      hardware ethernet     52:54:00:a4:c0:67;
      fixed-address         172.19.134.253;
   }

   #host tahini {
   #   hardware ethernet 7c:c2:55:ad:92:0a;
   #   fixed-address 172.19.168.18;
   #}
}

group {
   option domain-name      "csclub.uwaterloo.ca";
   default-lease-time 43200;
   max-lease-time 86400;

   host identity {
      hardware ethernet    52:54:00:37:00:9d;
      fixed-address        129.97.134.9;
   }

   # Servers
   host auth2 {
      hardware ethernet    c2:c0:00:00:00:a2;
      fixed-address        129.97.18.19;
   }

   host biloba {
     hardware ethernet     AC:1F:6B:0B:CA:6C;
     fixed-address         172.19.168.23;
     if exists user-class and option user-class = "iPXE" {
        filename "menu/menu.ipxe";
     } else {
        filename "ipxe.efi";
     }
   }

   host citric-acid {
      hardware ethernet    00:25:64:FD:5D:E9;
      fixed-address        129.97.134.33;
   }

   host citric-acid-ipmi {
      hardware ethernet    00:25:64:fd:5d:f1;
      fixed-address        10.15.134.33;
   }

   host chamomile { 
       hardware ethernet b2:d3:85:5f:8d:23;
       fixed-address     129.97.134.39;
   }

   #host tahini {
   #     hardware ethernet   7c:c2:55:ad:92:0a;
   #    fixed-address       129.97.31.132;
   #}

   host cobalamin {
      hardware ethernet    00:1e:c9:de:e8:44;
      fixed-address        129.97.18.18;
   }

   host coffee {
      hardware ethernet    52:54:00:e3:25:b4;
      fixed-address        129.97.134.20;
   }

   host corn-syrup {
      hardware ethernet    00:24:e8:52:41:27;
      fixed-address        129.97.134.72;
   }

   host ginkgo {
      hardware ethernet    0c:c4:7a:d8:9f:9a;
      fixed-address        129.97.134.24;
   }

   host guayusa {
      hardware ethernet    b8:ac:6f:0f:ad:c8;
      fixed-address        129.97.134.133;
   }

   host high-fructose-corn-syrup {
      hardware ethernet    00:25:90:58:a4:e4;
      fixed-address        129.97.134.129;
   }

   host os-block {
      hardware ethernet    52:54:00:61:65:56;
      fixed-address        10.15.134.171;
   }

   host os-compute1 {
      hardware ethernet    52:54:00:25:72:99;
      fixed-address        10.15.134.173;
   }

   host os-controller {
      hardware ethernet    52:54:00:f6:cc:50;
      fixed-address        10.15.134.170;
   }

   host os-object1 {
      hardware ethernet    52:54:00:db:4f:21;
      fixed-address        10.15.134.172;
   }

   host potassium-benzoate {
      hardware ethernet    0c:c4:7a:34:dc:22;
      fixed-address        10.15.134.71;
   }

   host potassium-citrate {
      hardware ethernet    00:02:56:00:0a:ca;
      fixed-address        129.97.134.69;
      filename             "lenny-alpha/boot.img";
   }

   host sodium-benzoate {
      hardware ethernet    a0:36:9f:1a:30:30;
      fixed-address        129.97.134.42;
      if exists user-class and option user-class = "iPXE" {
          #filename "menu/ubuntu.ipxe";
          filename "menu/archlinux.ipxe";
      } else {
          filename "menu/undionly.kpxe";
      }
   }

   host yerba-mate {
      hardware ethernet    00:18:8b:2f:3c:b0;
      fixed-address        129.97.134.132;
   }

   host carbonated-water {
      hardware ethernet   00:1b:21:a2:22:74;
      fixed-address       129.97.134.32;
  }

   host carbonated-water-private {
      hardware ethernet   f0:4d:a2:40:bd:0a;
      fixed-address       10.15.134.250;
   }

   # Office Terminals
   host bit-shifter {
      hardware ethernet    1c:1b:0d:f8:83:fd;
      fixed-address        129.97.31.133;
   }

   host gwem {
      hardware ethernet    00:d8:61:15:be:1e;
      fixed-address        129.97.31.131;
   }

   host maltodextrin {
      hardware ethernet    e0:3f:49:14:aa:ec;
      fixed-address        129.97.31.134;
   }

   host natural-flavours {
      # hardware ethernet    00:18:f3:74:5b:75 # built-in card
      # hardware ethernet    68:05:ca:01:32:b8; # old natural-flavours
      hardware ethernet    4c:cc:6a:69:38:db;
      fixed-address        129.97.31.136;
   }

   #host nullsleep {
   #   hardware ethernet    90:e6:ba:97:4b:a3;
   #   fixed-address        129.97.31.135;
   #}

   host powernap {
      #hardware ethernet    38:c9:86:5a:88:04; # Internal NIC, have hardware problem
      hardware ethernet    44:f0:9e:ab:e0:0c; # External Thunderbolt to Ethernet dongle
      fixed-address        129.97.31.135;
   }

   #host strombola {
   #   hardware ethernet    1c:1b:0d:f8:7d:8e;
   #   fixed-address        129.97.31.132;
   #}

   # Test machines
   #host testnode1 {
   #   hardware ethernet    b8:ac:6f:0f:ad:c8;
   #   fixed-address        129.97.134.141;
   #}

   #host sandstorm {
   #    hardware ethernet    52:54:00:0c:28:c0;
   #    fixed-address        129.97.134.33;
   #}

   host sorbitol {
	hardware ethernet   00:02:c9:52:ea:a0;
	fixed-address       129.97.134.137;
   }

   host tahini {
        hardware ethernet   7c:c2:55:ad:92:0a;
	fixed-address	    129.97.134.130;
   }

#   host chamomile { 
#	hardware ethernet b2:d3:85:5f:8d;
#	fixed-address     129.97.134.39;
#   }

    host ranch {
    	hardware ethernet   f4:52:14:f8:50:30;
	    fixed-address	    129.97.134.41;
    }

}

# CSC Island
group {
  use-host-decl-names on;

  if exists user-class and option user-class = "iPXE" {
    filename "menu/island/node.ipxe";
  } else {
    filename "menu/undionly.kpxe";
  }

  host island-master {
    hardware ethernet     52:54:00:eb:ba:92;
    fixed-address         129.97.134.160;

    if exists user-class and option user-class = "iPXE" {
        filename "menu/island/master.ipxe";
    } else {
        filename "menu/undionly.kpxe";
    }
  }

  host island-node1 {
    hardware ethernet     52:54:00:02:6e:3f;
    fixed-address         129.97.134.161;
  }

  host island-node2 {
    hardware ethernet     52:54:00:cb:61:11;
    fixed-address         129.97.134.162;
  }

  host island-storage {
    hardware ethernet     52:54:00:99:02:0f;
    fixed-address         129.97.134.166;

    if exists user-class and option user-class = "iPXE" {
        filename "menu/menu.ipxe";
    } else {
        filename "menu/undionly.kpxe";
    }
  }
}

# MathSoc
group {
   option domain-name     "mathsoc.uwaterloo.ca";

   host win7-pc {
      hardware ethernet    e0:cb:4e:9a:04:c7;
      fixed-address        129.97.134.21;
   }

   host exec-pc {
      hardware ethernet    10:bf:48:d5:cf:8b;
      fixed-address        129.97.134.23;
   }

   host lp-mc3038 {
      hardware ethernet    3C:2A:F4:20:87:3C;
      fixed-address        172.19.4.99;
   }

   host printer-2025 {
	hardware ethernet 94:dd:f8:62:65:83;
	fixed-address     172.19.4.100; 
   }

   # some host in mathsoc without a name
   host unknown {
      hardware ethernet   00:16:cb:8a:7f:e9;
      fixed-address       129.97.134.108;
   }

   host mc-3038-versalink {
      hardware ethernet   9C:93:4E:69:31:A0;
      fixed-address       172.19.4.101;
   }

   host mathsocs-mini {
      hardware ethernet   78:7b:8a:cf:55:e4;
      fixed-address       129.97.134.101;
   }

   host mathnews-gridword {
     hardware ethernet    AC:9E:17:B4:2D:B0;
     fixed-address        129.97.31.169;
   }
   
   host mathnews-blackbox {
     hardware ethernet    9C:6B:00:08:B5:8D;
     fixed-address        129.97.31.168;
   }

   host MathSocs-Mini {
     hardware ethernet    5c:1b:f4:97:e3:cf;
     fixed-address	  129.97.134.151;
   }

}

