Re: Need help w/ dhcpd and shared-network option . . .
Ahh!! The fog is beginning to lift. Thank's Jeff and Brandon (and
others)!
I pasted in the output from ifconfig along with my dhcpd.conf as it is
being used now (and appears to be working).
/*----- From ifconfig —--- */
eth0 Link encap:Ethernet HWaddr 00:04:AC:4C:5B:3F
inet addr:151.155.155.252 Bcast:151.155.155.255
Mask:255.255.252.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1806034 errors:0 dropped:0 overruns:0
frame:0
TX packets:2210153 errors:0 dropped:0 overruns:0
carrier:0
collisions:0 txqueuelen:100
RX bytes:227201992 (216.6 MiB) TX bytes:3242805602
(3.0 GiB)
Interrupt:10 Base address:0x2180
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:321679 errors:0 dropped:0 overruns:0
frame:0
TX packets:321679 errors:0 dropped:0 overruns:0
carrier:0
collisions:0 txqueuelen:0
RX bytes:356493190 (339.9 MiB) TX bytes:356493190
(339.9 MiB)
/*----- End ifconfig —--- */
/*----- 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?
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.
What I now don't understand is what the 'shared-network' declaration is
really used for if the new subnet section above is valid? Is it just to
allow the adminstrator to enumerate each grouping or block of addresses
separately for clarity?
Thanks again for the help.
Reply to: