I have had a very hard time getting this far with HA, but I still do not get what you are showing. My nmcli does not understand set and I do not see a ready replacement.Have tried numerous versions of HA with no joy at all.This new way is not very good?First the dictatorial removal of YAML now a startup that is incomprehensible not an auspicious follow up. Is there complete help for this?
NOTE: This post was written several years ago and outlines a way to set a static IP using low level tools. If your network uses DHCP to assign IP addresses (if you aren’t sure, it does) then please scroll down to this post that describes a newer method.
You want to:
Be connected to the HA CLI, you should see an ha> prompt
Run ‘login’, you should now see a # prompt
Run ‘nmcli connection show’ to see your list of connections and choose which one you intend to edit. In my install there was only one listed, “HassOS default”
Run ‘nmcli con edit “HassOS default”’ (or whatever your connection is), you should now have an nmcli> prompt
Once in the nmcli prompt, run these commands filling in whatever your network details are:
nmcli> set ipv4.addresses 192.168.1.10/24
Do you also want to set ‘ipv4.method’ to ‘manual’? [yes]: yes
nmcli> set ipv4.dns 1.1.1.1
nmcli> set ipv4.gateway 192.168.1.1
nmcli> save
nmcli> quit
Just to add to this, if one has two connection profiles, for example this is how mine seems to be setup:
$nmcli con show
NAME UUID TYPE DEVICE
Supervisor enp0s3 c14e9fbc-98dc-49e0-b65e-c39d18abdef9 ethernet enp0s3
HassOS default f62bf7c2-e565-49ff-bbfc-a4cf791e6add ethernet --
only one connection profile can be active at a time, so pick the one that has a device listed under DEVICE (i.e. pick “Supervisor enp0s3”)
Guys you saved me today. Yesterday after a power outage the Home Assistant OS wasn’t coming up anymore. No IP no matter what. It’s running on Odroid N2+.
I found out that ipv4.method was disabled. So using nmcli I brought it back to life. Awesome.
@phobiac your the difference between someone who wants to help and someone that … your write up was soooo helpful and to the point. There are so many posts looking for this info and definitly HA needs to do work in this area.
If you install your HA on a Raspberrypi you should be able to simply config the net without having to connect to a live network that has a dhcp server running…wth.
In my case I build my system got it all configured and restored my backup from my VM. My last step before putting it away was to configure the Wifi. I setup the WIFI and then disabled the lan…Bam, I forgot to enable the wifi and now the system is bricked. and I did not know how to get out of docker to the OS…
Thanks again!!!
Glad I could be of service! Funny enough, I ran into this exact issue again just a few weeks ago and ended up finding this thread and my own post… So like many lessons with documentation, I ultimately helped future me out too.
I would say that using DHCP for anything other than guest devices is a mistake and that 99% of people using Home Assistant do need to change the IP address. Especially if you have anything more than just a consumer router which it seems that most people using Home Assistant probably do given the necessity for well above normie technical skill required to use it.
I mean, you might want to look at the forums again - have a count how many people are asking for YAML help - despite the very YAML they are needing help with, either already being able via a forum search, or it’s actually documented on the Home Assistant documentation site.
68% of people are running Home Assistant OS, and almost half of people are running on a Raspberry Pi 3 or 4. I’m not sure why you believe that Home Assistant is only used by people with deep technical knowledge.
Regardless - ALL consumer routers, allow you to reserve or pin an IP address that a device has been provided by DHCP, obviously they have to provide that ability - because otherwise it would impossible to do port forwarding.
The same applies if you are not using a consumer router, and in fact if you are not using consumer router - then you can reserve an IP address by MAC address - and that gives you the ability to decide your own IP address to provide to the device.
In neither of these options have we needed to actually give the device itself a static IP address.
If you do need to give the device an IP address though - since you have decided to respond to a post that is now a YEAR old. You can in fact do it directly from the settings page in the Home Assistant GUI
Good question. My system automatically set up the profile, so I’m not so sure.
First let’s see what there is (type each of the following): nmcli connection show - just to verify there are no other profiles. nmcli device status - to see if there are any interfaces.
If “Supervisor enp11s0” is the only profile, and you have an interface enp11S0, then you may be able to add the interface to the profile using: nmcli con add con-name "Supervisor enp22s0" ifname enp11s0 type ethernet
So it looks like my connection is showing as disconnected when I run the status command:
For a little context this is running under ESXi 7.0U2 and had been working successfully for some time. Recently I had issues as Veeam tried to backup the VM (it creates snapshots) and subsequently it wouldn’t boot. I resolved that issue and now I have this one…
I ran the: nmcli con add con-name "Supervisor enp22s0" ifname enp11s0 type ethernet command successfully but it has now created two profiles:
Although it looks as if the actual problem is the adapter showing as disconnected.
Sorry, I think I was fiddle-fingering my response and mistyped the profile name.
Since the interface name is shown as enp2s1,
try: nmcli con add con-name "Supervisor enp11s0" ifname enp2s1