Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

How can I have 2 subnets (net1 and net2), one that alloweds all and the other only allowes selected hosts based on mac address?

Here is my dhcpd.conf

ddns-update-style none;
log-facility local7;
not authoritative;


# DNS UPDATE SECURITY 
key DHCP_UPDATER {
    algorithm HMAC-MD5.SIG-ALG.REG.INT;
    secret asdfasdfasdfasdfasdfasdf==;
};
zone mydomain.com. {
    primary 127.0.0.1;
    key DHCP_UPDATER;
}
zone 17.127.10.in-addr.arpa. {
    primary 127.0.0.1;
    key DHCP_UPDATER;
}


# class
class "Net2-fixed-class" {
    match pick-first-value (option dhcp-client-identifier, hardware);
}
    subclass "Net2-fixed-class" 1:00:26:2D:AE:94:F7;
    subclass "Net2-fixed-class" 1:70:F1:A1:6A:70:CC;
    subclass "Net2-fixed-class" 1:00:16:D4:43:44:6C;
    subclass "Net2-fixed-class" 1:00:13:02:e3:fb:45;
    subclass "Net2-fixed-class" 1:00:26:5c:ff:81:da;
    subclass "Net2-fixed-class" 1:00:21:19:98:c5:52; 


# Net1 subnet (Allowed All and deny selected hosts based on mac address)
subnet 10.0.0.0 netmask 255.255.255.192 {
        option routers                  10.0.0.1;
        option subnet-mask              255.255.255.192;
        option broadcast-address        10.0.0.63;
        option domain-name-servers      8.8.8.8,8.8.4.4;
        option domain-name              "net1"; 
        option ntp-servers              10.0.0.1;
        option netbios-name-servers     10.0.0.1;
        option netbios-node-type 2;
        default-lease-time 600;
        max-lease-time 7200;
        pool {
            range 10.0.0.10 10.0.0.62;
        }
}


# Net2 subnet  (only allowed selected hosts based on mac address)
subnet 10.0.1.0 netmask 255.255.255.224 {
    #range              10.0.1.1 10.0.1.30;
    option routers                  10.0.1.1,10.0.1.2;
    option subnet-mask              255.255.255.224;
    option broadcast-address        10.0.1.31;
    option domain-name      "mydomain.com"; 
    option domain-name-servers      10.0.1.1,10.0.1.2;
    option ntp-servers              10.0.1.1,10.0.1.2;
    option netbios-name-servers     10.0.1.1,10.0.1.2;
    option netbios-node-type 2;
    default-lease-time 600;
    max-lease-time 7200;

    deny unknown-clients;

    group { 
        host pc1 {
            hardware ethernet 70:F1:A1:6A:70:CC;
            fixed-address 10.0.1.11;
        }    
        host pc2 {
            hardware ethernet 00:26:2D:AE:94:F7;
            fixed-address 10.0.1.12;
        }    
        host pc3 {
            hardware ethernet 00:16:D4:43:44:6C;
            fixed-address 10.0.1.13;
        }
        host pc4 {
            hardware ethernet 00:13:02:e3:fb:45;
            fixed-address 10.0.1.14;
        }           
        host pc5 {
            hardware ethernet 00:26:5c:ff:81:da;
            fixed-address 10.0.1.15;
        }    
        host pc6 {
            hardware ethernet 00:21:19:98:c5:52;
            fixed-address 10.0.1.16;
        }   
    }
}

This configuration work fine. However, I keep receiving

Jun  5 01:20:27 localhost dhcpd: DHCPDISCOVER from 00:24:9f:92:7e:a6 via eth1: network 10.0.1.0/27: no free leases
Jun  5 01:23:00 localhost dhcpd: DHCPDISCOVER from e0:f8:47:a2:4a:f6 via eth1: network 10.0.1.0/27: no free leases
Jun  5 01:26:07 localhost dhcpd: DHCPDISCOVER from 00:24:9f:92:7e:a6 via eth1: network 10.0.1.0/27: no free leases
Jun  5 01:26:08 localhost dhcpd: DHCPDISCOVER from 00:24:9f:92:7e:a6 via eth1: network 10.0.1.0/27: no free leases
Jun  5 01:38:23 localhost dhcpd: DHCPDISCOVER from 2c:a8:35:22:04:46 via eth1: network 10.0.1.0/27: no free leases
Jun  5 01:51:48 localhost dhcpd: DHCPDISCOVER from 2c:a8:35:22:04:46 via eth1: network 10.0.1.0/27: no free leases

Any help would be much appreciated.

share|improve this question
    
Is there a reason you have no range on the 10.0.1.0/27 subnet? –  Chris S Jun 5 '11 at 1:28
    
@Chris - i did used range but it did not help. and i start receiving Jun 4 06:24:24 localhost dhcpd: Dynamic and static leases present for 10.0.1.14. Jun 4 06:24:24 localhost dhcpd: Remove host declaration pc4 or remove 10.0.1.14 Jun 4 06:24:24 localhost dhcpd: from the dynamic address pool for 10.0.1.0/28 –  Flan Alflani Jun 5 '11 at 2:37
    
are there leases for the 10.0.1.0/27 range already existing? If so they'd have to match your host reservations or you'd have to remove the stale lease. –  Chris S Jun 5 '11 at 3:43
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.