Sample Header Ad - 728x90

Setup static IP address for 1 machine and DHCP for other

0 votes
3 answers
419 views
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](https://01.org/connman) on [NixOS](https://nixos.org/) but I'm willing to consider an alternative network manager for the sake of making this work.
Asked by Doron Behar (773 rep)
Feb 13, 2020, 07:15 PM
Last activity: Feb 15, 2020, 10:16 AM