My linux desktop machine is running Kubuntu 16.04 Desktop LTS (Debian based linux); running a the KDE Plasma Desktop. To connect to the LAN I've simply configured the WiFi GUI (cable is not an option due to building), pointed it to the router and filled the password. Works just fine without problems.
However, the IP address allocated to my machine is handed via the DHCP server running on the router. Currently it's 192.168.0.34
but from day to day it changes depending on if I've switched off my machine, the router gets power cycled etc.
There are some options in the router under 'DHCP Reservation' which allows me to reserve a fixed IP address based on the MAC address of my WiFi card.
I have a MacBook and I like to SSH to the Linux machine so I can work anywhere in the house and garden. Usually I alter the /etc/hosts
file on the MacBook and make an association mylinuxbox 192.168.0.34
.
Without using DHCP Reservation, I would have to continuously change the /etc/hosts
file to match the current DHCP Allocated IP Address.
Is there a way for the Linux machine to broadcast its IP address on the LAN?
If so, how is this done and is this a secure and acceptable practice?
Would fixing the IP on the router using DHCP Reservation be a better solution?
ssh mylinuxbox.local
? If both boxes are running zeroconf (i.e., bonjour on mac, avahi on linux), using thelocal
domain should work. – user4556274 Aug 09 '16 at 15:45hosts
, getting the name out shouldn't be a problem either. – ilkkachu Aug 09 '16 at 17:04