Isn't something like that what UPnP / zeroconf is supposed to do[1][2]?
[1]: https://en.wikipedia.org/wiki/Universal_Plug_and_Play
[2]: https://en.wikipedia.org/wiki/Zero-configuration_networking
[1]: https://en.wikipedia.org/wiki/Universal_Plug_and_Play
[2]: https://en.wikipedia.org/wiki/Zero-configuration_networking
https://en.wikipedia.org/wiki/Internet_Gateway_Device_Protoc...