One DHCP Server, Multiple Subnets
Simon Hobson
dhcp1 at thehobsons.co.uk
Thu Feb 4 19:20:22 UTC 2010
Shaun R wrote:
>I have a network (VLAN) that has many /26 subnets attached to it. I
>am trying to run a DHCP server that will awnser dhcp requests for
>all subnets on this network. I dont have a free ip pool in my dhcp
>config, i assign each server it's IP using it's mac address. The
>problem i'm seeing is that if a machine in a different subnet from
>the subnet the dhcp server is running on asks for a ip it shoes the
>following.
>
>Feb 4 09:35:21 host dhcpd: DHCPREQUEST for 10.82.117.197 from
>fe:fd:d0:52:75:c5 via eth0: wrong network.
>Feb 4 09:35:21 host dhcpd: DHCPNAK on 10.82.117.197 to
>fe:fd:d0:52:75:c5 via eth0
>Feb 4 09:35:27 host dhcpd: DHCPDISCOVER from fe:fd:d0:52:75:c5 via
>eth0: network 10.10.37.64/26: no free leases
>
>
>Here's a snip from my config.
>
>subnet 10.82.117.64 netmask 255.255.255.192 {
> option routers 10.82.117.67;
> option subnet-mask 255.255.255.192;
> authoritative;
>
> host D0527545 {
> hardware ethernet FE:FD:D0:52:75:45;
> fixed-address 10.82.117.69;
> }
>
><<many more of the above for each ip>>
>}
>
>subnet 10.10.37.64 netmask 255.255.255.192 {
> option routers 10.10.37.65;
> option subnet-mask 255.255.255.192;
> authoritative;
>
> host CC0A2543 {
> hardware ethernet FE:FD:CC:0A:25:43;
> fixed-address 10.10.37.67;
> }
>
><<many more of the above for each ip>>
>}
>
>
>Where am i going wrong here?
Several places !
As Maurice Massar says, it looks more like you have a flat network
there, the "via eth0" is a bit of a giveaway that the client is on
the same broadcast domain as the server. Clearly 10.82.117.197 is not
in the subnet which eth0 is a member of, yet the device is directly
attached.
You need a shared network like this :
shared network vlan_something {
subnet ...
subnet ...
subnet ...
}
where vlan_something is an arbitrary text label you assign. If you do
actually have more than one physical network or VLAN (ie broadcast
domain), then you need a shared network for each of them, and of
course, a relay agent in any the server is not directly attached to.
The other thing is that HOST STATEMENTS ARE GLOBAL IN SCOPE, and you
will have had a warning about this when starting the DHCP server.
Except for some very odd setups, the inheritance effects you would
get due to putting host statements inside a subnet declaration are
not what you want - put them in the global scope. As it happens, the
fixed address statements will prevent such strange effects, but you
shouldn't rely on that to keep you out of trouble.
--
Simon Hobson
WANTED: "Software CD ROM Kit" for Canon CLBP 360-PS printer (Canon
part no RH6-3612, or possibly RH6-3810, or RH6-3610 might do). I've a
dead HD and need this CD so I can replace the disk and re-install the
printer OS on it. If anyone knows where I might get hold of one I'd
be grateful - requests to Canon drew a blank, it's been out of
support for years.
Alternatively, if anyone has one of these and would let me image
their hard disk ...
Visit http://www.magpiesnestpublishing.co.uk/ for books by acclaimed
author Gladys Hobson. Novels - poetry - short stories - ideal as
Christmas stocking fillers. Some available as e-books.
More information about the dhcp-users
mailing list