
log-facility local7;
######################################################################
# In addition to setting this value, you may need to modify your 
# syslog.conf file to configure logging of the DHCP server. 
# For example, you might add a line like this: 
# local7.*      /val/log/dhcpd.log
# local7.info   @192.168.2.199
######################################################################

authoritative;
server-name "DSL_DHCP";
ddns-update-style none;

#Logging stuff



if exists agent.circuit-id
{
	log ( info, concat( 
	">>Lease for ",binary-to-ascii(10, 8, ".", leased-address), 
	" raw option-82 info is CID: ",binary-to-ascii(10, 8, ".", option agent.circuit-id), 
	" AID: ",binary-to-ascii(16, 8, ".", option agent.remote-id)
	 ));
}

on commit
{
      log (info, concat( 
      "Lease granted for ",binary-to-ascii(10, 8, ".", leased-address),
      " is associated to iMAP ",(option agent.remote-id),
      " interface ",binary-to-ascii(10, 8, ".", substring(option agent.circuit-id, 0, 2)),
      ", using VLAN ",binary-to-ascii(10, 16, "", substring(option agent.circuit-id, 2, 2))
      ));
}

on expiry 
{
      log (info, concat(
      "Lease for ",binary-to-ascii(10, 8, ".", leased-address),
      " has expired for MAC ",binary-to-ascii(16,8,":",hardware)));
}


on release 
{
      log (info, concat(
      "Release for ",binary-to-ascii(10, 8, ".", leased-address),
      " from MAC ",binary-to-ascii(16,8,":",hardware)));
}

class "RegionX-RGMGMT-CPE-MODELx" {
        match if ( substring (option agent.remote-id,0,11)="RegionXyxtu")
        and ( substring (option agent.circuit-id,2,2)="\x01\x2C" )
        # Vlan 300
       and ( option vendor-class-identifier="CPE-MODELx" );
       option vendor-class-identifier "CPE-MODELx";
}


class "RegionX-BOOT-CPE-MODELx" {
        match if ( substring (option agent.remote-id,0,11)="RegionXyxtu" )
                #<--DHCP RemoteID prefix for iMAP's in AI
        and ( substring (option agent.circuit-id,2,2)="\x00\xC8" )
                # VLAN 200 See Note 1
        and ( option vendor-class-identifier="CPE-MODELx" );
        option tftp-server-name "10.1.150.10";
        option vendor-class-identifier "CPE-MODELx";
        filename "ADSL/CPE-MODELx";
}

class "RegionX-INET" {
	match if ( substring (option agent.remote-id,0,11)="RegionX" )
	and ( substring (option agent.circuit-id,2,2)="\x01\xF4" );
}

shared-network RegionX {
# Declaration for local subnet
subnet 10.24.8.0 netmask 255.255.254.0 {
}

# network where I am originating test queries from
subnet 192.168.188.0 netmask 255.255.255.0 {
}

# network containing shelf managers:
subnet 10.111.160.0 netmask 255.255.224.0 {
}


# RGMGMT
subnet 10.111.0.0 netmask 255.255.252.0 {
        option routers 10.111.0.1;
        option subnet-mask 255.255.252.0;
        option broadcast-address 10.111.3.255;
        pool { 
                deny dynamic bootp clients;
                authoritative;
                allow members of "RegionX-RGMGMT-CPE-MODELx";
                range 10.111.0.2 10.111.3.254;
                default-lease-time 86400;
                max-lease-time 86400;
        }
}

# Bootstrap
subnet 10.111.128.0 netmask 255.255.255.0 {
        option routers 10.111.128.1;
        option subnet-mask 255.255.255.0;
        option broadcast-address 10.111.128.255;
        pool {
                deny dynamic bootp clients;
                authoritative;
		allow members of "RegionX-BOOT-CPE-MODELx";
                range 10.111.128.2 10.111.128.254;
                default-lease-time 86400;
                max-lease-time 86400;
        }
}

# Inet
subnet 192.168.244.0 netmask 255.255.255.0{
	option routers 192.168.240.1;
	option subnet-mask 255.255.255.0;
	option broadcast-address 192.168.240.255;
	option domain-name-servers 8.8.8.8, 4.4.4.4;
	pool {
		deny dynamic bootp clients;
		authoritative;
		allow members of "RegionX-INET";
		range 192.168.240.128 192.168.240.254;
                default-lease-time 86400;
                max-lease-time 86400;
	}
}

}
