Homeassistant – change IP address in CLI – nmcli

cmatrix

I am using now for more than 1 year Homeassistant, installed on a RasberryPi, to manage all the smart devices in my home in a unique platform instead of using each device application.

…and not only on my home. Recently I implemented this solution in the new DataCenter of my company to monitor the climate, HP-ILO, smoke, flood and so on.

At some point I had a problem with the DHCP server and I couldn’t access the Homeassistant server which on this case was located on a virtual machine. So, I had to change it manually in the VM. Because HA is running like a container the procedure is like this:

1. Login. Yes, you must use the exact command

login

2. List connections

nmcli connection show

3. Show properties of your connection

nmcli con show "your connection"

4. Edit mode

nmcli con edit "your connection"

5. List connection properties

nmcli> print ipv4

6. Set manual IP

set ipv4.addresses 192.168.0.100/24

7. Set the other stuff, save&quit.

nmcli>set ipv4.dns 192.168.0.1
nmcli>set ipv4.gateway 192.168.0.1
nmcli> save
nmcli> quit

8. Reboot your HA machine

hassio ho reboot

Have fun!

Comments

comments

Author: ionut_d

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.