phpDHCPAdmin demo

Tim Peiffer peiffer at umn.edu
Sun Oct 12 18:59:43 UTC 2008


Jason Gerfen wrote:
> Hmmm, so I guess my next question is, is there a way to calculate what
> would be valid or what would not be a valid broadcast address based on
> the subnet declaration?
>
> If you have an RFC for this I would definitely like to read it to
> ensue I get the right value prior to writing out the config file. Just
> trying to make it as easy as possible to check every possible
> scenario. Thanks.
>   
Um, Comers TCP/IP section 4.5 would be a good start.  The subnet is the 
logical and of an IP address and a netmask.  The inverse or complement 
of the netmask (host mask)  can be logically or'ed with the subnet to 
produce the subnet broadcast address..

Alternatively:  Cisco IOS in a Nutshell By James Boney

$ip && $netmask = $subnet
$subnet || ! $netmask

Alternatively if you use perl, 'use Net::Netmask'.

use Net::Netmask;
$block = new Net::Netmask (network block, netmask)
$broadcast = $block->broadcast();

Regards,
Tim Peiffer
Network Operations Engineer
Networking and Telecommunications Services
University of Minnesota


> On Sun, Oct 12, 2008 at 11:18 AM, Sten Carlsen <sten at s-carlsen.dk> wrote:
>   
>> Almost, broadcast address is always "all-ones" in the host part of the
>> IP. Should be:
>>
>>     option broadcast-address 192.168.173.255;
>>                                          ^^^
>>
>> Hopefully the arrowheads are still under the 255 when this is received ;-)
>>
>> Jason Gerfen wrote:
>>     
>>> On Sun, Oct 12, 2008 at 8:47 AM, Glenn Satchell
>>> <Glenn.Satchell at uniq.com.au> wrote:
>>>
>>>       
>>>>> Date: Sun, 12 Oct 2008 09:35:50 +0100
>>>>> To: dhcp-users at isc.org
>>>>> From: Simon Hobson <dhcp1 at thehobsons.co.uk>
>>>>> Subject: Re: phpDHCPAdmin demo
>>>>>
>>>>> Glenn Satchell wrote:
>>>>>
>>>>>           
>>>>>> option broadcast-address can be derived from the subnet declaration?
>>>>>> It is inherited from that scope - and if the two are different, well
>>>>>> your configuration is not correct.
>>>>>>
>>>>>> subnet a.b.c.d netmask e.f.g.h {
>>>>>>   option broadcast-address e.f.g.h;
>>>>>> }
>>>>>>
>>>>>>             
>>>>> Must have been a long day for you Glenn :-)
>>>>>
>>>>> Yes broadcast address can be derived, but it's more like :
>>>>>
>>>>> subnet a.b.c.d netmask e.f.g.h {
>>>>>   option broadcast-address i.j.k.l;
>>>>> }
>>>>>
>>>>> where i.j.k.l = a.b.c.d OR NOT(e.f.g.h)
>>>>>
>>>>> Of course, the option subnet-mask should be the same as in the subnet
>>>>> declaration.
>>>>>
>>>>>           
>>>> It was a long day, but you knew exactly what I meant :)
>>>>
>>>>
>>>>         
>>> Like so?
>>>
>>> subnet 192.168.173.0 netmask 255.255.255.0 {
>>>      option domain-name-servers 192.168.173.10, 192.168.173.11;
>>>      option routers 192.168.173.1;
>>>      option ip-forwarding on;
>>>      option broadcast-address 192.168.173.0;
>>>      option ntp-servers 192.168.173.2;
>>>      option netbios-name-servers 192.168.173.3;
>>>      default-lease-time 1800;
>>>      min-lease-time 30;
>>>      max-lease-time 3600;
>>> }
>>>
>>> The 'subnet' declaration matches the 'option broadcast-address'
>>> declaration here and when I tested the new .conf file it worked?
>>>
>>> Should I include some error checking to ensure the subnet declaration
>>> and the broadcast-address (if present) match?
>>>
>>> I hope I understood you correctly.
>>>
>>>
>>>       
>>>> regards,
>>>> -glenn
>>>>
>>>>
>>>>
>>>>
>>>>         
>>>
>>>
>>>       
>> --
>> Best regards
>>
>> Sten Carlsen
>>
>> No improvements come from shouting:
>>
>>       "MALE BOVINE MANURE!!!"
>>
>>
>>
>>     
>
>
>
>   



More information about the dhcp-users mailing list