Re: [Dnsmasq-discuss] Setting different default gateway by mac address

2008-07-29 Thread Olaf Westrik

jb...@cpaaa.org wrote:

I have a hand full of users on my network that need a different gateway. I 
would like to override the different gateway by mac address. Here are my config 
options:

dhcp-option=option:router,172.xx.xx.1   # just the 
different gateway

dhcp-host=00:XX:0B:65:XX:58,3,172.xx.xx.254 # Thought this might 
work but no

dhcp-option=3,00:XX:0B:65:XX:58,172.xx.xx.254   # Thought this might 
work but no


Have to tried ?

dhcp-mac=special1,00:01:02:03:04:05
dhcp-option=special1,option:router,a.b.c.d


Olaf

--

A weizen a day helps keep the doctor away.



Re: [Dnsmasq-discuss] Setting different default gateway by mac address

2008-07-29 Thread Simon Kelley
jb...@cpaaa.org wrote:
> I have a hand full of users on my network that need a different
> gateway. I would like to override the different gateway by mac
> address. Here are my config options:
> 
> dhcp-option=option:router,172.xx.xx.1 # just the 
> different gateway
> 
> 
> dhcp-host=00:XX:0B:65:XX:58,3,172.xx.xx.254   # Thought this might
> work but no
> 
> dhcp-option=3,00:XX:0B:65:XX:58,172.xx.xx.254 # Thought this might
> work but no
> 
> Thanks for your help
> 

dhcp-host=00:XX:0B:65:XX:58,net:altgateway

dhcp-option=net:altgateway,option:router,172.xx.xx.1

The idea is to set the "altgateway" tag for just the relevant hosts, and
then send the different gateway just to them.

Cheers,

Simon.



[Dnsmasq-discuss] Setting different default gateway by mac address

2008-07-29 Thread jboss
I have a hand full of users on my network that need a different gateway. I 
would like to override the different gateway by mac address. Here are my config 
options:

dhcp-option=option:router,172.xx.xx.1   # just the 
different gateway

dhcp-host=00:XX:0B:65:XX:58,3,172.xx.xx.254 # Thought this might 
work but no

dhcp-option=3,00:XX:0B:65:XX:58,172.xx.xx.254   # Thought this might 
work but no

Thanks for your help


Re: [Dnsmasq-discuss] illegal domain in dhcp-config directive

2008-07-29 Thread Jason Dixon
On Tue, Jul 29, 2008 at 07:48:32AM +0100, Simon Kelley wrote:
> Jason Dixon wrote:
>> Thanks to the recent vulnerability, I'm upgrading an older dnsmasq
>> system from version 2.34 to 2.45.  I've installed it and attempted to
>> run it, but I get the following error.
>>
>> dnsmasq: illegal domain 04-06.lab.foobar.com in dhcp-config directive.
>>
>> The same configuration works fine with 2.34, so I presume something has
>> changed in the configuration syntax or default settings.  I haven't
>> found anything on Google or in the FAQ about this error, nor do I see
>> any "dhcp-config" directives in our config files or the sample config.
>> Here is the relevant line from our config:
>>
>> dhcp-host=00:0c:29:02:1f:06,ubuntu-8.04-06.lab.foobar.com,172.16.117.105
>>
>> It doesn't appear to be anything specifically with that line.  We have a
>> couple hundred of these loaded by dnsmasq.  If I comment out that one,
>> the next preceding one will error.  I'm not experienced with dnsmasq, so
>> I'm putting myself at the mercy of this list.  Any help will be greatly
>> appreciated.  :)
>>
>> Thanks,
>>
>
> As far as I can see, this error can only be occuring because the domain  
> part of the name your applying to that host doesn't match the domain  
> specified for dnsmasq to use by the domain= config option.
>
> AFAIK dnsmasq has never allowed you to send a FQDN to a host unless it  
> matches the domain setting (this is to avoid hosts impersonating, eg  
> www.microsoft.com) but the check in this case has been moved from  
> run-time, where it will log an error, to a fatal error at start-up
>
> The fix may be as simple as adding
>
> domain=04-06.lab.foobar.com
>
> (and you can remove the domain parts from all the dhcp-host lines as  
> well, if you wish. If they stay, they must match the domain given)

