phpDHCPAdmin demo

Sten Carlsen sten at s-carlsen.dk
Sun Oct 12 18:12:13 UTC 2008


Yes, let us try a simpler example:

The whole address is now 16 bits (so we can count them easily).

IP of host is 192.132  = 0xC0 . 0x84 = 1100 0000 1000 0100
Subnet mask is 255.192 = 0xFF . 0xC0 = 1111 1111 1100 0000

1100 0000 10 00 0100 IP of host
1111 1111 11 00 0000 Mask
------------ -------
1100 0000 10 00 0000 NETWORK
1100 0000 10 11 1111 Broadcast

You could also say:
NETWORK = bit_and(IP, Mask)
Broadcast = bit_or(IP, bit_inv(Mask))


I am not sure there is ONE rfc to cover this, a place to start could be
rfc950, that is way back into history and is not near the full story but
this seems to be where the thing started to become clear. I am sure
others will supply more correct rfc numbers.

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.
>
> 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!!!"
>>
>>
>>
>>     
>
>
>
>   

-- 
Best regards

Sten Carlsen

No improvements come from shouting:

       "MALE BOVINE MANURE!!!" 



More information about the dhcp-users mailing list