How To: Set a Static IP on Hass.io/HassOS

Address line separator is ; not ,

1 Like

Hi.
Thanks a lot for your topic about static ip.
one question.
right now my raspberry pi get his static ip from the router ,
so, if i do it the way you explained, i can give up the static ip from the router?
the static ip will be from the raspberry, right?
Thanks
Refael

Yep that’s correct mate.

I’m trying to moving to a fix IP as well and it doesn’t work. I even reserved the IP on the Router and still, I won’t move from it’s original IP,
Via the Samba I created the network folder, then I created the file my-network file using Atom.

[connection]
id=hassos-network
uuid=9b05f929-12b2-432a-ae0a-emyuniqkey
type=802-3-ethernet

[ipv4]
method=manual
address=192.168.XX.YY/24,192.168.79.Y
dns=192.168.XX.Y;1.1.1.1

[ipv6]
addr-gen-mode=stable-privacy
method=auto

but after a reboot, the ip is still the original one.

This worked perfectly for me.
Thanks for posting.

1 Like

Welcome!

You don’t place the network folder into /config. You put it on a USB drive and it gets imported, after which you can remove the USB drive.

OR you can make use of an addon and do it as described here, which is probably easier because it is interactive and you can “check your work”: https://community.home-assistant.io/t/guide-connecting-pi-with-hassos-to-wifi/98768

So I can not configure the WIFI and ethernet connections with the same config file? I need to change it to configure each one? What a tedious system.

2 Likes

yes you can.

It will be awesome to see at least one example, because there is noi example about how to configure two network interfaces (wifi and ethernet)

Oh come on, there are hundreds of examples of network manager configurations on the internet.

I’m taking about how to setup the file named my-network to configure two interfaces, not how to do it in linux. This is pretty unique to hassio

No it is not, it uses network manager.

@LavaGlass

I am hoping that someone can help me undo the changes I made. I followed the instructions to set a static IP and after rebooting I lost access to the UI. The static IP was not set using this method, but I was able to get it changed using nmcli via console access. I am still not able to access the UI and am wondering if there is a way to undo the changes that were made when I imported from USB. I can ping hassio and can access the Samba share without issue.

I just went ahead and did a snapshot restore via the console and I am back up and running.

Worked great. Thanks.

I’ve used this method successfully a few times:

https://tech.borpin.co.uk/2018/10/18/using-nmcli-to-set-a-static-ipv4-address-in-hass-io/

4 Likes

Hey. I’m trying to get my rasberry pi hassio on a static ip. I have tried to follow the steps. But after importing the settings from the usb and starting up the raspberry I cannot seem to connect to it. I have waited long, rebooted it several time. no cigar
Capture
I have tried 192.168.1.111:8123 as well, still does not connect to the front end.

When opening windows “network” my Hassio has also disappeared. sooo I guess something went wrong. I probably screwed up the configuration?

my-network

[connection]
id=HassOS default
uuid=0a7a254a-f937-4dee-914d-9965e990a9c3
type=802-3-ethernet
 
[ipv4]
method=manual
address=192.168.1.111/24,192.168.8.1
dns=8.8.8.8;8.8.4.4
 
[ipv6]
addr-gen-mode=stable-privacy
method=auto

I can confirm the the configuration went through. when i boot up the pi and look at the ipv4 with the network manager this is what i see:


I’m not used to configure networking anything here that looks wrong? Or any suggestions why I have been locked out of my web interface?

I believe you need a semicolon at the end of the dns line, ie

dns=8.8.8.8;8.8.4.4;

Are you sure? I copied the configuration as instructed. Would be pretty annoying if it is corrupted and people reading the guide have to guess their way forward to fix it. :frowning:
I’m not used to dealing with linux nm syntax

Not 100% sure, I relied on something I saw on the net.