[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Need help w/ dhcpd and shared-network option . . .



Jeff Vincent, 2001-Dec-12 15:49 -0700:
> Ahh!! The fog is beginning to lift.  Thank's Jeff and Brandon (and
> others)!  

:-)

> 
> /*----- From dhcpd.conf —--- */
> 	option domain-name "<testlabdomain>";
> 	option routers X.Y.D.254;
> 	option subnet-mask 255.255.252.0;
> 
> 	default-lease-time 600;
> 	max-lease-time 7200;
> 
> 	shared-network TestLab {
> 		subnet X.Y.A.0 netmask 255.255.255.0 {
> 			range X.Y.A.201 X.Y.A.254;
> 			option broadcast-address X.Y.A.255;
> 			}
> 		subnet X.Y.B.0 netmask 255.255.255.0 {
> 			range X.Y.B.201 X.Y.B.254;
> 			option broadcast-address X.Y.B.255;
> 			}
> 		subnet X.Y.C.0 netmask 255.255.255.0 {
> 			range X.Y.C.201 X.Y.C.254;
> 			option broadcast-address X.Y.C.255;
> 			}
> 		subnet X.Y.D.0 netmask 255.255.255.0 {
> 			option broadcast-address X.Y.C.255;
> 			}
> 		}
> /*----- End dhcpd.conf —--- */
> 
> Based on what I think I am understanding, I could replace the
> dhcpd.conf file listed above with:
> 
> /*----- new dhcpd.conf —--- */
> option domain-name "<testlabdomain>";
> option routers X.Y.D.254;
> option subnet-mask 255.255.252.0;
> 
> default-lease-time 600;
> max-lease-time 7200;
> 
> subnet X.Y.A.0 netmask 255.255.252.0 {
> 	range X.Y.A.201 X.Y.A.254;
> 	range X.Y.B.201 X.Y.B.254;
> 	range X.Y.C.201 X.Y.C.254;
> 	option broadcast-address X.Y.D.255;
> }
> /*----- End new dhcpd.conf —--- */
> 
> Right?

The 'shared-network' declaration is only used if you are truly
multinetting the network, meaning you are actually have 4 Class C
networks on the same wire (in this case).  That would also mean
that the only way for a host on X.Y.A.0/24 to talk to a host on
X.Y.B.0/24 would be through a router.  However, you are using /22
which put the 2 hosts on the same subnet and a router in not
needed.

I think the new dhcpd.conf will work with the multiple ranges and
the addresses will be allocated in round-robin fashion, grabbing
from each range, but I haven't tried it.  So, what you have here 
are non-consecutive address ranges on a common subnet.  I'd have 
to dig into the source to determine exactly what's supposed to
happen...maybe later :-) .

> So then the broadcast address for a subnet is derived by toggling each
> bit in subnet mask and then OR'ing the result with the actual subnet
> value (enabling all bits for all possible hosts on a subnet).  I had
> assumed (erroneously) that in a subnet declaration of X.Y.A.0, only
> allowed addresses in the range X.Y.A.N were valid, but that is only true
> if the subnet mask is 255.255.255.0.

I think I follow you, and yes the bits that the mask identifies
tell what the network address is and all the bits left over are
the hosts, accept for the very last one which is the broadcast.

I used to know how to do this by hand, but I've been using an IP
calculator (gipsc) for so long that I've forgotten.  Anyway, I
always start at the Class boundaries and work from there.

> Thanks again for the help.

No problem...this is fun  :-)

-- 
Jeff Coppock		Systems Engineer
Diggin' Debian		Admin and User



Reply to: