Planning for telnet on DHCP
January 7, 2013 11:20 AM Subscribe
I need some help on networking and ip addresses. I'm working on a project that uses a RN-XV Wifly module to connect to a home's wifi network. To use the device you will have a GUI that on the back-end telnets to the Wifly module and sends a serial string of commands. So if the Wifly address is 10.1.0.17, it would send:
telnet 10.1.0.17 80
(text commands)
ctrl^] (escape character)
quit
If you are using static ips on your home network, no problem. But if you use dhcp, which is the standard out-of-the-box for just about every wireless router out there...
I don't know how people usually handle dhcp. Here's the order of events that concerns me.
1. Plug in device, it gets an IP address assigned from the wifi router using dhcp.
2. Get the IP address and write it into the script.
3. The script works, everything works, no problem.
4. Someone unplugs the device, and when it is plugged back in the router gives it a different dhcp address.
5. Now the script doesn't work because it is telneting to the wrong ip address.
What is the best practice for handling that case? Is there a unique identifier you can assign to a device that abstracts the ip address? Like if I do "telnet bob 80" and something somewhere knows "bob" is 10.1.0.17, where it is smart enough that if the ip address changes, "bob" changes too?
Thanks. I'm hoping for a solution that require no setting changes to the router, so changing to things like "dhcp and static ips" is not what I hope to do.
posted by BeeDo to computers & internet (14 answers total)
If it has internet access, you could have it phone home to a server and have a web page that lists the local IP there.
posted by wongcorgi at 11:37 AM on January 7