Re: [Dnsmasq-discuss] Use dnsmasq to assign static /32 addresses via DHCP

2019-03-15 Thread Peter Lieven
Am 15.03.19 um 16:02 schrieb Simon Kelley:
> On 15/03/2019 12:44, Peter Lieven wrote:
>> Hi Simon,
>>
>> Am 14.03.19 um 18:41 schrieb Simon Kelley:
>>> Is this a use for something like the ISC dhcpd shared-network configuration.
>>>
>>>
>>> In the dnsmasq case, we could have something like
>>>
>>> shared-network=,
>>>
>>> or
>>>
>>> shared-network=,
>>>
>>> In the first case dnsmasq would behave _as_if_ the specified interface
>>> carried the address and netmask specified.
>>>
>>> In the second case, it would behave as if the interface which carries
>>> interface-address also carried the address and netmask specified.
>>>
>>> If I've understood correctly, you'd just need a shared-network
>>> declaration for each of your /24s.
>>
>> What you describe is exactly what I would need. However, as far
>>
>> as I understand the documentation of the shared network feature in ISC dhcpd
>>
>> they still require that the network is configured on the DHCP interface (as 
>> alias, secondary etc.).
>>
>> This already works in dnsmasqd. I would need the feature that does not
>>
>> require the addresses to be actually configured on the interface as you
>>
>> describe it.
>>
>
> I may have miss-understood the dhcpd case - what it does or doesn't do
> is probably irrelevant to what dnsmasq can  do in this case.
>
>
> As far as I can see, there's no reason why it shouldn't work, with the
> following caveats.
>
> 1) The DHCP server interface must have at least one address configured,
> and that address needs to be reachable from configured clients. This
> address gets used as the "server identifier" field in unicast
> transmissions from the client to the server for things like lease
> renewal. The case that the server-id is not on the same network as the
> client is not new, it's the case when using a DHCP relay.


Thats totally fine and its already the case today. The GW is a virtual

address on the DHCP Interface.


>
> 2) Dnsmasq currently guesses at the default router to send to a client,
> unless it's overridden by configuration. This is either its own address
> on the network where the client is given an address, or, if the DHCP
> came via relay, then it's the address of the relay on the network where
> the client is given an address. In the case that a client is being given
> an address on a network where neither the DHCP server or the DHCP relay
> have an address, there's no sensible guess for what the client's default
> router should be set to, so explicit configuration will have to be
> mandatory.


Thats also okay. The Router is reachable via a classless static route as

the virtual GW is not part of the network. Most modern DHCP clients

support this even without the classless static route option if the netmask

is 255.255.255.255. Thats the common scenario e.g. in cable networks

where each client gets a /32 IPv4 address as well.


Best,

Peter



___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss


Re: [Dnsmasq-discuss] Use dnsmasq to assign static /32 addresses via DHCP

2019-03-15 Thread Simon Kelley
On 15/03/2019 12:44, Peter Lieven wrote:
> Hi Simon,
> 
> Am 14.03.19 um 18:41 schrieb Simon Kelley:
>> Is this a use for something like the ISC dhcpd shared-network configuration.
>>
>>
>> In the dnsmasq case, we could have something like
>>
>> shared-network=,
>>
>> or
>>
>> shared-network=,
>>
>> In the first case dnsmasq would behave _as_if_ the specified interface
>> carried the address and netmask specified.
>>
>> In the second case, it would behave as if the interface which carries
>> interface-address also carried the address and netmask specified.
>>
>> If I've understood correctly, you'd just need a shared-network
>> declaration for each of your /24s.
> 
> 
> What you describe is exactly what I would need. However, as far
> 
> as I understand the documentation of the shared network feature in ISC dhcpd
> 
> they still require that the network is configured on the DHCP interface (as 
> alias, secondary etc.).
> 
> This already works in dnsmasqd. I would need the feature that does not
> 
> require the addresses to be actually configured on the interface as you
> 
> describe it.
> 


I may have miss-understood the dhcpd case - what it does or doesn't do
is probably irrelevant to what dnsmasq can  do in this case.


As far as I can see, there's no reason why it shouldn't work, with the
following caveats.

