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;}
}

.



Relevant Pages

  • ISC DHCP - Two subnets on one physical interface.
    ... I'm having some trouble trying to get dhcp to serve two subnets on one ... making the subnet declaration 10.0.0.0/16. ... of the guest network. ... # don't let clients update A records for ddns ...
    (comp.os.linux.networking)
  • RE: Need advice on Debian Hotspot
    ... eth0 is WAN and eth1 is LAN. ... subnet 192.168.0.0 netmask 255.255.255.0 { ... option broadcast-address your.broad.add.here; ... option routers your.defaul.gateway.here; ...
    (Debian-User)
  • Re: Renewing IP Addresses of Clients
    ... subnet, I would have expected the PC to get a new IP ... subnet 10.11.1.0 netmask 255.255.255.0 { ... option broadcast-address 10.11.1.255; ... option routers 10.11.1.1; ...
    (uk.comp.os.linux)
  • Re: DHCP and several ROUTERS problem
    ... option routers 10.10.2.1; ... option domain-name-servers 192.168.49.101; ... No subnet declaration for eth1. ...
    (comp.os.linux.networking)
  • Re: DHCP and several ROUTERS problem
    ... >My network configuration is: ... >With static IP addresses for each subnet everything works fine. ... > match option routers; ...
    (comp.os.linux.networking)