logo elektroda
logo elektroda
X
logo elektroda

How to find the IP address when I know the mac of the arduino device

klon111 1311 14
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 19241662
    klon111
    Level 11  
    Posts: 140
    Rate: 23
    Hello
    I have a problem as the router changes IP address after every reset.
    The router does not have the option to assign an IP to a MAC.
  • ADVERTISEMENT
  • #2 19241684
    cysiekw
    Level 42  
    Posts: 5429
    Help: 1002
    Rate: 1407
    klon111 wrote:
    router changes IP address.
    I understand you mean the ip of the tip which gets the address from the dhcp? if so set it hard on the tip
  • ADVERTISEMENT
  • #3 19241692
    bubu1769
    Level 43  
    Posts: 8047
    Help: 1175
    Rate: 2357
    Which router?
    You can usually assign IP data to a MAC address on any router.
  • #4 19241700
    klon111
    Level 11  
    Posts: 140
    Rate: 23
    D-Link DWR-116
  • #5 19241703
    karwo
    Level 31  
    Posts: 1545
    Help: 151
    Rate: 359
    Assign the Arduino device some IP address from the end of the router-assigned pool (one that would not normally be assigned by the router's DHCP to any device on your network).
  • #6 19241708
    klon111
    Level 11  
    Posts: 140
    Rate: 23
    How to do it, because I'm talking about a server on a Raspberry Pi

    Added after 4 [minutes]:

    For me the idea is to find the IP by MAC address .
    Nothing can be combined in the router .
    This code in the link does not find https://www.arduino.cc/en/Reference/EthernetGatewayIP
  • ADVERTISEMENT
  • #7 19241734
    Anonymous
    Level 1  
  • #8 19241739
    karwo
    Level 31  
    Posts: 1545
    Help: 151
    Rate: 359
    klon111 wrote:
    For me, the idea is to find the IP by MAC address .
    .
    But why do you need this? After all, every time you restart the router there will be a different IP on your server.
    In your server, set a fixed IP from the router pool - you will always have the same IP.
  • ADVERTISEMENT
  • #9 19241753
    klon111
    Level 11  
    Posts: 140
    Rate: 23
    The router is like this
    I will try to assign an IP on the Raspberry Pi
    Attachments:
    • How to find the IP address when I know the mac of the arduino device ruter.png (192.81 KB) You must be logged in to download this attachment.
  • #10 19241780
    cysiekw
    Level 42  
    Posts: 5429
    Help: 1002
    Rate: 1407
    Advanced network settings, see if you have static for dhcp there
  • #12 19241833
    klon111
    Level 11  
    Posts: 140
    Rate: 23
    cysiekw wrote:
    Advanced network settings see if you have static for dhcp there
    .

    dhcp - no such tab exists
    this router is good for scrap
  • #14 19242484
    klon111
    Level 11  
    Posts: 140
    Rate: 23
    Thanks for your help ex-or after setting on osmc the address is ok
  • #15 19260780
    JacekCz
    Level 42  
    Posts: 8670
    Help: 760
    Rate: 1460
    klon111 wrote:
    cysiekw wrote:
    Advanced network settings see if you have static for dhcp there
    .

    dhcp - no such tab exists
    this router is good for scrap
    .

    You are rambling
    page 38
    (I agree, it is not traditionally designed)

    Added after 15 [minutes]:

    EDIT:

    and information as in the title is displayed (on Windows)
    Code: Bash
    Log in, to see the code
    .

    and before that, it may be helpful to "annotate" all hosts on the local network with 255 (or respectively) on all zeros of the mask (let's assume the mask is a.b.c.0)
    That is, in other words, renewing the arp tables

    Code: Bash
    Log in, to see the code

Topic summary

✨ The discussion revolves around finding the IP address of an Arduino device when only the MAC address is known, particularly in a scenario where the router frequently changes IP addresses and lacks the option to assign static IPs to MAC addresses. Users suggest assigning a fixed IP address to the Arduino from the router's DHCP pool, ensuring it does not conflict with other devices. The D-Link DWR-116 router is specifically mentioned, with users discussing the limitations of its DHCP settings. Some users recommend using ARP commands to identify devices on the network and suggest configuring the Raspberry Pi to use a static IP address within the DHCP range. The conversation highlights the importance of network configuration for maintaining consistent device connectivity.
Generated by the language model.

FAQ

TL;DR: Stop changing IPs after reboots with a 2‑step static‑IP setup: "set the upper range of dhcp addresses." This FAQ is for Arduino/Raspberry Pi users whose router resets change device IPs. You’ll lock the IP or find it by MAC when needed. [Elektroda, ex-or, post #19242151]

Why it matters: Stable LAN IPs prevent broken connections, failed scripts, and time‑wasting device hunts.

Quick Facts

How do I find a device’s IP if I only know its MAC?

Use ARP from a machine on the same LAN. First, generate traffic to the subnet’s broadcast (e.g., ping a.b.c.255). Then list the ARP table with arp -a and match the known MAC to its IP. Note that ARP may not show inactive hosts until you “wake” them with traffic. This is the fastest no‑router‑login method on Windows and similar on other OSes. [Elektroda, JacekCz, post #19260780]

Why does my device’s IP change after every router restart?

Your device likely uses DHCP. After a router reboot, the DHCP server can hand out a different address. Fix it by configuring a static IP on the device. That keeps the address constant across reboots and power cycles. This is preferred for servers and controllers. [Elektroda, cysiekw, post #19241684]

What’s the quickest way to keep my Raspberry Pi’s IP stable?

Limit the DHCP pool and set a static IP just beyond it. How‑To: 1. In the router, set the DHCP upper range to .200. 2. On the Raspberry Pi, set a static IP like .201. 3. Reboot the Pi and router to apply changes. This avoids lease changes and conflicts. [Elektroda, ex-or, post #19242151]

Does the D-Link DWR-116 support DHCP reservations by MAC?

A user reported the UI lacked a DHCP reservation tab on the DWR‑116. If you can’t find reservations, use device‑level static IP and adjust the DHCP pool to avoid collisions. That achieves the same outcome: a stable LAN address for your device. [Elektroda, klon111, post #19241833]

The Arduino EthernetGatewayIP example can’t find my gateway—what should I change?

The example sketch hardcodes 10.0.0.177. If your router’s subnet differs, the Arduino won’t communicate. Change the sketch’s static IP to match your LAN’s subnet, or use DHCP temporarily to discover settings. Matching subnets is essential for routing to work. [Elektroda, khoam, post #19241734]

Where should I assign a static IP to avoid conflicts?

Pick an address outside or at the end of the router’s DHCP pool. For example, if the pool ends at .200, use .201 for the device. This prevents the DHCP server from leasing the same address to another host. [Elektroda, karwo, post #19241703]

I don’t see reservations—where else should I look in my router?

Open Advanced network settings and search for terms like “Static DHCP,” “Address Reservation,” or “DHCP binding.” Some UIs hide this under advanced or LAN pages. If it’s missing, use a device‑side static IP instead. [Elektroda, cysiekw, post #19241780]

What Windows command maps MAC addresses to IPs quickly?

Run arp -a in a Command Prompt. If entries look stale or empty, first ping the subnet broadcast (a.b.c.255) to refresh the ARP cache. Then rerun arp -a and match the MAC to its IP. [Elektroda, JacekCz, post #19260780]

How do I determine the correct subnet for my Arduino/RPi network?

Check the router’s IP as seen by your Raspberry Pi. Make your Arduino’s static IP fall within that subnet, including matching the netmask and gateway. Mismatched subnets break communication and gateway discovery. [Elektroda, khoam, post #19241734]

Will setting a fixed server IP really keep it stable across reboots?

Yes. As one expert put it, “you will always have the same IP.” Assign a static IP on the server and keep it outside the DHCP pool. This prevents the DHCP server from changing it on reboot. [Elektroda, karwo, post #19241739]

Is there an official D-Link guide for static IP assignment?

See D-Link’s FAQ for model DWR‑921 on assigning a static IP to connected devices. While the UI differs by model, the principles—reserving or statically assigning addresses—are similar across D-Link routers. [D-Link FAQ: Static IP on DWR-921]

What finally worked for the original poster (OSMC on Raspberry Pi)?

They set a static IP within OSMC for the Raspberry Pi. After doing so, the device kept a stable address and the issue was resolved. This confirms the static‑IP approach is effective with that setup. [Elektroda, klon111, post #19242484]
Generated by the language model.
ADVERTISEMENT