[Dnsmasq-discuss] Incorrect broadcast address given

OB Lutz ob.lutz at gmail.com
Wed Oct 8 14:41:22 BST 2008


The routing is fine. All the eth*s are bridged to br-lan, which is
given 192.168.8.225/27 (255.255.255.224). ath0 is 192.168.8.226/27,
ath1 192.168.8.227/27. iptables rules take care of forwarding
appropriate traffic around. Routing is not an issue.

Shoving various log messages into dnsmasq, i could see that when going
through the block of code at dhcp.c: complete_context,line 404-405

if (is_same_net(broadcast, context->start, context->netmask))
		    context->broadcast = broadcast;

Prior to sending the response back, dnsmasq would pass through here
about 4 times. Most passes the correct 192.168.8.255 broadcast address
would be put in context->broadcast, but the final pass always put in
the incorrect 192.168.8.226. I assume the only pass with relevance to
the broadcast address offered in  dnsmasq's response was the last one.

Now, I'm no expert in the ways of dnsmasq so maybe I'm just not seeing
something thats blatantly obvious to all of you. But seeing as how
dhcp is dhcp and ip routing is ip routing, why would my network setup
have any influence on the address dnsmasq gives for broadcast? If i
tell it to give addresses in the range of 192.168.8.230 through
192.168.8.254 with a mask of 255.255.255.224, why should it do any
different? It happily respects my configuration when I force the
broadcast address, why should it ignore my other configs?

On Wed, Oct 8, 2008 at 12:41 AM, richardvoigt at gmail.com
<richardvoigt at gmail.com> wrote:
> On Tue, Oct 7, 2008 at 3:03 PM, OB Lutz <ob.lutz at gmail.com> wrote:
>> Sorry, wasnt that clear in my explanation
>> This happens when the address range is at the end of a traditional
>> class C subnet (192.168.2.0/24). So the router's ip range is
>> x.x.x.224-255, with .225 being br-lan, .255 being its broadcast
>> address,and attempting to give dhcp'd ips from .230 through .254.
>> Using an address range anywehre else, such as the range you have,
>> works correctly.
>
> Wait a sec:
>
> You show 192.168.8.225/26 assigned to one interface on the router, br-lan
> You also said 192.168.8.226/26 is some wireless interface on the router
> This isn't good, multiple ips in the same subnet on the same router
> but different interfaces will really mess up your routing, and dnsmasq
> shouldn't be expected to behave predictably in such cases.
>
> You also mentioned vlan and bridging.  Please describe your
> configuration better, i.e. what interfaces are bridged together, what
> interface is the master for the vlans, etc.  I suspect you have
> assigned ip addresses to slave interfaces which is, in my experience,
> trouble.
>
>>
>> >From the router:
>> # ifconfig br-lan
>> br-lan    Link encap:Ethernet  HWaddr 00:D0:12:09:91:52
>>          inet addr:192.168.8.225  Bcast:192.168.8.255  Mask:255.255.255.224
>>
>> >From my laptop, after getting an ip via dhcp
>> $ ifconfig eth0
>> eth0      Link encap:Ethernet  HWaddr 00:1D:09:C2:74:BC
>>          inet addr:192.168.8.253  Bcast:192.168.8.226  Mask:255.255.255.224
>>
>> On Tue, Oct 7, 2008 at 9:56 AM, B. Cook <bcook at poughkeepsieschools.org> wrote:
>>>
>>> On Oct 6, 2008, at 11:17 AM, OB Lutz wrote:
>>>
>>>> Hi
>>>> I'm running dnsmasq 2.41 on openwrt kamikaze. My network has various
>>>> routers with blocks of 32 addresses hanging off of them. On every 8th
>>>> router, the relevant line from my dnsmasq.conf is :
>>>>
>>>> dhcp-range=vlan0,192.168.8.230,192.168.8.254,255.255.255.224,48h
>>>>
>>>> This should yield a broadcast address of 192.168.8.255. However, when
>>>> obtaining an IP address from the router, I am given a broadcast IP of
>>>> 192.168.8.226, which happens to be the IP of a wireless interface on
>>>> the router. Changing the configuration to specify the broadcast
>>>> address manually everything is fine. Other IP ranges yield the proper
>>>> broadcast, but every router whose addresses are at the end of the
>>>> class C subnet give this incorrect broadcast address.
>>>>
>>>> _______________________________________________dnsmasq-discuss at lists.thekelleys.org.uk
>>>> Dnsmasq-discuss mailing list
>>>> Dnsmasq-discuss at lists.thekelleys.org.uk
>>>> http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
>>>
>>> Hmm,
>>>
>>>  ipcalc -n 192.168.8.230/27
>>> Address:   192.168.8.230        11000000.10101000.00001000.111 00110
>>> Netmask:   255.255.255.224 = 27 11111111.11111111.11111111.111 00000
>>> Wildcard:  0.0.0.31             00000000.00000000.00000000.000 11111
>>> =>
>>> Network:   192.168.8.224/27     11000000.10101000.00001000.111 00000
>>> HostMin:   192.168.8.225        11000000.10101000.00001000.111 00001
>>> HostMax:   192.168.8.254        11000000.10101000.00001000.111 11110
>>> Broadcast: 192.168.8.255        11000000.10101000.00001000.111 11111
>>> Hosts/Net: 30                    Class C, Private Internet
>>>
>>> Looks like what you are asking for is correct.
>>>
>>> I am using things like this without any problems..
>>>
>>> dhcp-range=172.16.64.11,172.16.64.25,255.255.255.224,8h
>>>
>>> dnsmasq --version
>>> Dnsmasq version 2.45  Copyright (C) 2000-2008 Simon Kelley
>>> Compile time options no-IPv6 GNU-getopt BSD-bridge no-ISC-leasefile no-DBus
>>> no-I18N TFTP
>>>
>>> I am not sure what you mean by "every router whose addresses are at the end
>>> of the class C subnet give this incorrect broadcast address"..
>>>
>>> What do you define for vlan0 what does that look like?
>>>
>>>
>>>
>>> _______________________________________________
>>> Dnsmasq-discuss mailing list
>>> Dnsmasq-discuss at lists.thekelleys.org.uk
>>> http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
>>>
>>
>> _______________________________________________
>> Dnsmasq-discuss mailing list
>> Dnsmasq-discuss at lists.thekelleys.org.uk
>> http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
>>
>



More information about the Dnsmasq-discuss mailing list