Re: [Dnsmasq-discuss] Can't figure out how to assign static IPv6 addresses to clients

2012-10-03 Thread Carlos Laviola
On Tue, Oct 2, 2012 at 4:52 PM, Simon Kelley  wrote:
> On 02/10/12 14:56, Dan Williams wrote:
>>
>> On Mon, 2012-10-01 at 21:49 +0200, Sean Boran wrote:
>>>
>>>
>>>
>>> Perhaps you clients are getting their addresses from router
>>> advertisement, and not DHCP.  So disable RA first in dnsmasq (and make
>>> sure no router or other host is publishing one)
>>
>>
>> You don't want to disable RA, you want to tell clients to use "managed"
>> configuration in the RA.  If you disable RA, then nothing on that link
>> will have a default router and thus no way to get packets to anything
>> that's not in the broadcast domain.  DHCPv6 does not have any facility
>> to provide a "default gateway" like IPv4, since that's precisely the
>> functionality of RAs.
>>
>> So you really want to reconfigure either dnsmasq or radvd to set the
>> "M" (Managed) flag, which will tell the clients to get their address
>> from DHCPv6, not generate one from the RA prefix option.
>
>
> Dan is right, and the way to do this in dnsmasq is to define a dhcp-range,
> and set the global enable-ra flag. That will send RA (for the default route)
> with the M flag set (no SLAAC address). If you want SLAAC addresses
> _as_well_ as DHCPv6 assigned ones, add the "slaac" keyword to the
> dhcp-range. That clears the M flag.

I tried all this, yet it still won't work. It used to work when I used
radvd + the WIDE DHCP daemon. I'm at a loss here...
Thanks for all the help, though.

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


Re: [Dnsmasq-discuss] Pulling DHCP leases from an external script?

2012-10-03 Thread Brian Rak
I'm trying to assign addresses via DHCP for a number of different 
networks (using ip-helper and option 82 on the switches).  It's going to 
be tough for me to come up with a predefined list of what leases belong 
to what port, but it's definitely something I should be able to figure 
out when the lease is coming in.  There's also the fact that the config 
file would end up being quite large if I pregenerate it for every 
possible combination.



On 10/3/2012 3:47 PM, Jay Imerman wrote:
I'm not 100% certain, but the way I read the man page, the script is 
triggered after the dnsmasq event occurs, so you can pass some custom 
behavior to a script after dnsmasq has managed the lease.  However, it 
sounds like you want to customize dnsmasq behavior and insert your own 
algorithm for allocating IP addresses?  Just out of curiosity, why?  
You can specify quite a complex set of allocation rules using tags and 
more, why would you need to have anything other than that?

___
Jay Imerman
T (248) 230-4373  | F (952) 255-2056
4067 Highview Court
Waterford, MI  48329-4712

 
 





On Wed, Oct 3, 2012 at 3:14 PM, Brian Rak > wrote:


I'm trying to set up a DHCP server so that on any request for a
new lease I can execute a script and have the script return an IP
address (and other information).

Is this something that is currently possible with dnsmasq?  From
reading the man page, I can't tell if I will get this behaviour
with --dhcp-script --leasefile-ro.

Basically, it would be impossible for me to specify all the
possible DHCP leases at startup, but when a lease request is
received I would be able to determine what IP to assign.

___
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


Re: [Dnsmasq-discuss] Pulling DHCP leases from an external script?

2012-10-03 Thread Jay Imerman
I'm not 100% certain, but the way I read the man page, the script is
triggered after the dnsmasq event occurs, so you can pass some custom
behavior to a script after dnsmasq has managed the lease.  However, it
sounds like you want to customize dnsmasq behavior and insert your own
algorithm for allocating IP addresses?  Just out of curiosity, why?  You
can specify quite a complex set of allocation rules using tags and more,
why would you need to have anything other than that?
___
Jay Imerman
T (248) 230-4373  |  F (952) 255-2056
4067 Highview Court
Waterford, MI  48329-4712







On Wed, Oct 3, 2012 at 3:14 PM, Brian Rak  wrote:

> I'm trying to set up a DHCP server so that on any request for a new lease
> I can execute a script and have the script return an IP address (and other
> information).
>
> Is this something that is currently possible with dnsmasq?  From reading
> the man page, I can't tell if I will get this behaviour with --dhcp-script
> --leasefile-ro.
>
> Basically, it would be impossible for me to specify all the possible DHCP
> leases at startup, but when a lease request is received I would be able to
> determine what IP to assign.
>
> __**_
> 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


