1

This question is semi - related to this one: Networking - Shared to other Computers - How to find a client's IP address?

My setup is such that I'm using laptop as ethernet gateway, and raspberry is a host. In the linked question, my answer has Wireshark capture screenshot clearly shows that there is DHCP request going to my laptop from raspberry and there is response. So far so good !

Many answers on the internet suggest to check /var/lib/NetworkManager/ directory or /var/lib/dhcp directory for the leases. Problem is that in all my searches I found only leases for IP addresses that were given to my laptop. What I am interested in is finding a record of lease that my laptop gave to raspberry.

And you can take my word for it - I've searched almost everything, didn't find nothing, but for the sake of being consistent and documenting everything, here's my grep search results . . .which are basically nothing.

$ grep -R '10.42.0.40' /var/lib/NetworkManager/                             
grep: /var/lib/NetworkManager/secret_key: Permission denied

$ sudo grep -R '10.42.0.40' /var/lib/NetworkManager/                        
[sudo] password for xieerqi: 

$ sudo grep -R '10.42.0.40' /etc/NetworkManager/system-connections/         
[sudo] password for xieerqi: 

$ sudo grep -R '10.42.0.40' /var/lib/dhcp/                                  
[sudo] password for xieerqi:

Output of netstat requested by muru:

$ sudo netstat -unlp | grep -w 67                                           
[sudo] password for xieerqi: 
udp        0      0 0.0.0.0:67              0.0.0.0:*                           14866/dnsmasq   
udp        0      0 0.0.0.0:67              0.0.0.0:*                           1696/dnsmasq 

1 Answers1

1

Given that the netstat output shows dnsmasq is the DHC server here, this mailing list post suggests /var/lib/misc/dnsmasq.leases as the file where leases are stored.

muru
  • 207,228