Re: [Dnsmasq-discuss] DHCP server not assigning IP to RTMU86

2022-05-20 Thread Simon Kelley


I have a theory:

In the logs, it takes between 7 and 9 seconds after carrier detect on 
eth0 (I guess that's when you plug the RTMU86 in?) before eth0 is 
allocated IP address 192.168.6.1. Until the address is allocated, 
dnsmasq will ignore DHCP requests and log


"DHCP packet received on eth0 which has no address"

If the RTMU86 send a DHCP discover faster than 7 seconds and doesn't 
retry in a reasonable time, that could explain the problem.


ISC dhcpd may not need the local interface to be configured with an IP 
address, which would explain the different behaviour.



The packet capture below shows just one DHCPDISCOVER being sent from
 0.0.0.0.bootpc > 255.255.255.255.bootps

and it's before the  IP 192.168.6.1 > igmp.mcast.net which markswhen 
eth0 gets an IP address.


If you repeat the same test and leave the capture running for a few 
minutes, do you see any more  0.0.0.0.bootpc > 255.255.255.255.bootps 
packets, and if you do, do they get a reply?


If I'm right, the solution may be to configure eth0 with a statis IP 
address, so it doesn't have to wait for dhcpcd to go through a lengthy 
process to give it an IP address every time the cable gets plugged in.



Simon.


On 15/05/2022 15:40, Kamil via Dnsmasq-discuss wrote:


On Sun, May 15, 2022 at 01:10:40AM +0200, Kamil via Dnsmasq-discuss
wrote:
 > On Sat, May 14, 2022 at 11:27:34AM +0200, Geert Stappers via
Dnsmasq-discuss wrote:
 > > On Sat, May 14, 2022 at 02:53:51AM +0200, Kamil via
Dnsmasq-discuss wrote:
   ...
 > > > 1. I plug one device - it works.
 > > > 2. I unplug it and plug the RTMU86 - doesn't work.
 > > > 3. I Unplug RTMU86 and plug any other device - it works.
 > > >
   ...
 > > Be yourself, accept yourself. Full focus on the challenge that
you are
 > > facing.
 >
 > Sure
 >

What proof is available of
the RTMU86 sending DHCP packages
when pluging the ethercable back in?


RTMU86 has a led indicator that is lid when the address has been 
assigned to it.
1. If I plug RTMU86 to the home router - the led is on, I can find its 
IP in the router's lease list and I can ping this IP
2. If I plug RTMU86 to the RPi with isc-dhcp-server configured - the led 
is on, I can find its IP in the isc-dhcp-server's lease list and I can 
ping this IP
3. If I plug RTMU86 to the RPi with Dnsmasq configured - I can use 
tcpdump which gives me this output (I changed MAC addresses):
 > 16:17:31.125779 IP 0.0.0.0.bootpc > 255.255.255.255.bootps: 
BOOTP/DHCP, Request from fa:XX:XX:XX:XX:1c (oui Unknown), length 300
So I presume that RTMU86 indeed sends DHCP packages, but the led is off 
and I can not find it in the Dnsmasq lease list.


Full tcpdump log (with changed MAC addresses) below:
 > 16:17:28.175124 IP6 :: > ff02::16: HBH ICMP6, multicast listener 
report v2, 2 group record(s), length 48
 > 16:17:28.187120 IP6 :: > ff02::16: HBH ICMP6, multicast listener 
report v2, 4 group record(s), length 88

 > 16:17:28.199412 ARP, Request who-has 192.168.6.1 tell 0.0.0.0, length 28
 > 16:17:28.235076 IP6 :: > ff02::16: HBH ICMP6, multicast listener 
report v2, 4 group record(s), length 88
 > 16:17:28.483118 IP6 :: > ff02::1:fffb:fe9: ICMP6, neighbor 
solicitation, who has fe80::XX:XX:XX:fe9, length 32
 > 16:17:29.507285 IP6 fe80::XX:XX:XX:fe9 > ff02::16: HBH ICMP6, 
multicast listener report v2, 5 group record(s), length 108
 > 16:17:29.507966 IP6 fe80::XX:XX:XX:fe9 > ip6-allrouters: ICMP6, 
router solicitation, length 16
 > 16:17:29.519049 IP6 fe80::XX:XX:XX:fe9 > ff02::16: HBH ICMP6, 
multicast listener report v2, 1 group record(s), length 28
 > 16:17:29.891065 IP6 fe80::XX:XX:XX:fe9 > ff02::16: HBH ICMP6, 
multicast listener report v2, 5 group record(s), length 108
 > 16:17:30.019064 IP6 fe80::XX:XX:XX:fe9 > ff02::16: HBH ICMP6, 
multicast listener report v2, 1 group record(s), length 28
 > 16:17:30.077265 IP6 fe80::XX:XX:XX:fe9.mdns > ff02::fb.mdns: 0*- [0q] 
2/0/0 (Cache flush) PTR myhost.local., (Cache flush)  
fe80::XX:XX:XX:fe9 (139)

 > 16:17:30.151935 ARP, Request who-has 192.168.6.1 tell 0.0.0.0, length 28
 > 16:17:31.125779 IP 0.0.0.0.bootpc > 255.255.255.255.bootps: 
BOOTP/DHCP, Request from fa:XX:XX:XX:XX:1c (oui Unknown), length 300

 > 16:17:31.728625 ARP, Request who-has 192.168.6.1 tell 0.0.0.0, length 28
 > 16:17:32.152301 IP6 fe80::XX:XX:XX:fe9.mdns > ff02::fb.mdns: 0*- [0q] 
2/0/0 (Cache flush) PTR myhost.local., (Cache flush)  
fe80::XX:XX:XX:fe9 (139)
 > 16:17:33.510623 IP6 fe80::XX:XX:XX:fe9 > ip6-allrouters: ICMP6, 
router solicitation, length 16
 > 16:17:33.730051 ARP, Request who-has 192.168.6.1 tell 192.168.6.1, 
length 28
 > 16:17:33.739141 IP 192.168.6.1 > igmp.mcast.net 
: igmp v3 report, 1 group record(s)


PS. I've read in FAQ about 255.255.255.255 broadcast and invalid 
firewall rules, but I don't have any firewall rules and I'm not changing 
network config files when switching to isc-dhcp-server (which I 

Re: [Dnsmasq-discuss] dhcp-host=hostnameonly does not work [solved]

2022-05-20 Thread Maulis Adam via Dnsmasq-discuss
Hello everybody,

finally I figured out. Thank you all for your support.

Working config:
/etc/hosts
192.168.64.200 cntemplate

dnsmasq.conf
dhcp-range=192.168.64.0,static,1d
dhcp-host=cntemplate

Dhcp request has a hostname field 'cntemplate'

Config that did not work:
/etc/hosts
192.168.64.200 cntemplate.hpc

Dhcp request has a hostname field 'cntemplate'



So the problem was that something didn't make the hostname -> fqdn change.

Regards,
Adam Maulis




On 5/19/22 16:46, Maulis Adam via Dnsmasq-discuss wrote:
> Hello,
>
> I like to configure my dhcp server with as little redundacy as
> possible. But it looks like the IP address needs to be written both of
> /etc/hosts and /etc/dnsmasq.conf
>
> The client machines are in the /etc/hosts for example:
>
> 192.168.64.200 cntemplate.hpc
>
> The non-default dnsmasq config options are:
>
> no-resolv
> server=192.168.5.251
> expand-hosts
> domain=hpc
>
> Case 1:
> dhcp-range=192.168.64.0,static
> dhcp-host=cntemplate
>
> Does not work, syslog said:
> May 19 15:53:47 gw00 dnsmasq-dhcp[4912]: DHCPDISCOVER(vlan164)
> 02:00:00:00:00:65 no address available
>
> Case 2:
> dhcp-range=192.168.64.0,static
> dhcp-host=cntemplate,192.168.64.200
>
> Working, but needed a duplicate entry both of /etc/hosts and
> /etc/dnsmasq.conf
>
> Case 3:
> dhcp-range=192.168.64.100,192.168.64.250
> dhcp-host=cntemplate,192.168.64.200
>
> Working, but needed a duplicate entry both of /etc/hosts and
> /etc/dnsmasq.conf
>
> Case 4:
> dhcp-range=192.168.64.100,192.168.64.250
> dhcp-host=cntemplate
>
> Does not work, syslog said:
> May 19 16:15:04 gw00 dnsmasq-dhcp[5282]: not giving name
> cntemplate.hpc to the DHCP lease of 192.168.64.215 because the name
> exists in /etc/hosts with address 192.168.64.200
>
>
>
>
>
> The client's DHCP requests (tcpdump)
>
> 02:00:00:00:00:65 > ff:ff:ff:ff:ff:ff, ethertype 802.1Q (0x8100),
> length 346: vlan 164, p 0, ethertype IPv4 (0x0800), (tos 0x10, ttl
> 128, id 0, offset 0, flags [none], proto UDP (17), length 328)
>     0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from
> 02:00:00:00:00:65, length 300, xid 0x619d4060, Flags [none]
>   Client-Ethernet-Address 02:00:00:00:00:65
>   Vendor-rfc1048 Extensions
>     Magic Cookie 0x63825363
>     DHCP-Message (53), length 1: Discover
>     Hostname (12), length 10: "cntemplate"
>     Parameter-Request (55), length 13:
>   Subnet-Mask (1), BR (28), Time-Zone (2), Default-Gateway
> (3)
>   Domain-Name (15), Domain-Name-Server (6), Unknown (119),
> Hostname (12)
>   Netbios-Name-Server (44), Netbios-Scope (47), MTU (26),
> Classless-Static-Route (121)
>   NTP (42)
>
> Server's config:
>
> ip addr show vlan164
> 6: vlan164@ens5:  mtu 1500 qdisc
> noqueue state UP group default qlen 1000
>     link/ether 52:54:00:12:34:58 brd ff:ff:ff:ff:ff:ff
>     inet 192.168.64.254/24 brd 192.168.64.255 scope global vlan164
>    valid_lft forever preferred_lft forever
>     inet6 fe80::5054:ff:fe12:3458/64 scope link
>    valid_lft forever preferred_lft forever
>
> cat /etc/debian_version
> 10.12
>
> uname -a
> Linux gw00 4.19.0-11-amd64 #1 SMP Debian 4.19.146-1 (2020-09-17)
> x86_64 GNU/Linux
>
> dpkg -l dnsmasq
> ii  dnsmasq    2.80-1+deb10u1 all  Small caching DNS proxy
> and DHCP/TFTP server
>
> I would be very happy with any advice
>
> Adam Maulis
>
>
> ___
> Dnsmasq-discuss mailing list
> Dnsmasq-discuss@lists.thekelleys.org.uk
> https://lists.thekelleys.org.uk/cgi-bin/mailman/listinfo/dnsmasq-discuss
___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
https://lists.thekelleys.org.uk/cgi-bin/mailman/listinfo/dnsmasq-discuss


Re: [Dnsmasq-discuss] dhcp-host=hostnameonly does not work

2022-05-20 Thread Matus UHLAR - fantomas via Dnsmasq-discuss

On 5/19/22 07:46, Maulis Adam via Dnsmasq-discuss wrote:
I like to configure my dhcp server with as little redundacy as 
possible. But it looks like the IP address needs to be written both 
of /etc/hosts and /etc/dnsmasq.conf


The client machines are in the /etc/hosts for example:

192.168.64.200 cntemplate.hpc

The non-default dnsmasq config options are:

no-resolv
server=192.168.5.251
expand-hosts
domain=hpc

Case 1:
dhcp-range=192.168.64.0,static
dhcp-host=cntemplate

Does not work, syslog said:
May 19 15:53:47 gw00 dnsmasq-dhcp[4912]: DHCPDISCOVER(vlan164) 
02:00:00:00:00:65 no address available


On 19.05.22 13:46, Michael Smith wrote:
Maybe I am not fully understanding your use case.   Here is how I have 
mine configured:



hosts:

192.168.101.10    hostname


dnsmasq.conf

dhcp-host=0c:9d:92:10:a1:8c,hostname


This ties the DHCP request (MAC) to the hostname and then the hostname 
to the ip in the hosts file.


just FYI, I use /etc/ethers for this, as this is unix database for mapping 
ethernet numbers to hostnames.


dnsmasq uses this database on my home router 


--
Matus UHLAR - fantomas, uh...@fantomas.sk ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
My mind is like a steel trap - rusty and illegal in 37 states.

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


Re: [Dnsmasq-discuss] dhcp-host=hostnameonly does not work

2022-05-20 Thread john doe

On 5/19/2022 11:42 PM, Maulis Adam wrote:



On 5/19/22 21:22, john doe wrote:

On 5/19/2022 4:46 PM, Maulis Adam via Dnsmasq-discuss wrote:

Hello,

I like to configure my dhcp server with as little redundacy as possible.
But it looks like the IP address needs to be written both of /etc/hosts
and /etc/dnsmasq.conf

The client machines are in the /etc/hosts for example:

192.168.64.200 cntemplate.hpc

The non-default dnsmasq config options are:

no-resolv
server=192.168.5.251
expand-hosts
domain=hpc

Case 1:
dhcp-range=192.168.64.0,static
dhcp-host=cntemplate

Does not work, syslog said:
May 19 15:53:47 gw00 dnsmasq-dhcp[4912]: DHCPDISCOVER(vlan164)
02:00:00:00:00:65 no address available

Case 2:
dhcp-range=192.168.64.0,static
dhcp-host=cntemplate,192.168.64.200

Working, but needed a duplicate entry both of /etc/hosts and
/etc/dnsmasq.conf

Case 3:
dhcp-range=192.168.64.100,192.168.64.250
dhcp-host=cntemplate,192.168.64.200

Working, but needed a duplicate entry both of /etc/hosts and
/etc/dnsmasq.conf

Case 4:
dhcp-range=192.168.64.100,192.168.64.250
dhcp-host=cntemplate



I might be missing something here but why do you use the option
'dhcp-host' if you specify the hostname in '/etc/hosts'?

--
John Doe



Thank you for your answer.
I thought that "dhcp-host" option is mandatory for fixed dhcp IPs.

Case 5:
dhcp-range=192.168.64.0,static
# no dhcp-host

Not working:
dnsmasq-dhcp[5505]: DHCPDISCOVER(vlan164) 02:00:00:00:00:65 no address
available

Case 6:
dhcp-range=192.168.64.0,static
# no dhcp-host

Not working:
dnsmasq-dhcp[5533]: not giving name cntemplate.hpc to the DHCP lease of
192.168.64.215 because the name exists in /etc/hosts with address
192.168.64.200



The IPs are not the same, try to remove this lease in the lease file.

--
John Doe

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