5

I have a physically remote thing. It's on someone else's network so I can't get a static IP address for it. What is the best way to track its IP address?

I can imagine just publishing a "heartbeat" that includes the IP address to some service that will store it for me. If there is some sort of software problem on my thing's end, I could potentially lose it forever in this setup.

Is there a more robust way to keep track of the thing's IP address?

  • 2
    Welcome to the site, I am guessing that "on someone else's network" means behind a router that's using NAT? – Helmar Jun 20 '17 at 7:51
  • 2
    We need more information to help here, is it as @Helmar says on somebody else's home network (e.g. behind a NAT gateway)? Are you trying to connect to it directly (once you know the IP address)? – hardillb Jun 20 '17 at 7:54
  • I'm not exactly sure about the NAT- I'm not familiar with that. Based on some googling, I think the answer is no. its just on a ISP-assigned public IP address which I have permission to use, but not control. Once identified, I would like to both send it relayed messages (eg Pubnub) which I don't need the IP address for, and connect directly. Your questions have made me wonder if the solution is either get my own IP address or push everything via a relay service. – ericksonla Jun 20 '17 at 13:18
  • 3
    This is what dynamic DNS services are for; alternately and perhaps more flexibly and securely a relay server (or for IoT purposes, perhaps an MQTT broker) can let both ends of your interchange be making outbound connections through a firewall to an interchange server/broker you control. – Chris Stratton Jun 21 '17 at 2:30
2

Your thing probably doesn't have a unique IP address in this context, unless it uses IPv6. It will have an address in a private space, such as 10.0.0.0 – 10.255.255.255 or 192.168.0.0 – 192.168.255.255, this will be behind a NAT gateway (which has the ISP assigned public address).

Your thing can probably initiate outbound connections to a server (which can include a 2-way communication), but ultimately, your thing needs to 'phone home' in order for your server to communicate with it. Your thing's IP address shouldn't need to be something you care about, unless one thing needs to talk directly to another. If you need it's IP address, your target's router will need to port forward for you.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.