Re: [Dnsmasq-discuss] is there anybody who can tell me how to read the source code?

2012-07-21 Thread richardvo...@gmail.com
Of course, tools like doxygen can help by automatically graphing the
function call tree.

On Fri, Jul 20, 2012 at 7:20 AM, SamLT s...@sltosis.org wrote:
 On Fri, Jul 20, 2012 at 09:26:03AM +0800, don wrote:
 i need to implement the dhcp function in one platform, but it's hard to read 
 the source code of dnsmasq, is there any tutorial ,or anybody who can give 
 some suggestions? thanks a lot.

 Somebody already ask something like that a few weeks (months?) ago. The
 best suggestion one can made is probably to start reading and trying to
 understand it on your own and then ask specific questions when something
 is not clear to you.



 ___
 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 mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss


Re: [Dnsmasq-discuss] static dhcp range and lease times

2012-07-21 Thread Simon Kelley

On 21/07/12 07:32, Craig Yoshioka wrote:

Hmm, I tried it out, and the static hosts do not seem to inherit the lease-time 
from the static range

with:

dhcp-range=eth1,10.0.0.101,10.0.0.200,24h
dhcp-range=eth1,10.0.0.0,10.0.0.100,static,240h

# ips are declared in /etc/hosts
dhcp-host=node-2
dhcp-host=node-3

node-2 and node-3 do not seem to get a 10day lease time



The problem is subtlety in selecting which dhcp-range to use (and 
therefore which lease time.)


try

dhcp-range=tag:!known,eth1,10.0.0.101,10.0.0.200,24h
dhcp-range=eth1,10.0.0.0,10.0.0.100,static,240h

to make the 24h range invalid when a configured host is found.


Simon.



while:

dhcp-range=eth1,10.0.0.101,10.0.0.200,24h
dhcp-range=eth1,10.0.0.0,10.0.0.100,static,240h

# ips are declared in /etc/hosts
dhcp-host=node-2,240h
dhcp-host=node-3,240h

seems to work as expected.

On Jul 19, 2012, at 11:36 PM, Simon Kelley si...@thekelleys.org.uk wrote:


On 20/07/12 03:31, Craig Yoshioka wrote:

does the following declarations:

dhcp-range=10.0.0.10,10.0.0.100,static,infinite
dhcp-host=host1,10.0.0.20
dhcp-host=host2,10.0.0.21

mean host1 and host2 will inherit the infinite lease time?



yes.

Cheers,

Simon.



___
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] multi-homed server with same hostname on 2 subnets

2012-07-21 Thread Craig Yoshioka

Hi,

I have a server using two interfaces for different subnets, with the same 
hostname on both. The subnets are:
192.168.0.0/24
192.168.1.0/24

I've gotten each interface to get the correct IP from dnsmasq using:
dhcp-host=eth0,myserver,192.168.0.10
dhcp-host=eth0,myserver,192.168.1.10

but when dnsmasq is asked to resolve the address of myserver it always answers 
with 192.168.1.10 regardless of what subnet the request came from.

What's the proper way to setup this up?
 
Thanks,
-Craig

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


Re: [Dnsmasq-discuss] multi-homed server with same hostname on 2 subnets

2012-07-21 Thread Craig Yoshioka
Sorry, typo the lines should have been:

 dhcp-host=eth0,myserver,192.168.0.10
 dhcp-host=eth1,myserver,192.168.1.10


On Jul 21, 2012, at 12:44 PM, Craig Yoshioka crai...@me.com wrote:

 
 Hi,
 
 I have a server using two interfaces for different subnets, with the same 
 hostname on both. The subnets are:
 192.168.0.0/24
 192.168.1.0/24
 
 I've gotten each interface to get the correct IP from dnsmasq using:
 dhcp-host=eth0,myserver,192.168.0.10
 dhcp-host=eth0,myserver,192.168.1.10
 
 but when dnsmasq is asked to resolve the address of myserver it always 
 answers with 192.168.1.10 regardless of what subnet the request came from.
 
 What's the proper way to setup this up?
 
 Thanks,
 -Craig
 
 ___
 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] multi-homed server with same hostname on 2 subnets

2012-07-21 Thread /dev/rob0
On Sat, Jul 21, 2012 at 12:49:38PM -0700, Craig Yoshioka wrote:
 Sorry, typo the lines should have been:
 
  dhcp-host=eth0,myserver,192.168.0.10
  dhcp-host=eth1,myserver,192.168.1.10

 On Jul 21, 2012, at 12:44 PM, Craig Yoshioka crai...@me.com wrote:
  I have a server using two interfaces for different subnets, with 
  the same hostname on both. The subnets are:
  192.168.0.0/24
  192.168.1.0/24

FWIW 192.168.0.0/23 are the worst possible choices because they 
conflict with what most off-the-shelf routers use. If you ever need 
to connect your networks to another, such as via a VPN, you might 
find out why.

  I've gotten each interface to get the correct IP from dnsmasq using:
  dhcp-host=eth0,myserver,192.168.0.10
  dhcp-host=eth0,myserver,192.168.1.10
  
  but when dnsmasq is asked to resolve the address of myserver it 
  always answers with 192.168.1.10 regardless of what subnet the 
  request came from.
  
  What's the proper way to setup this up?

See -y, --localise-queries in the dnsmasq(8) manual.
-- 
  http://rob0.nodns4.us/ -- system administration and consulting
  Offlist GMX mail is seen only if /dev/rob0 is in the Subject:

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


Re: [Dnsmasq-discuss] multi-homed server with same hostname on 2 subnets

2012-07-21 Thread Craig Yoshioka
Awesome.  I love dnsmasq.

BTW, re: the subnets, why would that be a problem?  I have complete control 
over the router, I can change it, set up static routing, etc. if I ever need to 
connect the two subnets.


On Jul 21, 2012, at 4:18 PM, /dev/rob0 r...@gmx.co.uk wrote:

 On Sat, Jul 21, 2012 at 12:49:38PM -0700, Craig Yoshioka wrote:
 Sorry, typo the lines should have been:
 
 dhcp-host=eth0,myserver,192.168.0.10
 dhcp-host=eth1,myserver,192.168.1.10
 
 On Jul 21, 2012, at 12:44 PM, Craig Yoshioka crai...@me.com wrote:
 I have a server using two interfaces for different subnets, with 
 the same hostname on both. The subnets are:
 192.168.0.0/24
 192.168.1.0/24
 
 FWIW 192.168.0.0/23 are the worst possible choices because they 
 conflict with what most off-the-shelf routers use. If you ever need 
 to connect your networks to another, such as via a VPN, you might 
 find out why.
 
 I've gotten each interface to get the correct IP from dnsmasq using:
 dhcp-host=eth0,myserver,192.168.0.10
 dhcp-host=eth0,myserver,192.168.1.10
 
 but when dnsmasq is asked to resolve the address of myserver it 
 always answers with 192.168.1.10 regardless of what subnet the 
 request came from.
 
 What's the proper way to setup this up?
 
 See -y, --localise-queries in the dnsmasq(8) manual.
 -- 
  http://rob0.nodns4.us/ -- system administration and consulting
  Offlist GMX mail is seen only if /dev/rob0 is in the Subject:
 
 ___
 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