Home Assistant Community

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

guide
howto
Tags: #<Tag:0x00007f375c39d9e8> #<Tag:0x00007f375c39d3f8>
#1

Hi all,

I have seen some people a bit confused on how to set a static IP for the new Hass.io host HassOS. I know their are other guides but they are mostly buried in other posts. Anyway heres how to set up a static IP on Hass.io/HassOS.

Step 1: Once you have got Hass.IO up and running following the guide and can access the front end go to step 2.
Step 2: Take a USB stick put it into your PC and rename it to “CONFIG”.
Step 3: Create the folder “network” and inside create a text file called “my-network” then delete the .txt extension click yes and it should save. The file’s icon should just be a white/blank file icon in windows explorer.
Step 4: Open up that file with Notepad++ or similar and paste in these lines. These lines of code are for a Ethernet connection with a Static IPv4 but if you want to configure WiFi here are more examples of code. Change the IP and gateway IP to fit your setup. Eg. 192.168.1.111 is the Pi’s IP and 192.168.1.1 is your router/gateway’s IP.
Step 5: where UUID is you need to generate a unique one here copy and paste it into the “UUID: section”. Save the file and remove the USB stick from your PC.
Step 6: Shutdown your Pi (pull the power plug or thorough SSH) and insert the USB stick into any free port. Start up the Pi once the stick is inserted.
Step 7: Once it starts up and you can reach the UI go to the Hass.io tab, click on “System” on the far right, scroll down and find host system and click “import from USB”.
Step 8: Wait until it is complete then shut down the Pi, pull the USB and restart, it should now have a static IP.

Please note this will only work for the new HassOS install’s menaing that you have recently downloaded the newest IMG.

Hope this helps Riley.

5 Likes

Hass.io static ip and other network regarding questions
Power breakdown with HA
Power breakdown with HA
#2

There is also the very simple option of getting your DHCP server (usually your router) to dish it out the same IP address every time.

Your howto is a great resource for those endless questions of “how do I get wifi working on hassio”!

0 Likes

#3

When using something like the Pi-hole add-on that could give issues the way you say, if a user sets the default DNS on the DHCP server (your router) to the Pi. You will still need to set a static IP address (and dns) on your Pi to have it working.

0 Likes

#4

Yes you do need to set your DHCP server to a static address.

0 Likes

#5

Thanks, helps me a lot! :slight_smile:

0 Likes

#6

Thanks for this! I’m facing traoubles with the pihole addon and hopefully this will solve it.

I still have some questions, maybe you could help @LavaGlass?

  1. How can I proof that it used the settings from the usb stick and I have a static ip?

  2. Can/should I keep the address reservation in my router or do I have to delete that?

0 Likes

#7

I can’t get this to work.
I have a USB stick named “CONFIG”
On this drive is a folder named “network”
In this folder a file named “my-network”
In this file is this this configuration:

[connection]
id=hassos-network
uuid=7ca777e9-8ae5-42fe-b725-7714fd4fc386
type=802-3-ethernet

[ipv4]
method=manual
address=192.168.11.10/24,192.168.11.1
dns=192.168.11.1;8.8.8.8;

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

Logging says:

19-02-05 20:02:40 INFO (MainThread) [hassio.hassos] Syncing configuration from USB with HassOS.
19-02-05 20:02:40 INFO (MainThread) [hassio.host.services] Restart local service hassos-config.service

I tried rebooting, importing, all the steps above. But Hassio is still on DHCP.

Please help,

J

0 Likes

#8

Address line separator is ; not ,

0 Likes

#9

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

0 Likes

#10

Yep that’s correct mate.

0 Likes

#11

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.

0 Likes

#12

This worked perfectly for me.
Thanks for posting.

0 Likes

#13

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

0 Likes