[Dnsmasq-discuss] 'shared-network' behavior would be huge

Simon Kelley simon at thekelleys.org.uk
Sun Mar 31 23:13:29 BST 2019



On 30/03/2019 18:33, Ryan Gray wrote:
> TLDR; How do I use "shared-network" exactly?  :)
> 
> Everything compiled and is up and running with no changes to my
> existing configs or method of execution. I'm a little unclear about
> how to hold this tool.
> 
> Assuming a router interface of 192.168.4.126/25 and no sub interfaces,
> I typically do something like this:
> 
> dhcp-range=set:"internet-192_168_4_0_25",192.168.4.1,192.168.4.125,255.255.255.128,1h
> tag-if=set:internet-pool,tag:internet-192_168_4_0_25
> dhcp-option=tag:"internet-192_168_4_0_25",3,192.168.4.126
> dhcp-option=tag:"internet-192_168_4_0_25",1,255.255.255.128
> dhcp-option=tag:"internet-192_168_4_0_25",5,8.8.8.8
> 
> If I add another gateway IP to that router interface (I use "gateway
> IP" loosely), 192.168.5.0/24 and  and assuming the router with the
> ip-helper configured is, by default, going to say "hey, I'm
> 192.168.4.126". With ISC, having ranges for 192.168.4.1-125 and
> 192.168.5.1-253 within the block of config that defines a
> shared-network would make things copacetic.
> 
> The question:  In this scenario, am I to start dnsmasq with
> "--shared-network=192.168.4.126,192.168.5.0"    ?   If so, I'm not
> sure if my subnet definition strategy above is going to stay the same
> because I'm not sure how dnsmasq is going to treat this in regards to
> tags.  Perhaps I'm just looking at this sideways.
> 


You need to have something like

shared-network=192.168.4.1,192.168.5.0

assuming that the interface on the machine running dnsmasq is 192.168.4.1

or

shared-network=eth0,192.168.5.0

assuming that the interface is so-named.

Either of these will allow dnsmasq to allocate addresses on the sunnet
that includes 192.168.5.0, but to make that happen you need a dhcp-range
which tells it which addresses are available. This dhcp-range MUST have
the netmask: normally dnsmasq can figure out the netmask, but it doesn't
have enough information in this case.

You can set tag in the dhcp-range, as before, and use it to control the
DHCP options sent to the client (which should include router, as the
normal default route option won't be sent.


Simon.



> On Fri, Mar 29, 2019 at 4:13 PM Simon Kelley <simon at thekelleys.org.uk> wrote:
>>
>> On 29/03/2019 20:36, Ryan Gray wrote:
>>> Hello other humans,
>>>
>>> First, Simon Kelly, thank you for dnsmasq.
>>>
>>> I noticed here
>>> http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/2018q4/012700.html
>>> that there was discussion of the possibility of supporting behavior like
>>> ISC's 'shared-network'. Did this go anywhere? I would absolutely use
>>> this and would be happy to perform any testing that would help. I didn't
>>> see other mentions of this so I thought I'd ask.
>>>
>>> Dead serious, this would be spectacular.
>>>
>>>
>>
>>
>>
>> Today (actually, yesterday) is your lucky day:
>>
>> http://thekelleys.org.uk/gitweb/?p=dnsmasq.git;a=commit;h=ae5b7e04a1025167f1b80840e61432a3cea9625c
>>
>> Do please test!
>>
>>
>> Simon
>>
>>
>>> Regards,
>>> Ryan Gray
>>>
>>>
>>> _______________________________________________
>>> 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