Fixed IP address

I am running Hass.io using the vmdk image on an Esxi server.

I’d like to set a static IP.

I have been pointed towards https://github.com/home-assistant/hassos/blob/dev/Documentation/network.md but as a starting point, it mentions a folder /etc/NetworkManager/ which I cannot see when logging in by SSH.

Easiest way is to reserve the IP address in your router… If using WLAN, you need to transfer the WiFi settings via a USB stick. You are not ging to get far with ssh and Hassio and editing network files…

Really want to set it at the server level. The notes on that link I quoted says that NetworkManager is used, but that folder does not exist. Using a USB stick on a Exsi server is a PITA and if the folder is not there I am not sure the USB stick would work anyway.

Not using a WLAN - wired LAN to the Esxi host.

Have you tried logging in via SSH to HASSOS, and not the SSH Add-On which is a separate container, and has nothing to do with the base OS?

  1. Format a USB stick with FAT32/EXT4/NTFS and name it CONFIG.
  2. Create directory within the USB drive: network
  3. Create file resin-sample in network folder.

resin-sample file:

[connection]
id=hassos-network
type=ethernet
uuid=d55162b4-6152-4310-9312-8f4c54d86afa
interface-name=eth0
permissions=
secondaries=

[ipv4]
address1=xxx.xxx.x.xxx/24,192.168.1.1
dns=8.8.8.8;8.8.4.4;
dns-search=
method=manual

  1. Change xxx.xxx.x.xxx to IP you like to use.
  2. Connect USB drive to Rasbery PI 3.
  3. Login to local http://ip-address:8123
  4. Go to Hass.io ==> System, Click IMPORT FROM USB. Wait, after finish reboot host.

Working step by step configuration.
Tested on Hassio 0.78.0.

2 Likes

@flamingm0e, ah, that is really good information - had not appreciated the difference :smile:. As an aside, is there a way to SSH into HASSOS? On my VM, I was able to login via the console.

Using the above info, I have managed to set a static IP using nmcli commands and submitted a PR to update the documentation.

@Vlad - that is useful info (and better explained than the documentation) however, as I have said, this is not a Pi3 setup but an Esxi VM host system.

There was a way when it was running in ResinOS, but I have not messed with HASSOS. I assume they kept the troubleshooting setup the same.

https://developers.home-assistant.io/docs/en/hassio_debugging.html

2 Likes

Just did some digging and you are right. If you really, really want to be able to SSH in, and you are on a VM or have direct console access, editing the drop-in file /etc/systemd/system/dropbear.service.d/hassos.conf appropriately (remove requirement for RSA key for instance) will enable you to SSH into the root OS.

In normal circumstances the SSH service is in a failed state as there is no RSA key file.

Hi David,
Really struggling with this. I’ve set up port forwarding on the router (I think!) but static IP is a no go. It’s a ZTE MF920V and is not the best, very limited options and I’m not sure if it’s possible.
I’ve been on portforward.com and followed the steps for the forwarding but there is nothing on static IP for this particular model.
Is there any way you can think of to do this?
Many thanks

Hello folks, I’ve installed PiHole on my Hass.io instance (0.92) which dictates setting a static IP and external DNS. As I can’t configure an alternative DNS on my router (BT Hub 6) I’ve disabled DHCP and PiHole is now set to perform this task.

I have also followed the instructions for assigning a static IP and external DNS from this thread to my Hass.io instance using an external USB stick and I had thought all had gone well.

Sadly, after about 24 hours my whole Hass.io/Pi and thus network go offline (it has happened each day since the PiHole install).

In my uneducated experience, this would seem to tie back to a DHCP lease expiry… How do I confirm/check that the Hass.io is, in fact, using the static IP I configured and is not still somehow using a DHCP static lease for the same IP address?

FYI my BT router is not very helpful as even after a factory reset and rebuild I never get a refresh of the device list - even when I restore it as a DHCP server…

Any help and guidance with this would be very much appreciated!

My issue is now resolved… Most of the USB network configuration file examples separate the PI’s IP Address and Default Gateway with a “,” when in fact it needs to be a “;”… Hope this is of use to others that may struggle as it did!

2 Likes

with version 2021 8.8 you do the following:
in hass choose supervisor
system
change IP

1 Like