Re: [Dnsmasq-discuss] Using IPv6 DHCP

2012-10-03 Thread Gene Czarcinski

On 10/03/2012 08:45 AM, Sean Boran wrote:

I was initially surprised: it works just like you would like it to.

Now, this works with radvd and dnsmasq.  The question is whether dnsmasq
could do the same thing for RA while continuing to do the dhcpd/dhcpd6 and
dynamic dns stuff so that it was unnecessary to run radvd.  This works on an
IPv6-only network.

Now that only works with your patch to fedora?


Using radv as you described (AdvSendAdvert on; AdvManagedFlag on;),
instead of dnsmasq


Did you specify "AdvAutonomous off;" under the prefix definition?  I 
have not tried all the various combinations of radvd parameters ... 
these are the ones which I was told work ... and they do for me anyway.


My patch is not involved with making this work.  What my patch does is 
to supply the final piece with and dhclient sent the appropriate info up 
to radvd/named/dhcpd6 or radvd/dnsmasq so that dynamic updating of the 
dns occurs.


On thing I found out from another message on another thread is that 
while radvd/dnsmasq work, dnsmasq can do the whole job itself.:



Am 02.10.2012 21:52, schrieb Simon Kelley:

On 02/10/12 14:56, Dan Williams wrote:

So you really want to reconfigure either dnsmasq or radvd to set the
"M" (Managed) flag, which will tell the clients to get their address
from DHCPv6, not generate one from the RA prefix option.

Dan is right, and the way to do this in dnsmasq is to define a dhcp-range, and 
set the
global enable-ra flag. That will send RA (for the default route) with the M 
flag set (no
SLAAC address). If you want SLAAC addresses_as_well_  as DHCPv6 assigned ones, 
add the
"slaac" keyword to the dhcp-range. That clears the M flag.


What puzzles me is that there appears to be only one way things work, 
that it works correctly for stateful IPV6 addresses, that it complies 
with RFC 4861, but these facts are not well documented and "marketed."  
This info needs to get into the documentation that accompanies 
distributions.


Gene