1) The DHCP server interface must have at least one address configured,
and that address needs to be reachable from configured clients. This
address gets used as the "server identifier" field in unicast
transmissions from the client to the server for things like lease
renewal. The case that the server-id is not on the same network as the
client is not new, it's the case when using a DHCP relay.

2) Dnsmasq currently guesses at the default router to send to a client,
unless it's overridden by configuration. This is either its own address
on the network where the client is given an address, or, if the DHCP
came via relay, then it's the address of the relay on the network where
the client is given an address. In the case that a client is being given
an address on a network where neither the DHCP server or the DHCP relay
have an address, there's no sensible guess for what the client's default
router should be set to, so explicit configuration will have to be
mandatory.

Cheers,

Simon.


___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss


Re: [Dnsmasq-discuss] Use dnsmasq to assign static /32 addresses via DHCP

2019-03-15 Thread Peter Lieven
Hi Simon,

Am 14.03.19 um 18:41 schrieb Simon Kelley:
> Is this a use for something like the ISC dhcpd shared-network configuration.
>
>
> In the dnsmasq case, we could have something like
>
> shared-network=,
>
> or
>
> shared-network=,
>
> In the first case dnsmasq would behave _as_if_ the specified interface
> carried the address and netmask specified.
>
> In the second case, it would behave as if the interface which carries
> interface-address also carried the address and netmask specified.
>
> If I've understood correctly, you'd just need a shared-network
> declaration for each of your /24s.


What you describe is exactly what I would need. However, as far

as I understand the documentation of the shared network feature in ISC dhcpd

they still require that the network is configured on the DHCP interface (as 
alias, secondary etc.).

This already works in dnsmasqd. I would need the feature that does not

require the addresses to be actually configured on the interface as you

describe it.


>
>
>
> For the avoidance of doubt, this is NOT currently implemented on
> dnsmasq, but it has been on the "desirable" list in my head for some time.


I would like to help you implementing this, but unfortunately I am not at all

familiar with the dnsmasq code (yet). I do not know how complicated it is

to implement this, but I can at least help testing.


Best,

Peter




___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss


Re: [Dnsmasq-discuss] Use dnsmasq to assign static /32 addresses via DHCP

2019-03-14 Thread Simon Kelley
Is this a use for something like the ISC dhcpd shared-network configuration.


In the dnsmasq case, we could have something like

shared-network=,

or

shared-network=,

In the first case dnsmasq would behave _as_if_ the specified interface
carried the address and netmask specified.

In the second case, it would behave as if the interface which carries
interface-address also carried the address and netmask specified.

If I've understood correctly, you'd just need a shared-network
declaration for each of your /24s.



For the avoidance of doubt, this is NOT currently implemented on
dnsmasq, but it has been on the "desirable" list in my head for some time.


Simon.



