Help: ping -a hostname don't work with 21.02

Dear,
I try to explain my issue.

My computer is connected to network 192.168.1.xxx
My router with openwrt 21.02.1 is connected to this network (wifi client or wan) and he have an ip ex. 192.168.1.100 and his hostname is MyRouter1
If from my computer I try to ping -a MyRouter1 I get the message (Host not reachable).

If in my Router1 I install openwrt 19.07.8 it works perfectly

ping -a Myrouter1

Esecuzione di Ping Myrouter1 [192.168.1.100] con 32 byte di dati:
Risposta da 192.168.1.100: byte=32 durata=4ms TTL=64
Risposta da 192.168.1.100: byte=32 durata=2ms TTL=64
Risposta da 192.168.1.100: byte=32 durata=2ms TTL=64
Risposta da 192.168.1.100: byte=32 durata=2ms TTL=64

Why with openwrt 21.02 is not possible to get ip address of router connected to my network with ping command? What I made wrong?

This is the network config and hostname are present


config interface 'loopback'
	option device 'lo'
	option proto 'static'
	option ipaddr '127.0.0.1'
	option netmask '255.0.0.0'

config globals 'globals'
	option ula_prefix 'fd31:5f30:63d4::/48'

config device
	option name 'br-lan'
	option type 'bridge'
	list ports 'eth0'
	option ipv6 '0'

config device
	option name 'eth0'
	option ipv6 '0'

config device
	option name 'wlan0'
	option ipv6 '0'

config device
	option name 'wlan0-1'
	option ipv6 '0'

config device
	option name 'eth1'
	option ipv6 '0'

config interface 'lan'
	option device 'br-lan'
	option proto 'static'
	option netmask '255.255.255.0'
	option ipaddr '192.168.14.1'
	option hostname 'MyRouter1'

config interface 'wan'
	option device 'eth1'
	option proto 'dhcp'
	option delegate '0'
	option hostname 'MyRouter1'

config interface 'wwan'
	option proto 'dhcp'
	option delegate '0'
	option hostname 'MyRouter1'

Thanks! Any suggestion will be appreciated

Does the nameserver you are using on your computer know about this name when the router is connected? You can query it directly: nslookup Myrouter1 192.168.1.1 where 192.168.1.1 is the IP of the NS you are using in your lan.
Typically the router will send this hostname when it requests dhcp settings. And usually the dhcp server will update the dns records with that name.

1 Like

thanks for your reply.
No, non existent domain

nslookup MyRouter1 192.168.1.1
Server:  LinksysXXX
Address:  192.168.1.1

*** LinksysXXX non è in grado di trovare MyRouter1: Non-existent domain

Nslookup with ip...

nslookup 192.168.1.100
Server:  LinksysXXX
Address:  192.168.1.1

Nome:    MyRouter1
Address:  192.168.1.100

Seems that something is locked with openwrt 21.02

Maybe the Linksys is expecting an FQDN instead of just the hostname.
GIven that the only involvement of OpenWrt in this problem is whether it sends out the hostname when it asks for dhcp, we can verify that doing the following:
opkg update; opkg install tcpdump; tcpdump -i any -evn udp port 67 then restart the wwan interface, let it capture the packets, stop with Ctrl-c and paste here the output.

1 Like

This is the output:

16:30:03.547785 Out 94:83:c4:0c:84:63 ethertype IPv4 (0x0800), length 344: (tos 0x0, ttl 64, id 9469, offset 0, flags [DF], proto UDP (17), length 328)
    192.168.1.100.68 > 192.168.1.1.67: BOOTP/DHCP, Request from 94:83:c4:0c:84:63, length 300, xid 0x31bdbe7d, secs 2406, Flags [none]
          Client-IP 192.168.1.100
          Client-Ethernet-Address 94:83:c4:0c:84:63
          Vendor-rfc1048 Extensions
            Magic Cookie 0x63825363
            DHCP-Message Option 53, length 1: Release
            Server-ID Option 54, length 4: 192.168.1.1
