Re: [Dnsmasq-discuss] DHCPv6 with IPv4 address in last 32 bits of IPv6 address: ideas?

2020-04-22 Thread john doe
On 4/22/2020 9:08 AM, William Edwards wrote:
>
>> Op 22 apr. 2020 om 08:41 heeft Olaf Hering  het volgende 
>> geschreven:
>>
>> Am Tue, 21 Apr 2020 15:58:25 +0200
>> schrieb "William Edwards" :
>>
>>> Ideas are welcome.
>>
>> You did not say how hosts are identified, nor did you say why exactly 
>> addresses matter in your setup.
>> If it is done based on their MAC addresses, just give each host a name.
>>
>> host-record=hostname,hostname.${dns_domain},${ipv4},${ipv6_prefix}::0323:45ff:feab:cdef
>> dhcp-host=01:23:45:ab:cd:ef,set:hostname,hostname,216000
>>
>> After all this project is called DNSmasq, not DHCPmasq...
>
> Your position is clear. What I’ll probably do is write a config file in 
> dnsmasq.d/ with dhcp-host directive from my dhcp-script, after handing out a 
> v4 lease and replacing . with :.
>

You could also use the corresponding directory option for dhcp-host.

--
John Doe

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


Re: [Dnsmasq-discuss] DNS set using dhcp-host expires?

2020-04-22 Thread Jiawen Chen
Hey - that worked! Setting my leases to 12 hrs fixed everything. Heh, I
guess there are some subtleties in interpreting "infinite".

For completeness:

# Old. not working.
# dhcp-host=,192.168.0.150,livingr
oom.internal,infinite

# New, working.
# Diff:
# - 12 hour lease, not infinite
# - Don't even need the .internal suffix
# Removed hosts file
dhcp-host=,192.168.0.150,[::0:1000],livingr
oom,12h

On Tue, Apr 21, 2020 at 1:54 PM Geert Stappers  wrote:

> On Tue, Apr 21, 2020 at 09:57:34AM -0400, Jiawen Chen wrote:
> > On Tue, Apr 21, 2020 at 3:06 AM Geert Stappers wrote:
> > > On Mon, Apr 20, 2020 at 10:27:11PM -0400, Jiawen Chen wrote:
> > > >
> > > > I'm using dnsmasq for DHCP + DNS on my home LAN and use dhcp-host to
> > > > statically assign an IP address and hostname. However, I'm
> discovering that
> > > > while it works most of the time, sometimes, ssh for example, can't
> find the
> > > > host by name, only IP. One instance is a Linux VM. Initially I can
> ssh into
> > > > the VM. But if I power down the VM for say a few days, and start it
> back
> > > > up, the name is missing (even though it is somehow assigned the same
> IP (it
> > > > keeps its MAC)).
> > > >
> > > > dnsmasq.conf:
> > > > ```
> > > > # other irrelevant stuff
> > > >  ...
> > > > # Assign 192.168.0.150 to my living room pc
> > > >
> dhcp-host=,192.168.0.150,livingroom.internal,infinite
> > > >
> > > > # Assign 192.168.0.151 to my file server
> > > >
> dhcp-host=,192.168.0.151,fileserver.internal,infinite
> > > > ```
> > >
> > > I suggest to change  the   ',infinite'   into something like  ',12h'
> for
> > > the servers that are be powered-off of for several days.
> > >
> > > What I think is that the DNS cache  entry expires
> > > ( and I think that it is valid behaviour.)
> > >
> > >
> > > Expriment that can be done:
> > >
> > >  * Restart dnsmasq,  so it forgets about dhcp-hosts in DNS cache
> > >  * Check cache dump with  SIGUSR1
> > >  * Power-on an infinite DHCP client e.g. the Linux VM
> > >  * Check cache dump with SIGUSR1
> > >  * Regular work with the example Linux VM
> > >  * Power-off the infinite DHCP client
> > >  * Sample several days the cache dump
> > >  * Report when the DNS entry of the powered-off server is gone
> > >
> >
> > Thanks! That makes sense. I will give that a shot.
>
>
> Cool.  I look forward on feedback.
>
>
>
> Groeten
> Geert Stappers
> --
> Silence is hard to parse
>
> ___
> 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] IPv6 host-id

