FOR TIPS, gUIDES & TUTORIALS

subscribe to our Youtube

GO TO YOUTUBE

14455 questions

17168 answers

28195 comments

0 members

We are migrating to our new platform at https://community.teltonika.lt. Moving forward, you can continue discussions on this new platform. This current platform will be temporarily maintained for reference purposes.
0 votes
499 views 2 comments
by anonymous
Hi all, I am using RUT240 with firmware RUT2XX_R_00.01.14.5, my modem is connected to the internet through a SIM card and it is connected to some devices through the LAN interface(wired Ethernet connection).

Now, I would like to be able from one device in the LAN to ssh to another device using the device hostname but when I try this it always give me an error that the hostname can't be resolved.

I did one interesting trial where I changed the setup so that the two devices are connected to the modem through WIFI and actually in this case using the hostname worked!

I tried setting "rebind_protection" to '0' but it didn't help.

Any idea how to make the local hostname resolution work in the case where the devices are connected through the LAN interface? and I wish to have an explaination why it works in the case of WIFI.

Thanks in advance!

1 Answer

0 votes
by anonymous
Hello,

If a device gets its IP address via DHCP (wifi probably, maybe eth also) and the DHCP request frame contains the name of the requestor dnsmasq will add it to its leases file and it will be able to answer with this name when asked. For devices with static addresses the solution is to add a pair ipaddr-name to /etc/hosts (and killall -HUP dnsmasq to force a re-read of the file).

rebind-protection = 0 is required if you want dnsmasq to be able to reply via any interface, the use-case is in the context of VPNs or private networks.

Regards,
by anonymous
Thanks for your response!

I checked the "/etc/dhcp.leases" file and I see that for a certain device in the network the hostname is "*", I have many instances of that device in the network and all of them has an "*" as a hostname but other devices in the same LAN actually has the proper hostname in the leases file

Now, I tried to connect the device to a different network(home network) where I used "Fritz box" router and when I scan the network using nmap, it actually shows the hostname of this same device.

Do you know what might be different in both cases when using RUT240 and Fritz box routers that make hostname reported with one router but not the other?
by anonymous

For the devices having '*' instead of a hostname a workaround would be to add static leases to the dhcp server one for each device. I don't know what could be different when the Fritz box provides the lease a tcpdump of the request on the RUT may shed some light:

tcpdump -i br-lan -n -v -s 0 -o dhcpreq.pcap 'port 67 or port 68'

connect a device and look at the requests / replies with wireshark.