16:30:06.303632 Out 94:83:c4:0c:84:63 ethertype IPv4 (0x0800), length 344: (tos 0x0, ttl 64, 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 94:83:c4:0c:84:63, length 300, xid 0x1379b004, Flags [none]
          Client-Ethernet-Address 94:83:c4:0c:84:63
          Vendor-rfc1048 Extensions
            Magic Cookie 0x63825363
            DHCP-Message Option 53, length 1: Discover
            MSZ Option 57, length 2: 576
            Parameter-Request Option 55, length 8:
              Subnet-Mask, Default-Gateway, Domain-Name-Server, Hostname
              Domain-Name, BR, NTP, Classless-Static-Route
            Vendor-Class Option 60, length 12: "udhcp 1.33.1"
            Hostname Option 12, length 13: "MyRouter1"
16:30:09.212447 Out 94:83:c4:0c:84:63 ethertype IPv4 (0x0800), length 344: (tos 0x0, ttl 64, 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 94:83:c4:0c:84:63, length 300, xid 0x1379b004, secs 3, Flags [none]
          Client-Ethernet-Address 94:83:c4:0c:84:63
          Vendor-rfc1048 Extensions
            Magic Cookie 0x63825363
            DHCP-Message Option 53, length 1: Discover
            MSZ Option 57, length 2: 576
            Parameter-Request Option 55, length 8:
              Subnet-Mask, Default-Gateway, Domain-Name-Server, Hostname
              Domain-Name, BR, NTP, Classless-Static-Route
            Vendor-Class Option 60, length 12: "udhcp 1.33.1"
            Hostname Option 12, length 13: "MyRouter1"
16:30:09.312162  In e4:95:6e:43:11:d8 ethertype IPv4 (0x0800), length 344: (tos 0xc0, ttl 64, id 37169, offset 0, flags [none], proto UDP (17), length 328)
    192.168.1.1.67 > 192.168.1.100.68: BOOTP/DHCP, Reply, length 300, xid 0x1379b004, Flags [none]
          Your-IP 192.168.1.100
          Server-IP 192.168.1.1
          Client-Ethernet-Address 94:83:c4:0c:84:63
          Vendor-rfc1048 Extensions
            Magic Cookie 0x63825363
            DHCP-Message Option 53, length 1: Offer
            Server-ID Option 54, length 4: 192.168.1.1
            Lease-Time Option 51, length 4: 43200
            RN Option 58, length 4: 21600
            RB Option 59, length 4: 37800
            Subnet-Mask Option 1, length 4: 255.255.255.0
            BR Option 28, length 4: 192.168.1.255
            Default-Gateway Option 3, length 4: 192.168.1.1
            Domain-Name-Server Option 6, length 4: 192.168.1.1
16:30:09.312759 Out 94:83:c4:0c:84:63 ethertype IPv4 (0x0800), length 344: (tos 0x0, ttl 64, 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 94:83:c4:0c:84:63, length 300, xid 0x1379b004, secs 3, Flags [none]
          Client-Ethernet-Address 94:83:c4:0c:84:63
          Vendor-rfc1048 Extensions
            Magic Cookie 0x63825363
            DHCP-Message Option 53, length 1: Request
            Requested-IP Option 50, length 4: 192.168.1.100
            Server-ID Option 54, length 4: 192.168.1.1
            MSZ Option 57, length 2: 576
            Parameter-Request Option 55, length 8:
              Subnet-Mask, Default-Gateway, Domain-Name-Server, Hostname
              Domain-Name, BR, NTP, Classless-Static-Route
            Vendor-Class Option 60, length 12: "udhcp 1.33.1"
            Hostname Option 12, length 13: "MyRouter1"
16:30:09.315339  In e4:95:6e:43:11:d8 ethertype IPv4 (0x0800), length 344: (tos 0xc0, ttl 64, id 37170, offset 0, flags [none], proto UDP (17), length 328)
    192.168.1.1.67 > 192.168.1.100.68: BOOTP/DHCP, Reply, length 300, xid 0x1379b004, secs 3, Flags [none]
          Your-IP 192.168.1.100
          Server-IP 192.168.1.1
          Client-Ethernet-Address 94:83:c4:0c:84:63
          Vendor-rfc1048 Extensions
            Magic Cookie 0x63825363
            DHCP-Message Option 53, length 1: Offer
            Server-ID Option 54, length 4: 192.168.1.1
            Lease-Time Option 51, length 4: 43200
            RN Option 58, length 4: 21600
            RB Option 59, length 4: 37800
            Subnet-Mask Option 1, length 4: 255.255.255.0
            BR Option 28, length 4: 192.168.1.255
            Default-Gateway Option 3, length 4: 192.168.1.1
            Domain-Name-Server Option 6, length 4: 192.168.1.1
16:30:09.318888  In e4:95:6e:43:11:d8 ethertype IPv4 (0x0800), length 351: (tos 0xc0, ttl 64, id 37171, offset 0, flags [none], proto UDP (17), length 335)
    192.168.1.1.67 > 192.168.1.100.68: BOOTP/DHCP, Reply, length 307, xid 0x1379b004, secs 3, Flags [none]
          Your-IP 192.168.1.100
          Server-IP 192.168.1.1
          Client-Ethernet-Address 94:83:c4:0c:84:63
          Vendor-rfc1048 Extensions
            Magic Cookie 0x63825363
            DHCP-Message Option 53, length 1: ACK
            Server-ID Option 54, length 4: 192.168.1.1
            Lease-Time Option 51, length 4: 43200
            RN Option 58, length 4: 21600
            RB Option 59, length 4: 37800
            Subnet-Mask Option 1, length 4: 255.255.255.0
            BR Option 28, length 4: 192.168.1.255
            Default-Gateway Option 3, length 4: 192.168.1.1
            Domain-Name-Server Option 6, length 4: 192.168.1.1
            Hostname Option 12, length 13: "MyRouter1"


It is correct, in all packets there is:

Even in the final DHCP reply from the server it is included.

1 Like

Sorry, I forgot to tell you that on the routers it is installed samba.
On router with 19.07 samba36
On router with 21.02 ksmbd.

so, the issue is solved by wsdd2.
On wsdd2 /etc/init.d/wsdd2 I remove this line below to serve all devices wan wwan and lan

#[ -n "$ifname" ] && procd_append_param command -i "$ifname"

and added these rule on firewall

config rule
	option name 'AllowKSMB1'
	option target 'ACCEPT'
	option dest_port '3702'
	option src '*'
	
config rule
	option name 'AllowKSMB2'
	option target 'ACCEPT'
	option dest_port '5355'
	option src '*'

Now if i ping my router name I get the ip.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.