This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Is there any way that I can get DHCP table?
#5
(31.12.2020, 13:09)admin Wrote: This has to be done on your router. See if you can enable a static DHCP entry for a certain MAC.

How can some software like Fing on mobile or Angry IP Scanner can scan all IP in the network so fast, They send some UDP packet and get response I think?. I use packet capture and see that they send request to port 137 (NetBios) of all the IP from .1 to .255 and see the response to see if the IP is available. I want to do something like that, is it possible

(31.12.2020, 13:09)admin Wrote: This has to be done on your router. See if you can enable a static DHCP entry for a certain MAC.

And the device will be move from house to house, it means that I should write a code to detect the device so I don't need to setup every router that it will be install.


Currently I use this code to ping to every IP from 1 to 255 and find it but it's way too slow. So it's best if I can find IP of all device on the network, and look for it by it's name or MAC but I dont know how to do
1
Code:
for i = 1, 255 do
  ip = '192.168.1.' .. i
  res = os.execute('ping -c 2 -W 1 ' .. ip)
  if res == 0 then
    url='http://'..ip..'/httpapi.asp?command=getPlayerStatus'
    require('socket.http')
    res, err = socket.http.request(url)
    if res ~= nil then
      t1, t2 = string.find(res, 'Artist')
      if t1 ~= nil then
          --my code
      break
   end
  end
end
Reply


Messages In This Thread
RE: Is there any way that I can get DHCP table? - by pouralise - 31.12.2020, 13:14

Forum Jump: