Adding a second IP address

I’m using Home Assistant, the VDI version*, and I want to close off the subnet where it’s going to live once it’s configured enough. The VM has two NICs on it but I discovered only one of them would respond at a time.

Using ifconfig to add an address works and makes both network interfaces available but it won’t persist restarts.

On /etc I saw the NetworkManager directory but the one thing I’ve never been able to understand on Linux, are its YAML config files. …besides, there’s some reference for DHCP on it already, so DHCP should work, I just need how to make a second interface active at boot.

The reference I found landed me on /etc/dhcpcd.conf, which is all on the defaults. I think here I need to add a second NIC or hostname, but I’m not sure. This is the first time I see this, um–utility? I think it is. It doesn’t seem like the standard dhclient affair but I don’t want to mess with it just yet, better ask first.

Any help is much appreciated! :slight_smile: Thanks!

*: Running on ESXi, exported to OVA from VirtualBox to make the original VDI image work.

I managed to reach the lower level system and use the easier to understand ip command. I tried:

ip addr add X.X.X.X/X dev enpXsX

Once more it was successful but it wouldn’t bring the interface up at boot.

Looking around I found about nmcli, I tried to digest it a little and tried:

nmcli con add type ethernet con-name z0007 ifname enpXsX
nmcli con mod z0007 connection.autoconnect yes

Boy–it did not like it. When I rebooted to test, it showed some red text about the interface not being ready with a ticker/timer. When it finished booting, nmcli con showed me both connection configured profiles but yet again it would only bring up one interface at boot.

I removed the profile and I’m back at square one.