We have mixed domains in our configuration.  I see the following line in
the main dnsmasq.conf, which would account for most of the dhcp-host
entries:

local=/lab.foobar.com/wifi.foobar.com/

I see no domain directives anywhere.  I suspect that adding
04-06.lab.foobar.com to the local directive might be sufficient, but I'm
just guessing.  And yes, this configuration works fine with
dnsmasq-2.34.

-- 
Jason Dixon
OmniTI Computer Consulting, Inc.
jdi...@omniti.com
443.325.1357 x.241 



Re: [Dnsmasq-discuss] Supporting more than one domain.

2008-07-29 Thread Simon Kelley
Ben wrote:
> Simon Kelley wrote:
>> However, it did light a lightbulb, most people who want multiple domains
>> probably want them associated with particular IP address ranges, (or at
>> least can organise things to make that true.) Given that each lease has
>> to have an IP address, that makes mapping from lease to domain perfectly
>> simple. It also makes use of the domain to expand names in /etc/hosts
>> work well (see the --expand-hosts flag)
>>
>> So, here is a suggestion:
>>
>> Elaborate the "domain=" config option so that, as well as
>>
>> domain=example.org
>>
>> the following are also valid
>>
>> domain=example.org,192.168.100.128,192.168.100.180
>> domain=subnet.example.org,192.168.100.0/24
>> domain=anothernet.example.org,2001:db8:100:f101:210:a4ff:fee3:9566/64
>>
>> Multiple domain lines are now allowed, and the smallest address range
>> which matches will be used. The IPv6 version is useful for /etc/hosts
>> and --expand-hosts, it's clearly not used for DHCP (which is IPv4 only
>> in dnsmasq).
>>
>> This has lots of advantages: it's completely backwards-compatible with
>> existing configs, it's straightforward to use, and straightforward to
>> implement.
>>
>> What do people think, would that be sufficiently useful?
>>   
> That would be fine by me.  I would prefer a consistent syntax like
> "net:network-id" but if that isn't practical then i will survive.
>> As part of implementing this, I'd like to try (again) to remove the
>> long-deprecated ISC lease-file reading code. If I don't remove it, it
>> will need work to fit in with the new facilities. I've tried to remove
>> this code before and had complaints; can I assume by now that that code
>> is dead?
>>   
> Fine by me.
> 
> So to make sure i am clear a configuration would look like this, right?
> 
>domain=sub1.example.com.au,192.168.1.0/24
>domain=sub2.example.com.au,192.168.2.0/24
> 
>local=sub1.example.com.au
>local=sub2.example.com.au
> 
>dhcp-range=subnet1,192.168.1.100,192.168.1.254,255.255.255.0,24h
>dhcp-range=subnet2,192.168.2.100,192.168.2.254,255.255.255.0,24h
> 
>dhcp-option=subnet1,15,sub1.example.com.au
>dhcp-option=subnet2,15,sub2.example.com.au
> 
>dhcp-boot=net:subnet1,/pxelinux.0
> 

Right, except that the dhcp option 15 lines are superfluous, they
specify behaviour which will occur by default. This is just an extension
of the existing behaviour: dnsmasq sends the domain automatically.
> 
> While i am at it can i also request that support for the
> "net:network-id" syntax be supported wherever network-id's can be used?
> Using the example above i would like to be able to keep things
> consistent and clearer like this.
> 
>dhcp-range=net:subnet1,192.168.1.100,192.168.1.254,255.255.255.0,24h
>dhcp-option=net:subnet1,15,sub1.example.com.au
>dhcp-boot=net:subnet1,/pxelinux.0
> 

You can, seems sensible to me, I'll add it to the list.

Cheers,

Simon.

> 
> Ben
> 




Re: [Dnsmasq-discuss] illegal domain in dhcp-config directive

2008-07-29 Thread Simon Kelley

Jason Dixon wrote:

