Networking Forums

Networking Forums > Computer Networking > Linux Networking > ISC DHCP - Two subnets on one physical interface.

Reply
Thread Tools Display Modes

ISC DHCP - Two subnets on one physical interface.

 
 
Dan
Guest
Posts: n/a

 
      07-31-2007, 02:56 PM
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;}
}

 
Reply With Quote
 
 
 
 
Philippe WEILL
Guest
Posts: n/a

 
      07-31-2007, 03:59 PM


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

 
Reply With Quote
 
Dan
Guest
Posts: n/a

 
      07-31-2007, 06:48 PM
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 With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
DHCP not binding to physical connection Bilal Windows Networking 0 08-27-2007 12:34 PM
Two subnets on one interface with no VLANs Jonathan Ross Linux Networking 6 01-13-2007 09:39 AM
one physical interface, 3 virtual interfaces, and inetd CptDondo Linux Networking 1 11-16-2006 07:54 PM
DHCP 2 Subnets 2 Physical Locations JBLaze Windows Networking 1 06-23-2005 04:05 PM
Linux API to create logical interface on a physical interface? Zarko Coklin Linux Networking 2 07-18-2004 01:50 AM



1 2 3 4 5 6 7 8 9 10 11