- On Ubuntu 12.04, network=automatic, SLAAC (but not DHCP) addresses
are assigned, default route works.
- with Automatic/DHCP, a dhcp address is assigned, but no route :-(
- with Automatic/Address only, SLAC+dhcp address is assigned, route works.

On a windows 7 client, only a slaac address is assigned, route is fine.
You indicated being able to get windows 7 to work as desired?


Finally, disable radvd and in dnsmasq "enable-ra" agin.
The Ubunut client with "with Automatic/Address only", gets only SLAAC,
not DHCP.
In the discussion so far, was it indicated if dnsmasq RA ca do the
equivalent of "AdvSendAdvert on; AdvManagedFlag on;" ?


Sean



On 2 October 2012 05:36, Gene Czarcinski  wrote:

On 10/01/2012 04:43 PM, Simon Kelley wrote:

On 01/10/12 21:13, Sean Boran wrote:

"I have not tested dnsmasq to see if it could provide the RA, dhcp, and
dns
services for IPv6 but I am interested that it would."

It can do RA, but I disabled it, as I did on my router. For me it was
necessary on my Ubuntu client to prevent it having a SLAAC address.

I'd not noticed the route issue though, and
dhcp-option=option6:router
can't be used with an Ipv6 address. oops.

Enabling RA in dnsmasq, with dhcp , and setting the network manager to
auto
in Ubuntu 12.04 causes SLAAC addresses (2) to be assigned and the default
route to work.

Hmm. I'd like to assign specific, not slaac addresses, but of course a
default route too.


You're right that there's no DHCPv6 option for default route: that has to
come from RA. It is possible to do RA broadcasts and tell the client to use
them for getting a default route, but not a SLAAC address, so that the
address stuff happens by DHCPv6. That mode is what dnsmasq does on a subnet
where there is an IPv6 dhcp-range, and enable-ra is set.


OK, RA for default route and dhcp-6 for IPv6 address and dns update ... this
does work.

This was developed and tested running Fedora 17 although it should/will work
for other systems.  The system runs NetworkManager.  A patch I developed is
currently in the process of being integrated.  This patch enhances
NetworkManager so that dynamic DNS is supported.  This has been tested with
both radvd/dnsmasq and radvd/named/dhcpd/dhcpd6 providing the services.

Just dhcpd6 does not work because it does not provide any routing info.
NetworkManager uses their "auto" configuration to use dhcp6 (via dhclient6)
to provide the IPv6 address and update the dns and to use RA (from radvd) to
provide the default route.

Here is the critical info:
https://fedoraproject.org/wiki/Tools/NetworkManager/IPv6

Scroll down to "DHCPv6 address and DNS configuration".


/etc/radvd.conf:


interface eth0 {
  AdvSendAdvert on;
  AdvManagedFlag on;
  prefix 2001:db8:1:2::/64 {
  AdvAutonomous off;
  };
};

/etc/dhcp/dhcpd6.conf:

subnet6 2001:db8:1:2::/64 {
  option dhcp6.name-servers 2001:db8:1:2::ab;
  option dhcp6.domain-search "example.net";
  range6 2001:db8:1:2::1: 2001:db8:1:2::1:;
}

This 

[Dnsmasq-discuss] Pulling DHCP leases from an external script?

2012-10-03 Thread Brian Rak
I'm trying to set up a DHCP server so that on any request for a new 
lease I can execute a script and have the script return an IP address 
(and other information).


Is this something that is currently possible with dnsmasq?  From reading 
the man page, I can't tell if I will get this behaviour with 
--dhcp-script --leasefile-ro.


Basically, it would be impossible for me to specify all the possible 
DHCP leases at startup, but when a lease request is received I would be 
able to determine what IP to assign.


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


Re: [Dnsmasq-discuss] Using IPv6 DHCP

2012-10-03 Thread Simon Kelley
On 03/10/12 13:45, Sean Boran wrote:
>> I was initially surprised: it works just like you would like it to.
>>
>> Now, this works with radvd and dnsmasq.  The question is whether dnsmasq
>> could do the same thing for RA while continuing to do the dhcpd/dhcpd6 and
>> dynamic dns stuff so that it was unnecessary to run radvd.  This works on an
>> IPv6-only network.
> 
> Now that only works with your patch to fedora?
> 
> 
> Using radv as you described (AdvSendAdvert on; AdvManagedFlag on;),
> instead of dnsmasq
> 
> - On Ubuntu 12.04, network=automatic, SLAAC (but not DHCP) addresses
> are assigned, default route works.
> - with Automatic/DHCP, a dhcp address is assigned, but no route :-(
> - with Automatic/Address only, SLAC+dhcp address is assigned, route works.
> 
> On a windows 7 client, only a slaac address is assigned, route is fine.
> You indicated being able to get windows 7 to work as desired?
> 
> 
> Finally, disable radvd and in dnsmasq "enable-ra" agin.
> The Ubunut client with "with Automatic/Address only", gets only SLAAC,
> not DHCP.
> In the discussion so far, was it indicated if dnsmasq RA ca do the
> equivalent of "AdvSendAdvert on; AdvManagedFlag on;" ?
> 
> 

There's a third dimension, which is the "A" flag in advertised prefixes,
which is what tells clients if they are allowed to use SLAAC addresses.


There are six different relevant dhcp-range declarations, a simple
dhcp-range with IPv6 addresses, the same, but with ra-only, the same
with ra_stateless, a subnet with ra-only, a subnet with ra-names, and s
subnet with ra-stateless. Here is the matrix of what gets set/provided
where.

 M-bit   O-bit   A-bit  stateless-DHCP DHCP-address
range  xx  x x
range+ra_only  xx   x  x x
range+ra_stateless  x   x  x x
ra-only x
ra-namesx
ra-statelessx  x

The first line assumes that enable-ra is set, otherwise dnsmasq never
sends any router advertisements.

> In the discussion so far, was it indicated if dnsmasq RA ca do the
> equivalent of "AdvSendAdvert on; AdvManagedFlag on;" ?
>

enable-ra and a dhcp-range will do that.

Cheers,

Simon.














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


Re: [Dnsmasq-discuss] Using IPv6 DHCP

2012-10-03 Thread Sean Boran
> I was initially surprised: it works just like you would like it to.
>
> Now, this works with radvd and dnsmasq.  The question is whether dnsmasq
> could do the same thing for RA while continuing to do the dhcpd/dhcpd6 and
> dynamic dns stuff so that it was unnecessary to run radvd.  This works on an
> IPv6-only network.

Now that only works with your patch to fedora?


Using radv as you described (AdvSendAdvert on; AdvManagedFlag on;),
instead of dnsmasq

- On Ubuntu 12.04, network=automatic, SLAAC (but not DHCP) addresses
are assigned, default route works.
- with Automatic/DHCP, a dhcp address is assigned, but no route :-(
- with Automatic/Address only, SLAC+dhcp address is assigned, route works.

On a windows 7 client, only a slaac address is assigned, route is fine.
You indicated being able to get windows 7 to work as desired?


Finally, disable radvd and in dnsmasq "enable-ra" agin.
The Ubunut client with "with Automatic/Address only", gets only SLAAC,
not DHCP.
In the discussion so far, was it indicated if dnsmasq RA ca do the
equivalent of "AdvSendAdvert on; AdvManagedFlag on;" ?


Sean



On 2 October 2012 05:36, Gene Czarcinski  wrote:
> On 10/01/2012 04:43 PM, Simon Kelley wrote:
>>
>> On 01/10/12 21:13, Sean Boran wrote:
>>>
>>> "I have not tested dnsmasq to see if it could provide the RA, dhcp, and
>>> dns
>>> services for IPv6 but I am interested that it would."
>>>
>>> It can do RA, but I disabled it, as I did on my router. For me it was
>>> necessary on my Ubuntu client to prevent it having a SLAAC address.
>>>
>>> I'd not noticed the route issue though, and
>>> dhcp-option=option6:router
>>> can't be used with an Ipv6 address. oops.
>>>
>>> Enabling RA in dnsmasq, with dhcp , and setting the network manager to
>>> auto
>>> in Ubuntu 12.04 causes SLAAC addresses (2) to be assigned and the default
>>> route to work.
>>>
>>> Hmm. I'd like to assign specific, not slaac addresses, but of course a
>>> default route too.
>>>
>>
>> You're right that there's no DHCPv6 option for default route: that has to
>> come from RA. It is possible to do RA broadcasts and tell the client to use
>> them for getting a default route, but not a SLAAC address, so that the
>> address stuff happens by DHCPv6. That mode is what dnsmasq does on a subnet
>> where there is an IPv6 dhcp-range, and enable-ra is set.
>
>
> OK, RA for default route and dhcp-6 for IPv6 address and dns update ... this
> does work.
>
> This was developed and tested running Fedora 17 although it should/will work
> for other systems.  The system runs NetworkManager.  A patch I developed is
> currently in the process of being integrated.  This patch enhances
> NetworkManager so that dynamic DNS is supported.  This has been tested with
> both radvd/dnsmasq and radvd/named/dhcpd/dhcpd6 providing the services.
>
> Just dhcpd6 does not work because it does not provide any routing info.
> NetworkManager uses their "auto" configuration to use dhcp6 (via dhclient6)
> to provide the IPv6 address and update the dns and to use RA (from radvd) to
> provide the default route.
>
> Here is the critical info:
> https://fedoraproject.org/wiki/Tools/NetworkManager/IPv6
>
> Scroll down to "DHCPv6 address and DNS configuration".
>>
>>
>> /etc/radvd.conf:
>>
>>
>> interface eth0 {
>>  AdvSendAdvert on;
>>  AdvManagedFlag on;
>>  prefix 2001:db8:1:2::/64 {
>>  AdvAutonomous off;
>>  };
>> };
>>
>> /etc/dhcp/dhcpd6.conf:
>>
>> subnet6 2001:db8:1:2::/64 {
>>  option dhcp6.name-servers 2001:db8:1:2::ab;
>>  option dhcp6.domain-search "example.net";
>>  range6 2001:db8:1:2::1: 2001:db8:1:2::1:;
>> }
>>
>> This is a typical DHCPv6 configuration. Note that routing information are
>> stil delivered through Router Advertisements. NetworkManager may fail in
>> this scenario.
>>
>>
> I was initially surprised: it works just like you would like it to.
>
> Now, this works with radvd and dnsmasq.  The question is whether dnsmasq
> could do the same thing for RA while continuing to do the dhcpd/dhcpd6 and
> dynamic dns stuff so that it was unnecessary to run radvd.  This works on an
> IPv6-only network.
>
> Gene
>
>
>
>
> ___
> 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