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.
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.
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:
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.
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
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.
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.