1

I have a device that can be accessed over a local network in order to configure the device. One of the settings is to change the IP address of the local interface. The problem is that when I change the static IP I can no longer redirect the user to the new IP.

Is there some way around this?

Is there a way I can temporarily keep the old IP address and then redirect the user to the new one and release the old one?

I want to avoid the user from having to manually type in the new address in case they forget it or accidentally enter the wrong address.

Not sure what the smartest way to do this is.

For example now I am doing this

 ioctl(args) //change ip of interface
 redirect to new address //this doesn't work obviously
User
  • 13
  • 2

2 Answers2

1

Another option may be to use LLMNR (Link-Local Multicast Name Resolution) — see also Multicast DNS — so the user could go the device based on an identifier such as its serial number or some such.

Cameron Kerr
  • 4,069
  • 19
  • 25
  • could you give a little more detail on how that would be done? Would I redirect the user to the hostname? – User May 19 '15 at 22:31
  • In this case, the use would interact with the hostname, such as myfancydevice.local. That name would be published by the device itself using some software such as avahi (if that is still current on Linux). Sorry, I can't provide specific instructions as it's not something I've looked at implementing myself. If you search for multicast DNS then you find plenty of resources. – Cameron Kerr May 19 '15 at 22:38
0

Yes, assuming you are talking a web interface.

Similar to an appliance that reloads the page after a restart, you can put a http-equiv refresh in the pages header

Eg. The following will instruct the browser to go to the provided URL after 20 seconds. Put this in the <head> or your HTML.

<meta http-equiv="refresh" content="20;URL='your new url'">

Possibly I got the separator before the URL wrong, but that should help you out.

Cameron Kerr
  • 4,069
  • 19
  • 25