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

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.

Your gateway IP is out of the range of your address scope?

Just to be sure. the ā€œgatewayā€ ip is supposed to be the ip of the router right? the ip that i enter in my browser which takes me to the router/network status and configuration.

Typically, yes and also typically an address within the same network segment.

aaalright. Iā€™m a bit confused here. Still not seeing something that I did obvious wrong, and it has been a few days and iā€™m still unable to connect to frontend and see my public folders (shared with samba).

My router has only 1 ethernet port. And for that reason I am using some splitter device, it has 5 ethernet port I believe, and it uses power from a supply. All my physically connected devices goes through this thing, including my pi hassio server. This is the only thing that I could thing of is besides normal. Everything that I plug into it usually has internet connection without trouble, I have been running IKEA hub + hassio pi through the adapter which both worked before I started messing with static IP configuration. This is just a wild guess, but could it be that setting a static ip doesnā€™t work properly when using ā€œenthernet splitterā€ (or whatever this device is called) ? :slight_smile:

btw, Iā€™m a bit screwed here, because I donā€™t know how to undo the config. I did do a snapshot before, but it fails to restore, just saying ā€œerrorā€, no further message :sweat_smile: :upside_down_face:

Basically, your host IP address and your gateway are on different subnets. This wonā€™t work.

If 192.168.8.1 is definitely your router (try to ping this IP address from a known working computer on the network to confirm), then you should be assigning an IP to your host that is in the same subnet as your gateway (e.g. 192.168.8.111/24, assuming youā€™re only working with a /24 subnet).

Edit: use this guide to fix your IP addressing on your host - https://tech.borpin.co.uk/2018/10/18/using-nmcli-to-set-a-static-ipv4-address-in-hass-io/

Thanks @LavaGlass for this post, it helped me a lot.

Some people having trouble with Step 4. You need to correct a semi-colon, hope it helps:

[connection]
id=HassOS default
uuid=your_pasted_uuid
type=802-3-ethernet
 
[ipv4]
method=manual
address=your_desired_raspi_ip/24;your_default_gateway_ip
dns=your_primary_dns_address;your_secondary_dns_address;
 
[ipv6]
addr-gen-mode=stable-privacy
method=auto

Pay attention to the semi-colons on this lines:
address=your_desired_raspi_ip/24;your_default_gateway_ip
dns=your_primary_dns_address;your_secondary_dns_address;

A semi-colon ; between your desired ip and your default gateway ip, and the other one at the end of the DNS addresses. It worked for me.

1 Like

is it possible to set the static IP address in HASSoS from its text user interface?

I think you can do it via nmcli

I am just setting up a new HA in a VM, just using supervisor version of Home Assistant, and I have found nmcli is no longer recognised as a command. I used this in earlier versions, but in 0.110.x it seems to not work now. Can anyone confirm this? I just want to know if it has changed or if some stupid has entered my mind :slight_smile:

Edit: Ignore me. A little bit of iso dumbness had set in. I had missed a step

1 Like

Thanks for your explanation. It helped me very much.

Hi, i have a simple question but i couldnĀ“t find the answer yet. To have a PI Rasperry with HA (last versiĆ³n) with a static IP in my network, what i have to do?.
Because i reserve a static IP in my netgear router, but not always take the same static IP i was configure. I have some randomic behavior. Sometimes works fine and sometimes take other IP and all things stop working. Typically this situation happend when i have electrical cuts from my provider electricy.
Some ideas to share? thanks.

You have couple options:

  1. Fixed IP address
  2. Go to Supervisor ==> System ==> Host System ==> IP Address and hit CHANGE
8 Likes

Heemmā€¦ you should set up the fixed IP from your router/DHCP which will surely give the same IP to the same MAC device. This way you wont have problem of IP being used by other device which will surely create many problem for your HASSIO.

1 Like