Window 10 VM安装HA遇到桥接网卡获取IP不在一个网段,手工配置解决
Reset network
# rm -r /mnt/overlay/etc/NetworkManager/system-connections
# reboot
Using nmcli to set a static IPv4 address
Login as root (no password needed). At the ha > prompt, type login (as instructed).
From there you use the nmcli configuration tool.
# nmcli con show will list the "Home Assistant OS default" connection in use.
# nmcli con show "Home Assistant OS default" will list all the properties of the connection.
To start editing the configuration setting for "Home Assistant OS default":
# nmcli con edit "Home Assistant OS default"
To add your static IP address (select 'yes' for manual method);
nmcli> set ipv4.addresses 192.168.100.10/24
Do you also want to set 'ipv4.method' to 'manual'? [yes]:
In addition, it's recommended to set the DNS server and the local gateway. For most home routers the DNS server will have the same IP address as the router itself. If you are using Pi-Hole or a third-party DNS system then you can set the DNS server to that.
nmcli> set ipv4.dns 192.168.100.1
nmcli> set ipv4.gateway 192.168.100.1
nmcli> print ipv4 will show you the IPv4 properties of this connection. With nmcli> save you will save the changes afterwards.
If you now view the default connection cat /etc/NetworkManager/system-connections/default you should see the method is manual and the address is set.
Doing a nmcli con reload does not always work, so restart the virtual machine or the physical system.