<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, 21 Oct 2021 at 03:04, Geert Stappers via Dnsmasq-discuss <<a href="mailto:dnsmasq-discuss@lists.thekelleys.org.uk">dnsmasq-discuss@lists.thekelleys.org.uk</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Wed, Oct 20, 2021 at 10:56:02PM +0200, Geert Stappers wrote:<br>
> On Wed, Oct 20, 2021 at 02:48:27PM +0530, Shrenik Bhura wrote:<br>
> > On Wed, 20 Oct, 2021, 11:21 Geert Stappers wrote:<br>
> > > On Wed, Oct 20, 2021 at 07:50:58AM +0530, Shrenik Bhura wrote:<br>
> > > > There isn't anything specific in the configuration that serves the<br>
> > > > hostname. I am aware of this feature and when defined it works as desired.<br>
> > > > But when nothing is explicitly defined to serve hostnames, it is defaulting<br>
> > > > to 192 as visible in the logs, and only in the case of an RPi.<br>
> > > > When checked on the client with the hostname command, it shows the full<br>
> > > > hostname - 192.168.67.53<br>
> > ><br>
> > > Such hostname do I call  IPaddress.<br>
> > ><br>
> > ><br>
> > > > The same configuration works fine with a x86 system as no hostname is being<br>
> > > > served when none is defined.<br>
<br>
Yes, dnsmasq works great.<br>
<br>
<br>
> > > > Have attached the config files involved.<br>
> > ><br>
> > > Make a packet capture and put the .pcap on a server.<br>
> > > Then tell here how to fetch the file.<br>
> > > Next can those who care examine the .pcap with their tool.<br>
> > > (wireshark / tcpdump)<br>
> > ><br>
> > > > Once again, do note that this is the case only for an RPi. So there is some<br>
> > > > specific logic in dnsmasq coming into play for an RPi that seems to be<br>
> > > > serving the IP address as the default hostname when none is present.<br>
> > ><br>
> > > So beside the<br>
> > >    /sbin/tcpdump  -w rpi.pcap ether host dc:a6:32:78:98:ae<br>
> > > also<br>
> > >    /sbin/tcpdump  -w worksfine.pcap ether host MAC_address_of_known_good<br>
> > ><br>
> > <br>
> > Herein is the link to the related packet captures of an RPi and x86 system<br>
> > -<br>
> > <a href="https://drive.google.com/file/d/11RwpCdbE8W0ohS2QDj4BarZ_VHnEhwfs/view?usp=sharing" rel="noreferrer" target="_blank">https://drive.google.com/file/d/11RwpCdbE8W0ohS2QDj4BarZ_VHnEhwfs/view?usp=sharing</a><br>
> > <br>
> <br>
> The "works fine" is/was captured different as the Raspi capture.<br>
> Luckly is the Raspi packet capture the better one, it contains replies.<br>
> <br>
> What `tshark` says about it.<br>
> Note the packet count and the time offset (columns 1 and 2)<br>
> and that there are three transactions.<br>
> <br>
> <br>
> |$ tshark -nr rpi.pcap | grep DHCP<br>
> |    1   0.000000      0.0.0.0 → 255.255.255.255 DHCP 364 DHCP Discover - Transaction ID 0x6e9ddeb7<br>
> |    2   0.001666 192.168.67.1 → 192.168.67.53 DHCP 425 DHCP Offer      - Transaction ID 0x6e9ddeb7<br>
> |    3   0.059905      0.0.0.0 → 255.255.255.255 DHCP 351 DHCP Request  - Transaction ID 0x6e9ddeb7<br>
> |    7   0.106212 192.168.67.1 → 192.168.67.53 DHCP 344 DHCP ACK        - Transaction ID 0x6e9ddeb7<br>
<br>
> |119315  40.665138      0.0.0.0 → 255.255.255.255 DHCP 590 DHCP Discover - Transaction ID 0x378f8d8b<br>
> |119316  40.668636 192.168.67.1 → 192.168.67.53 DHCP 342 DHCP Offer      - Transaction ID 0x378f8d8b<br>
> |119317  40.673119      0.0.0.0 → 255.255.255.255 DHCP 590 DHCP Request  - Transaction ID 0x378f8d8b<br>
> |119318  40.727456 192.168.67.1 → 192.168.67.53 DHCP 342 DHCP ACK        - Transaction ID 0x378f8d8b<br>
<br>
> |119324  44.861769      0.0.0.0 → 255.255.255.255 DHCP 342 DHCP Discover - Transaction ID 0x6f84b210<br>
> |119325  44.866031 192.168.67.1 → 192.168.67.53 DHCP 342 DHCP Offer      - Transaction ID 0x6f84b210<br>
> |119326  44.866612      0.0.0.0 → 255.255.255.255 DHCP 342 DHCP Request  - Transaction ID 0x6f84b210<br>
> |119327  44.911006 192.168.67.1 → 192.168.67.53 DHCP 343 DHCP ACK        - Transaction ID 0x6f84b210<br>
> |$ <br>
> <br>
> <br>
> Tcpdump Verbose, `-v`, of that:<br>
> <br>
> $ tcpdump -nr rpi.pcap -v port bootpc<br>
> reading from file rpi.pcap, link-type EN10MB (Ethernet), snapshot length 262144<br>
> 10:48:00.072173 IP (tos 0x0, ttl 64, id 20588, offset 0, flags [none], proto UDP (17), length 350)<br>
>     0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from dc:a6:32:78:98:ae, length 322, xid 0x6e9ddeb7, Flags [none]<br>
>         Client-Ethernet-Address dc:a6:32:78:98:ae<br>
>         Vendor-rfc1048 Extensions<br>
>           Magic Cookie 0x63825363<br>
>           DHCP-Message (53), length 1: Discover<br>
<br>
DHCP Discover<br>
<br>
>           Parameter-Request (55), length 14: <br>
>             Subnet-Mask (1), Default-Gateway (3), Vendor-Option (43), Vendor-Class (60)<br>
>             TFTP (66), BF (67), Unknown (128), Unknown (129)<br>
>             Unknown (130), Unknown (131), Unknown (132), Unknown (133)<br>
>             Unknown (134), Unknown (135)<br>
>           Vendor-Class (60), length 32: "PXEClient:Arch:00000:UNDI:002001"<br>
>           ARCH (93), length 2: 0<br>
<br>
And  ARCH 0  is "PC" ...<br>
<br>
<br>
>           NDI (94), length 3: 1.2.1<br>
>           GUID (97), length 17: 0.82.80.105.52.18.49.192.0.50.120.152.174.94.119.158.94<br>
> 10:48:00.073839 IP (tos 0xc0, ttl 64, id 5852, offset 0, flags [none], proto UDP (17), length 411)<br>
>     192.168.67.1.67 > 192.168.67.53.68: BOOTP/DHCP, Reply, length 383, xid 0x6e9ddeb7, Flags [none]<br>
>         Your-IP 192.168.67.53<br>
>         Server-IP 192.168.67.1<br>
>         Client-Ethernet-Address dc:a6:32:78:98:ae<br>
>         Vendor-rfc1048 Extensions<br>
>           Magic Cookie 0x63825363<br>
>           DHCP-Message (53), length 1: Offer<br>
<br>
DHCP Offer<br>
<br>
<br>
>           Server-ID (54), length 4: 192.168.67.1<br>
>           Lease-Time (51), length 4: 43200<br>
>           BF (67), length 19: "ltsp/undionly.kpxe^@"<br>
>           RN (58), length 4: 21600<br>
>           RB (59), length 4: 37800<br>
>           Subnet-Mask (1), length 4: 255.255.255.0<br>
>           BR (28), length 4: 192.168.67.255<br>
>           Default-Gateway (3), length 4: 192.168.67.1<br>
>           Vendor-Class (60), length 9: "PXEClient"<br>
>           GUID (97), length 17: 0.82.80.105.52.18.49.192.0.50.120.152.174.94.119.158.94<br>
>           Vendor-Option (43), length 44: 6.1.3.10.4.0.80.88.69.8.7.128.4.1.192.168.67.1.9.23.128.4.20.82.97.115.112.98.101.114.114.121.32.80.105.32.66.111.111.116.32.32.32.255<br>
> 10:48:00.132078 IP (tos 0x0, ttl 64, id 20590, offset 0, flags [none], proto UDP (17), length 337)<br>
>     0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from dc:a6:32:78:98:ae, length 309, xid 0x6e9ddeb7, Flags [none]<br>
>         Server-IP 192.168.67.1<br>
>         Client-Ethernet-Address dc:a6:32:78:98:ae<br>
>         Vendor-rfc1048 Extensions<br>
>           Magic Cookie 0x63825363<br>
>           DHCP-Message (53), length 1: Request<br>
<br>
DHCP Request<br>
<br>
<br>
>           Requested-IP (50), length 4: 192.168.67.53<br>
>           Server-ID (54), length 4: 192.168.67.1<br>
>           Vendor-Class (60), length 32: "PXEClient:Arch:00000:UNDI:002001"<br>
>           GUID (97), length 17: 0.82.80.105.52.18.49.192.0.50.120.152.174.94.119.158.94<br>
> 10:48:00.178385 IP (tos 0xc0, ttl 64, id 5869, offset 0, flags [none], proto UDP (17), length 330)<br>
>     192.168.67.1.67 > 192.168.67.53.68: BOOTP/DHCP, Reply, length 302, xid 0x6e9ddeb7, Flags [none]<br>
>         Your-IP 192.168.67.53<br>
>         Server-IP 192.168.67.1<br>
>         Client-Ethernet-Address dc:a6:32:78:98:ae<br>
>         Vendor-rfc1048 Extensions<br>
>           Magic Cookie 0x63825363<br>
>           DHCP-Message (53), length 1: ACK<br>
<br>
DHCP Acknowledge<br>
<br>
<br>
>           Server-ID (54), length 4: 192.168.67.1<br>
>           Lease-Time (51), length 4: 43200<br>
>           RN (58), length 4: 21600<br>
>           RB (59), length 4: 37800<br>
>           Subnet-Mask (1), length 4: 255.255.255.0<br>
>           BR (28), length 4: 192.168.67.255<br>
>           Default-Gateway (3), length 4: 192.168.67.1<br>
>           LOG (7), length 4: 192.168.67.1<br>
>           Domain-Name-Server (6), length 8: 8.8.8.8,8.8.8.8<br>
<br>
First "DHCP Cycle" is complete.<br>
Next DHCP Cycle starts.<br>
<br>
> 10:48:40.737311 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto UDP (17), length 576)<br>
>     0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from dc:a6:32:78:98:ae, length 548, xid 0x378f8d8b, Flags [none]<br>
>         Client-Ethernet-Address dc:a6:32:78:98:ae<br>
>         Vendor-rfc1048 Extensions<br>
>           Magic Cookie 0x63825363<br>
>           DHCP-Message (53), length 1: Discover<br>
<br>
DHCP Discover<br>
<br>
<br>
>           Parameter-Request (55), length 9: <br>
>             Subnet-Mask (1), Default-Gateway (3), Domain-Name-Server (6), Hostname (12)<br>
>             Domain-Name (15), RP (17), MTU (26), YD (40)<br>
>             NTP (42)<br>
> 10:48:40.740809 IP (tos 0xc0, ttl 64, id 3785, offset 0, flags [none], proto UDP (17), length 328)<br>
>     192.168.67.1.67 > 192.168.67.53.68: BOOTP/DHCP, Reply, length 300, xid 0x378f8d8b, Flags [none]<br>
>         Your-IP 192.168.67.53<br>
>         Server-IP 192.168.67.1<br>
>         Client-Ethernet-Address dc:a6:32:78:98:ae<br>
>         Vendor-rfc1048 Extensions<br>
>           Magic Cookie 0x63825363<br>
>           DHCP-Message (53), length 1: Offer<br>
<br>
DHCP Offer<br>
<br>
<br>
>           Server-ID (54), length 4: 192.168.67.1<br>
>           Lease-Time (51), length 4: 43200<br>
>           RN (58), length 4: 21600<br>
>           RB (59), length 4: 37800<br>
>           Subnet-Mask (1), length 4: 255.255.255.0<br>
>           BR (28), length 4: 192.168.67.255<br>
>           Default-Gateway (3), length 4: 192.168.67.1<br>
>           Domain-Name-Server (6), length 8: 8.8.8.8,8.8.8.8<br>
> 10:48:40.745292 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto UDP (17), length 576)<br>
>     0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from dc:a6:32:78:98:ae, length 548, xid 0x378f8d8b, Flags [none]<br>
>         Client-Ethernet-Address dc:a6:32:78:98:ae<br>
>         Vendor-rfc1048 Extensions<br>
>           Magic Cookie 0x63825363<br>
>           DHCP-Message (53), length 1: Request<br>
<br>
DHCP Request<br>
<br>
<br>
>           Server-ID (54), length 4: 192.168.67.1<br>
>           Requested-IP (50), length 4: 192.168.67.53<br>
>           Parameter-Request (55), length 9: <br>
>             Subnet-Mask (1), Default-Gateway (3), Domain-Name-Server (6), Hostname (12)<br>
>             Domain-Name (15), RP (17), MTU (26), YD (40)<br>
>             NTP (42)<br>
> 10:48:40.799629 IP (tos 0xc0, ttl 64, id 3788, offset 0, flags [none], proto UDP (17), length 328)<br>
>     192.168.67.1.67 > 192.168.67.53.68: BOOTP/DHCP, Reply, length 300, xid 0x378f8d8b, Flags [none]<br>
>         Your-IP 192.168.67.53<br>
>         Server-IP 192.168.67.1<br>
>         Client-Ethernet-Address dc:a6:32:78:98:ae<br>
>         Vendor-rfc1048 Extensions<br>
>           Magic Cookie 0x63825363<br>
>           DHCP-Message (53), length 1: ACK<br>
<br>
DHCP Acknowledge<br>
<br>
<br>
>           Server-ID (54), length 4: 192.168.67.1<br>
>           Lease-Time (51), length 4: 43200<br>
>           RN (58), length 4: 21600<br>
>           RB (59), length 4: 37800<br>
>           Subnet-Mask (1), length 4: 255.255.255.0<br>
>           BR (28), length 4: 192.168.67.255<br>
>           Default-Gateway (3), length 4: 192.168.67.1<br>
>           Domain-Name-Server (6), length 8: 8.8.8.8,8.8.8.8<br>
<br>
Second "DHCP Cycle" is complete.<br>
> |119318  40.727456 192.168.67.1 → 192.168.67.53 DHCP 342 DHCP ACK        - Transaction ID 0x378f8d8b<br>
<br>
> }  Five  ICMPv6 packets<br>
<br>
> |119324  44.861769      0.0.0.0 → 255.255.255.255 DHCP 342 DHCP Discover - Transaction ID 0x6f84b210<br>
Next DHCP Cycle starts.<br>
<br>
> 10:48:44.933942 IP (tos 0x10, ttl 128, id 0, offset 0, flags [none], proto UDP (17), length 328)<br>
>     0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from dc:a6:32:78:98:ae, length 300, xid 0x6f84b210, Flags [none]<br>
>         Client-Ethernet-Address dc:a6:32:78:98:ae<br>
>         Vendor-rfc1048 Extensions<br>
>           Magic Cookie 0x63825363<br>
>           DHCP-Message (53), length 1: Discover<br>
<br>
DHCP Discover<br>
<br>
<br>
>           Hostname (12), length 13: "192.168.67.53"<br>
<br>
Client says "My hostname is '192.168.67.53'"<br>
<br>
>           Parameter-Request (55), length 13: <br>
>             Subnet-Mask (1), BR (28), Time-Zone (2), Default-Gateway (3)<br>
>             Domain-Name (15), Domain-Name-Server (6), Unknown (119), Hostname (12)<br>
>             Netbios-Name-Server (44), Netbios-Scope (47), MTU (26), Classless-Static-Route (121)<br>
>             NTP (42)<br>
> 10:48:44.938204 IP (tos 0xc0, ttl 64, id 3933, offset 0, flags [none], proto UDP (17), length 328)<br>
>     192.168.67.1.67 > 192.168.67.53.68: BOOTP/DHCP, Reply, length 300, xid 0x6f84b210, Flags [none]<br>
>         Your-IP 192.168.67.53<br>
>         Server-IP 192.168.67.1<br>
>         Client-Ethernet-Address dc:a6:32:78:98:ae<br>
>         Vendor-rfc1048 Extensions<br>
>           Magic Cookie 0x63825363<br>
>           DHCP-Message (53), length 1: Offer<br>
<br>
DHCP Offer<br>
<br>
<br>
>           Server-ID (54), length 4: 192.168.67.1<br>
>           Lease-Time (51), length 4: 43200<br>
>           RN (58), length 4: 21600<br>
>           RB (59), length 4: 37800<br>
>           Subnet-Mask (1), length 4: 255.255.255.0<br>
>           BR (28), length 4: 192.168.67.255<br>
>           Default-Gateway (3), length 4: 192.168.67.1<br>
>           Domain-Name-Server (6), length 8: 8.8.8.8,8.8.8.8<br>
> 10:48:44.938785 IP (tos 0x10, ttl 128, id 0, offset 0, flags [none], proto UDP (17), length 328)<br>
>     0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from dc:a6:32:78:98:ae, length 300, xid 0x6f84b210, Flags [none]<br>
>         Client-Ethernet-Address dc:a6:32:78:98:ae<br>
>         Vendor-rfc1048 Extensions<br>
>           Magic Cookie 0x63825363<br>
>           DHCP-Message (53), length 1: Request<br>
<br>
DHCP Request<br>
<br>
<br>
>           Server-ID (54), length 4: 192.168.67.1<br>
>           Requested-IP (50), length 4: 192.168.67.53<br>
>           Hostname (12), length 13: "192.168.67.53"<br>
<br>
Client says "My hostname is '192.168.67.53'"<br>
<br>
>           Parameter-Request (55), length 13: <br>
>             Subnet-Mask (1), BR (28), Time-Zone (2), Default-Gateway (3)<br>
>             Domain-Name (15), Domain-Name-Server (6), Unknown (119), Hostname (12)<br>
>             Netbios-Name-Server (44), Netbios-Scope (47), MTU (26), Classless-Static-Route (121)<br>
>             NTP (42)<br>
> 10:48:44.983179 IP (tos 0xc0, ttl 64, id 3934, offset 0, flags [none], proto UDP (17), length 329)<br>
>     192.168.67.1.67 > 192.168.67.53.68: BOOTP/DHCP, Reply, length 301, xid 0x6f84b210, Flags [none]<br>
>         Your-IP 192.168.67.53<br>
>         Server-IP 192.168.67.1<br>
>         Client-Ethernet-Address dc:a6:32:78:98:ae<br>
>         Vendor-rfc1048 Extensions<br>
>           Magic Cookie 0x63825363<br>
>           DHCP-Message (53), length 1: ACK<br>
<br>
DHCP Acknowledge<br>
<br>
<br>
>           Server-ID (54), length 4: 192.168.67.1<br>
>           Lease-Time (51), length 4: 43200<br>
>           RN (58), length 4: 21600<br>
>           RB (59), length 4: 37800<br>
>           Subnet-Mask (1), length 4: 255.255.255.0<br>
>           BR (28), length 4: 192.168.67.255<br>
>           Default-Gateway (3), length 4: 192.168.67.1<br>
>           Hostname (12), length 3: "192"<br>
<br>
Server says "Your hostname is '192'"<br></blockquote><div><br></div><div>May be the code that logs this line needs to be checked if it is just printing part of the complete hostname i.e. IP address.</div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
>           Domain-Name-Server (6), length 8: 8.8.8.8,8.8.8.8<br>
> <br>
> <br>
> More in the next message.<br>
<br>
Done "in line"<br>
<br>
<br>
Back to:<br>
> > > On Wed, Oct 20, 2021 at 07:50:58AM +0530, Shrenik Bhura wrote:<br>
> > > > There isn't anything specific in the configuration that serves the<br>
> > > > hostname. I am aware of this feature and when defined it works as desired.<br>
<br>
Acknowledge on "it works as desired".<br>
<br>
<br>
> > > > But when nothing is explicitly defined to serve hostnames,<br>
> > > > it is defaulting to 192 as visible in the logs,<br>
<br>
There I tent to disagree.<br>
<br>
<br>
> > > > and only in the case of an RPi.<br>
<br>
I do read that as<br>
  "There are some more factors. There are yet unknown factors."<br></blockquote><div><br></div><div>Nothing more to be shared from my end. With the inputs that I have shared, anyone in possession of a RPi 4B or RPi 400 should be able to reproduce this.</div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
<br>
> > > > When checked on the client with the hostname command,<br>
> > > > it shows the full hostname - 192.168.67.53<br>
<br>
Yes. And the question is:  How did it get there?<br>
<br></blockquote><div><br></div><div>I have no clue. I have just reported the facts and nothing more, nothing less. :)</div><div> You guys are the experts.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Groeten<br>
Geert Stappers<br><br></blockquote><div><br></div><div>Regards</div><div>Shrenik<br></div></div></div>