2020-04-22 Thread Jiawen Chen
Thanks! That makes sense. I actually do dual-boot my living room PC but not
very often and there are only a few configurations. So I can just
statically add their DUID/IAIDs to dhcp-host.

I guess the problem you're referring to is that dhcp-host only supports a
single "id:" option instead of a set for DHCPv6. For DHCPv4, it is clear
and makes sense: you can use multiple, mutually exclusive MAC addresses and
optionally append "id:*" to ignore the client-id.

On Tue, Apr 21, 2020 at 10:13 AM Pali Rohár  wrote:

> On Tuesday 21 April 2020 08:27:49 Geert Stappers wrote:
> > On Mon, Apr 20, 2020 at 10:27:11PM -0400, Jiawen Chen wrote:
> > > # Assign 192.168.0.150 and [::0:1000] to my living room pc
> > >
> dhcp-host=,192.168.0.150,[::0:1000],livingroom.internal,12h
> > >
> > > # Assign 192.168.0.151 and [::0:1001] to my file server
> > >
> dhcp-host=,192.168.0.151,[::0:1001],fileserver.internal,12h
> > > ```
> > >
> > > Sadly, the host-id-only notation ([::0:1000]) does not appear permitted
> > > when dnsmasq parses /etc/hosts.
> > >
> > > Any suggestions would be greatly appreciated!
> >
> > FWIW  I  suggest configuration syntax that allows
> >
> >
> dhcp-host=,192.168.0.150,[interface(br0)::0:1000],livingroom.internal,12h
>
> Hello Jiawen! Beware that IPv6 address does not have to be assigned
> based on MAC address settings in config file. MAC to IPv6 assignment is
> not enforced by dnsmasq and if your DHCPv6 client changes DUID or IAID
> (e.g. dualbooting to different OS or PXE or reinstalling OS) then some
> another free IPv6 address would be assigned for your PC identified by
> . There is my pending patch which should fix
> this problem and when user want then IPv6 address would be enforced for
> particular MAC address.
>
> --
> Pali Rohár
> pali.ro...@gmail.com
>
___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss


Re: [Dnsmasq-discuss] DHCPv6 with IPv4 address in last 32 bits of IPv6 address: ideas?

2020-04-22 Thread William Edwards

> Op 22 apr. 2020 om 08:41 heeft Olaf Hering  het volgende 
> geschreven:
> 
> Am Tue, 21 Apr 2020 15:58:25 +0200
> schrieb "William Edwards" :
> 
>> Ideas are welcome.
> 
> You did not say how hosts are identified, nor did you say why exactly 
> addresses matter in your setup.
> If it is done based on their MAC addresses, just give each host a name.
> 
> host-record=hostname,hostname.${dns_domain},${ipv4},${ipv6_prefix}::0323:45ff:feab:cdef
> dhcp-host=01:23:45:ab:cd:ef,set:hostname,hostname,216000
> 
> After all this project is called DNSmasq, not DHCPmasq...

Your position is clear. What I’ll probably do is write a config file in 
dnsmasq.d/ with dhcp-host directive from my dhcp-script, after handing out a v4 
lease and replacing . with :.

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


Re: [Dnsmasq-discuss] DHCPv6 with IPv4 address in last 32 bits of IPv6 address: ideas?

2020-04-22 Thread Olaf Hering
Am Tue, 21 Apr 2020 15:58:25 +0200
schrieb "William Edwards" :

> Ideas are welcome.

You did not say how hosts are identified, nor did you say why exactly addresses 
matter in your setup.
If it is done based on their MAC addresses, just give each host a name.

host-record=hostname,hostname.${dns_domain},${ipv4},${ipv6_prefix}::0323:45ff:feab:cdef
dhcp-host=01:23:45:ab:cd:ef,set:hostname,hostname,216000

After all this project is called DNSmasq, not DHCPmasq...

Olaf


pgpzJJQmKL2eN.pgp
Description: Digitale Signatur von OpenPGP
___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss