I'm using my Laptop on several networks. When I'm at home or at the office I occasionally want to connect with my phone to a server running on my laptop (say MPD, ssh, transmission).
The problem I'm facing at the office is that my IP address changes often. Hence I need to change the IP the apps on my phone use to connect to the servers and it's pretty tedious. I don't have permission to configure the router at the office so it'll give a static IP specifically to my machine, as I've done at home.
What's more frustrating, is that the office's router doesn't seem to support local network DNS - my machine's name is NUX and typing e.g ssh NUX
on my phone while at the office fails.
I've often heard about a static IP address configured on the machine and not on the router but I never figured out how to do that. If I'd like to configure that wouldn't the router expect me to want a static IP? It doesn't make sense that a router configured for DHCP will go along with a machine demanding a static IP.
Besides setting a static IP with such a router, I'm considering writing a dirty hack to workaround the issue: Run a script on startup that will parse the output of nmap -sP 192.168.1.0/24
and send some kind of message to the phone indicating it's own IP address.
I'm using connman on NixOS but I'm willing to consider an alternative network manager for the sake of making this work.