How to change IP adresse in CLI

I guess its an old statement, but if you look in a bigger picture. Cloud providers are using endless leasetime DHCP. Its just simpler to handle the IP outside of the OS.

Your statement is more true like in the 1990s, early 2000s where CPU and RAM was limited, but today its not the case anymore.

Just handle (almost) everything using DHCP.

HI I successfully updated my ip address by writing in the CLI:

network info 

to gather infos about the interface’s name (I discovered my interface was different from eth0)
then

network update eth0 --ipv4-method auto

this resolved the stupid decision to assign a manual ip and not checking twice

1 Like

Simple example. My home network contains about a hundred devices. It’s a large area and several buildings connected by cable and radio bridges. Of course I have a lot of wifi access points, some of which are routers set up as access points. One of these access points went crazy (maybe it was updated incorrectly or some other failure). It so happened that during a scheduled reboot of the central router, there was no electricity in part of the buildings at night. When it appeared, this crazy access point turned on its own dhcp server, distributed its addresses in its segment and decided that it was the main gateway. As a result, a whole segment of the network was completely lost to “smart devices” even though everything looked like it was working. Thus, all dhcp-dependent devices were affected by this failure. At that moment only those devices in which ip, gateway and dns were manually set, worked correctly. Of course, this is not a normal situation, and this “too smart” router went to the local flea market, and its place was taken by one that will not be able to do anything on its own.
I’m sure that the use of dhcp is applicable to such devices as smartphones, tablets, TVs and other devices for which ip address is not important in most cases. Well, or those in which it is impossible to set the address manually (the same sensors and tuya outlets). In such cases you need to assign ip addresses in the router with binding to mac. But such things as servers should be configured manually. And the range available for dhcp should be limited to a small and reasonably sufficient segment.

I was looking everywhere for exactly this. I was caught in a terrible loop where HA wouldn’t get an IP address so it couldn’t reach the time server, so it didn’t boot properly, etc.

TL;DR you’re a hero

1 Like

Thanks for this advice!

I managed to change my IP address via CLI using the following commands:

  1. network info to find the correct network adapter and see your current IP address set for HAOS
  2. network update eno1 --ipv4-method auto --ipv6-method disabled (“eno1” needs to be replaced by your network adapter)
  3. network update eno1 --ipv4-gateway 192.168.x.x (“eno1” needs to be replaced by your network adapter, “x” needs to be replaced by your IP gateway, probably router IP)

After doing this, my Fritz!Box auto-assigned showed an IP address for Home Assistant again.