On 12/03/2019 11:56, Peter Lieven wrote:
> Hi,
> 
> we run several thousand virtual gateways which are used to assign /32
> allocations to Virtual Servers via DHCP.
> 
> 
> This so far runs pretty well except for one hack that we had to make and
> that I would like to avoid.
> 
> We assign the /32 networks out of /24 blocks that we reserved for this
> purpose. However, dnsmasq only
> assigns IP addresses via an interface if the network is configured on
> that interface. We had to add some
> more specific routes on the gateways to make a 2 hosts that receive a
> /32 out of the same /24 see each
> other if they are on different gateways. In fact I would like to
> configure only one common virtual address
> on the vserver facing interface lets say 10.255.255.255/32.
> 
> What I would like to need is an option to either make dnsmasq assign
> addresses out of an dhcp-range even
> if the network is not configured on the dhcp interface or an option
> where dnsmasq runs in a mode where it
> 
> does not require dhcp-range options, but only works using dhcp-host
> entries and replies if gets a request
> 
> for a static mac address entry.
> 
> 
> My config looks basically like this:
> 
> [virtual gw1]
> 
> dhcp-range=set:virtualgw,10.0.0.2,10.0.0.254,infinite,static
> 
> dhcp-host=52:54:00:00:00:01,10.0.0.2,vserver1
> 
> dhcp-option=tag:virtualgw,1,255.255.255.255
> dhcp-option=tag:virtualgw,3,10.255.255.255
> dhcp-option=tag:virtualgw,28,255.255.255.255
> 
> dhcp-option=tag:virtualgw,121,10.255.255.255/32,0.0.0.0,0.0.0.0/0,10.255.255.255
> 
> 
> 
> [virtual gw2]
> 
> dhcp-range=set:virtualgw,10.0.0.2,10.0.0.254,infinite,static
> 
> dhcp-host=52:54:00:00:00:02,10.0.0.3,vserver1
> 
> dhcp-option=tag:virtualgw,1,255.255.255.255
> dhcp-option=tag:virtualgw,3,10.255.255.255
> dhcp-option=tag:virtualgw,28,255.255.255.255
> 
> dhcp-option=tag:virtualgw,121,10.255.255.255/32,0.0.0.0,0.0.0.0/0,10.255.255.255
> 
> 
> 
> To make dnsmasq deliver addresses out of 10.0.0.0/24 I have to configure
> 10.0.0.1/24
> 
> on the DHCP interface. To ensure reachability between 10.0.0.2 and
> 10.0.0.3 I have
> 
> configured static routes 10.0.0.0/25 and 10.0.0.128/25 towards the
> default gw.
> 
> The configuration of 10.0.0.1/24 on the DHCP interface and the static
> routes is what I would like to avoid.
> 
> 
> Thanks for your feedback,
> 
> Peter
> 
> 
> 
> 
> ___
> Dnsmasq-discuss mailing list
> Dnsmasq-discuss@lists.thekelleys.org.uk
> http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
> 


___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss


[Dnsmasq-discuss] Use dnsmasq to assign static /32 addresses via DHCP

2019-03-12 Thread Peter Lieven

Hi,

we run several thousand virtual gateways which are used to assign /32 
allocations to Virtual Servers via DHCP.


This so far runs pretty well except for one hack that we had to make and that I 
would like to avoid.

We assign the /32 networks out of /24 blocks that we reserved for this purpose. 
However, dnsmasq only
assigns IP addresses via an interface if the network is configured on that 
interface. We had to add some
more specific routes on the gateways to make a 2 hosts that receive a /32 out 
of the same /24 see each
other if they are on different gateways. In fact I would like to configure only 
one common virtual address
on the vserver facing interface lets say 10.255.255.255/32.

What I would like to need is an option to either make dnsmasq assign addresses 
out of an dhcp-range even
if the network is not configured on the dhcp interface or an option where 
dnsmasq runs in a mode where it

does not require dhcp-range options, but only works using dhcp-host entries and 
replies if gets a request

for a static mac address entry.


My config looks basically like this:

[virtual gw1]

dhcp-range=set:virtualgw,10.0.0.2,10.0.0.254,infinite,static

dhcp-host=52:54:00:00:00:01,10.0.0.2,vserver1

dhcp-option=tag:virtualgw,1,255.255.255.255
dhcp-option=tag:virtualgw,3,10.255.255.255
dhcp-option=tag:virtualgw,28,255.255.255.255

dhcp-option=tag:virtualgw,121,10.255.255.255/32,0.0.0.0,0.0.0.0/0,10.255.255.255


[virtual gw2]

dhcp-range=set:virtualgw,10.0.0.2,10.0.0.254,infinite,static

dhcp-host=52:54:00:00:00:02,10.0.0.3,vserver1

dhcp-option=tag:virtualgw,1,255.255.255.255
dhcp-option=tag:virtualgw,3,10.255.255.255
dhcp-option=tag:virtualgw,28,255.255.255.255

dhcp-option=tag:virtualgw,121,10.255.255.255/32,0.0.0.0,0.0.0.0/0,10.255.255.255


To make dnsmasq deliver addresses out of 10.0.0.0/24 I have to configure 
10.0.0.1/24

on the DHCP interface. To ensure reachability between 10.0.0.2 and 10.0.0.3 I 
have

configured static routes 10.0.0.0/25 and 10.0.0.128/25 towards the default gw.

The configuration of 10.0.0.1/24 on the DHCP interface and the static routes is 
what I would like to avoid.


Thanks for your feedback,

Peter




___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss