ISC DHCP - Two subnets on one physical interface. - Networking

This is a discussion on ISC DHCP - Two subnets on one physical interface. - Networking ; I'm having some trouble trying to get dhcp to serve two subnets on one interface. The first is 10.0.0.0/24 which is for office workstations and equipment. Everyone in here is assigned a static ip via mac address. The second is ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: ISC DHCP - Two subnets on one physical interface.

  1. ISC DHCP - Two subnets on one physical interface.

    I'm having some trouble trying to get dhcp to serve two subnets on one
    interface.
    The first is 10.0.0.0/24 which is for office workstations and
    equipment. Everyone in here is assigned a static ip via mac address.
    The second is a 'guest' network which is 10.0.10.0/24.

    I was able to get dhcp to assign the ip address for both subnets by
    making the subnet declaration 10.0.0.0/16. The problem is that there
    are other settings that need to be set like the default route, dns,
    netmask, etc.

    In my first attempt, I made a pool and set all the settings to be that
    of the guest network. I would then override those settings in the
    host declarations for the office equipment. The problem is that it
    didn't like having options such as routers,domain-name-servers, etc in
    the host declarations.

    Does anyone know how I can do this without a second NIC?

    Below is my current config.
    ################ Current Config #################
    max-lease-time 86400;
    default-lease-time 14400;
    ddns-update-style interim;

    log-facility local4;

    subnet 10.0.0.0 netmask 255.255.0.0 {
    authoratative;
    range 10.0.10.10 10.0.10.250; ## Guest Network

    # don't let clients update A records for ddns
    ignore client-updates;

    # options
    option subnet-mask 255.255.255.0;
    option broadcast-address 10.0.0.255;

    option domain-name "domain.tld";
    #option domain-name-servers 65.106.1.196,65.106.7.196;
    #option routers 10.0.10.1;
    option domain-name-servers 10.0.0.225;
    option routers 10.0.0.1;

    option ntp-servers 10.0.0.250;

    option netbios-scope "";
    option netbios-node-type 8;

    host ws1 {hardware ethernet 00:13:21:d0:3f:0b;fixed-address 10.0.0.3;}
    host ws2 {hardware ethernet 00:0d:9d:4c:94:4d;fixed-address 10.0.0.5;}
    host ws3 {hardware ethernet 00:0d:9d:4b:35:bd;fixed-address 10.0.0.6;}
    host ws4 {hardware ethernet 00:0b:cd:c3:ee:03;fixed-address 10.0.0.7;}
    }
    ########################################

    The following is what I would have liked to set up. Understandably
    the following won't work because the two networks are not physically
    separated, and there is only one NIC available for dhcp.


    max-lease-time 86400;
    default-lease-time 14400;
    ddns-update-style interim;

    log-facility local4;

    subnet 10.0.10.0 netmask 255.255.255.0 {
    authoratative;
    range 10.0.10.10 10.0.10.250; ## Guest Network

    # don't let clients update A records for ddns
    ignore client-updates;

    # options
    option subnet-mask 255.255.255.0;
    option broadcast-address 10.0.10.255;

    option domain-name "guest.domain.tld";
    option domain-name-servers 65.106.1.196,65.106.7.196;
    option routers 10.0.10.1;
    }


    subnet 10.0.0.0 netmask 255.255.255.0 {
    authoratative;

    # don't let clients update A records for ddns
    ignore client-updates;

    # options
    option subnet-mask 255.255.255.0;
    option broadcast-address 10.0.0.255;

    option domain-name "domain.tld";
    option domain-name-servers 10.0.0.225;
    option routers 10.0.0.1;

    option ntp-servers 10.0.0.250;

    option netbios-scope "";
    option netbios-node-type 8;

    host ws1 {hardware ethernet 00:13:21:d0:3f:0b;fixed-address 10.0.0.3;}
    host ws2 {hardware ethernet 00:0d:9d:4c:94:4d;fixed-address 10.0.0.5;}
    host ws3 {hardware ethernet 00:0d:9d:4b:35:bd;fixed-address 10.0.0.6;}
    host ws4 {hardware ethernet 00:0b:cd:c3:ee:03;fixed-address 10.0.0.7;}
    }


  2. Re: ISC DHCP - Two subnets on one physical interface.



    Dan wrote:
    > I'm having some trouble trying to get dhcp to serve two subnets on one
    > interface.
    > The first is 10.0.0.0/24 which is for office workstations and
    > equipment. Everyone in here is assigned a static ip via mac address.
    > The second is a 'guest' network which is 10.0.10.0/24.
    >
    > I was able to get dhcp to assign the ip address for both subnets by
    > making the subnet declaration 10.0.0.0/16. The problem is that there
    > are other settings that need to be set like the default route, dns,
    > netmask, etc.
    >
    > In my first attempt, I made a pool and set all the settings to be that
    > of the guest network. I would then override those settings in the
    > host declarations for the office equipment. The problem is that it
    > didn't like having options such as routers,domain-name-servers, etc in
    > the host declarations.
    >
    > Does anyone know how I can do this without a second NIC?




    man dhcpd.conf

    see shared-network

    it's what's you need


    >
    > Below is my current config.
    > ################ Current Config #################
    > max-lease-time 86400;
    > default-lease-time 14400;
    > ddns-update-style interim;
    >
    > log-facility local4;
    >
    > subnet 10.0.0.0 netmask 255.255.0.0 {
    > authoratative;
    > range 10.0.10.10 10.0.10.250; ## Guest Network
    >
    > # don't let clients update A records for ddns
    > ignore client-updates;
    >
    > # options
    > option subnet-mask 255.255.255.0;
    > option broadcast-address 10.0.0.255;
    >
    > option domain-name "domain.tld";
    > #option domain-name-servers 65.106.1.196,65.106.7.196;
    > #option routers 10.0.10.1;
    > option domain-name-servers 10.0.0.225;
    > option routers 10.0.0.1;
    >
    > option ntp-servers 10.0.0.250;
    >
    > option netbios-scope "";
    > option netbios-node-type 8;
    >
    > host ws1 {hardware ethernet 00:13:21:d0:3f:0b;fixed-address 10.0.0.3;}
    > host ws2 {hardware ethernet 00:0d:9d:4c:94:4d;fixed-address 10.0.0.5;}
    > host ws3 {hardware ethernet 00:0d:9d:4b:35:bd;fixed-address 10.0.0.6;}
    > host ws4 {hardware ethernet 00:0b:cd:c3:ee:03;fixed-address 10.0.0.7;}
    > }
    > ########################################
    >
    > The following is what I would have liked to set up. Understandably
    > the following won't work because the two networks are not physically
    > separated, and there is only one NIC available for dhcp.
    >
    >
    > max-lease-time 86400;
    > default-lease-time 14400;
    > ddns-update-style interim;
    >
    > log-facility local4;
    >
    > subnet 10.0.10.0 netmask 255.255.255.0 {
    > authoratative;
    > range 10.0.10.10 10.0.10.250; ## Guest Network
    >
    > # don't let clients update A records for ddns
    > ignore client-updates;
    >
    > # options
    > option subnet-mask 255.255.255.0;
    > option broadcast-address 10.0.10.255;
    >
    > option domain-name "guest.domain.tld";
    > option domain-name-servers 65.106.1.196,65.106.7.196;
    > option routers 10.0.10.1;
    > }
    >
    >
    > subnet 10.0.0.0 netmask 255.255.255.0 {
    > authoratative;
    >
    > # don't let clients update A records for ddns
    > ignore client-updates;
    >
    > # options
    > option subnet-mask 255.255.255.0;
    > option broadcast-address 10.0.0.255;
    >
    > option domain-name "domain.tld";
    > option domain-name-servers 10.0.0.225;
    > option routers 10.0.0.1;
    >
    > option ntp-servers 10.0.0.250;
    >
    > option netbios-scope "";
    > option netbios-node-type 8;
    >
    > host ws1 {hardware ethernet 00:13:21:d0:3f:0b;fixed-address 10.0.0.3;}
    > host ws2 {hardware ethernet 00:0d:9d:4c:94:4d;fixed-address 10.0.0.5;}
    > host ws3 {hardware ethernet 00:0d:9d:4b:35:bd;fixed-address 10.0.0.6;}
    > host ws4 {hardware ethernet 00:0b:cd:c3:ee:03;fixed-address 10.0.0.7;}
    > }
    >


  3. Re: ISC DHCP - Two subnets on one physical interface.

    Thank you. I don't know how I missed that in the man page. It was the
    first thing I saw when I opened it. I think I got a little thrown off
    when I saw so many sources (including isc's web page in certain
    places) saying that you need 2 physical interfaces, but I knew it
    could be done somehow.

    For those who would like to see the working config.


    max-lease-time 86400;
    default-lease-time 14400;
    ddns-update-style interim;

    log-facility local4;

    shared-network drlan {

    subnet 10.0.10.0 netmask 255.255.255.0 {
    authoratative;
    range 10.0.10.10 10.0.10.250; ## Guest Network

    # don't let clients update A records for ddns
    ignore client-updates;

    # options
    option subnet-mask 255.255.255.0;
    option broadcast-address 10.0.10.255;

    option domain-name "guest.domain.tld";
    option domain-name-servers 65.106.1.196,65.106.7.196;
    option routers 10.0.10.1;

    host guest-conference-room {hardware ethernet
    00:19:bb:d7:fe:d7;fixed-address 10.0.10.2;}
    }

    subnet 10.0.0.0 netmask 255.255.255.0 {
    authoratative;

    option subnet-mask 255.255.255.0;
    option broadcast-address 10.0.0.255;

    option domain-name "domain.domain.tld";
    option domain-name-servers 10.0.0.225;
    option routers 10.0.0.1;

    option ntp-servers 10.0.0.250;

    host office-ws1 {hardware ethernet 00:0d:9d:4c:
    94:4d;fixed-address 10.0.0.5;}

    }
    }


+ Reply to Thread