Thanks to the recent vulnerability, I'm upgrading an older dnsmasq
system from version 2.34 to 2.45.  I've installed it and attempted to
run it, but I get the following error.

dnsmasq: illegal domain 04-06.lab.foobar.com in dhcp-config directive.

The same configuration works fine with 2.34, so I presume something has
changed in the configuration syntax or default settings.  I haven't
found anything on Google or in the FAQ about this error, nor do I see
any "dhcp-config" directives in our config files or the sample config.
Here is the relevant line from our config:

dhcp-host=00:0c:29:02:1f:06,ubuntu-8.04-06.lab.foobar.com,172.16.117.105

It doesn't appear to be anything specifically with that line.  We have a
couple hundred of these loaded by dnsmasq.  If I comment out that one,
the next preceding one will error.  I'm not experienced with dnsmasq, so
I'm putting myself at the mercy of this list.  Any help will be greatly
appreciated.  :)

Thanks,



As far as I can see, this error can only be occuring because the domain 
part of the name your applying to that host doesn't match the domain 
specified for dnsmasq to use by the domain= config option.


AFAIK dnsmasq has never allowed you to send a FQDN to a host unless it 
matches the domain setting (this is to avoid hosts impersonating, eg 
www.microsoft.com) but the check in this case has been moved from 
run-time, where it will log an error, to a fatal error at start-up


The fix may be as simple as adding

domain=04-06.lab.foobar.com

(and you can remove the domain parts from all the dhcp-host lines as 
well, if you wish. If they stay, they must match the domain given)


Cheers,

Simon.




Re: [Dnsmasq-discuss] Supporting more than one domain.

2008-07-29 Thread Ben

Simon Kelley wrote:

However, it did light a lightbulb, most people who want multiple domains
probably want them associated with particular IP address ranges, (or at
least can organise things to make that true.) Given that each lease has
to have an IP address, that makes mapping from lease to domain perfectly
simple. It also makes use of the domain to expand names in /etc/hosts
work well (see the --expand-hosts flag)

So, here is a suggestion:

Elaborate the "domain=" config option so that, as well as

domain=example.org

the following are also valid

domain=example.org,192.168.100.128,192.168.100.180
domain=subnet.example.org,192.168.100.0/24
domain=anothernet.example.org,2001:db8:100:f101:210:a4ff:fee3:9566/64

Multiple domain lines are now allowed, and the smallest address range
which matches will be used. The IPv6 version is useful for /etc/hosts
and --expand-hosts, it's clearly not used for DHCP (which is IPv4 only
in dnsmasq).

This has lots of advantages: it's completely backwards-compatible with
existing configs, it's straightforward to use, and straightforward to
implement.

What do people think, would that be sufficiently useful?
  
That would be fine by me.  I would prefer a consistent syntax like 
"net:network-id" but if that isn't practical then i will survive.

As part of implementing this, I'd like to try (again) to remove the
long-deprecated ISC lease-file reading code. If I don't remove it, it
will need work to fit in with the new facilities. I've tried to remove
this code before and had complaints; can I assume by now that that code
is dead?
  

Fine by me.

So to make sure i am clear a configuration would look like this, right?

   domain=sub1.example.com.au,192.168.1.0/24
   domain=sub2.example.com.au,192.168.2.0/24

   local=sub1.example.com.au
   local=sub2.example.com.au

   dhcp-range=subnet1,192.168.1.100,192.168.1.254,255.255.255.0,24h
   dhcp-range=subnet2,192.168.2.100,192.168.2.254,255.255.255.0,24h

   dhcp-option=subnet1,15,sub1.example.com.au
   dhcp-option=subnet2,15,sub2.example.com.au

   dhcp-boot=net:subnet1,/pxelinux.0


While i am at it can i also request that support for the 
"net:network-id" syntax be supported wherever network-id's can be used?
Using the example above i would like to be able to keep things 
consistent and clearer like this.


   dhcp-range=net:subnet1,192.168.1.100,192.168.1.254,255.255.255.0,24h
   dhcp-option=net:subnet1,15,sub1.example.com.au
   dhcp-boot=net:subnet1,/pxelinux.0


Ben