HassOS with multiple network cards

You’ll probably need to provide a TON more information:

What OS? What HassIO installation method? Are networks routed to each other through another device?

OS = HassOS (see image in previous post), except not on a rasberry Pi, running as a virtual machine on an ESXi hypervisor.

Networks are connect via layer-3 managed switch. This config works because I have other devices connected with multiple cards to this switch.

Not sure there is anything in that image to indicate HassOS - and I checked before posting. Just an interface listing for hassio but that could appear in other setups as well.

If your two networks are already separately routed, why bother with the dual interface? Your HA instance can access the other net via the router.

I run same setup (HassOS on VMware). Gimme a few minutes to see if HassOS uses similar network setup to other Linux distros.

One more question, was second vNic present and enabled when HassOS was installed?

Running HassOS 3.8. I have running multiple vlans for network seperation. 95% of what HA controls are on my IoT vlan (192.168.x.0/24) but there are a few devices that I cannot place on IoT network that I also want HA to control.

I would prefer to not allow for inter vlan communication that is the reason I have two vNICS installed on the HA instance.

Both vNICS were present and connected at the time of the VM creation.

I am curious of HassOS is limited (by default) to configure only one NIC.

1 Like

Option 1:
Allow inter-vlan routing but use ACLs to only allow from HA instance.

Option 2:
Take a look here ( Guide: Connecting Pi with Home Assistant OS to wifi (or other networking changes) ) and use the ‘nmcli’ command to check on and configure your extra interface. HassOS is already setup to work with wired and wifi ethernet interfaces so must have an ability to work with multiple.

1 Like

@brahmafear thanks for the tip, I was able to use it to figure this out. I will post here for others (and my self)

#Show existing connections

nmcli con show
HassOS default f62bf7c2-e565-49ff-bbfc-a4cf791e6add ethernet enp19s0

#Get current status (Notice enp11s0 is disconnected)

nmcli dev status
DEVICE TYPE STATE CONNECTION
enp19s0 ethernet connected HassOS default
enp11s0 ethernet disconnected –
docker0 bridge unmanaged –
hassio bridge unmanaged –
.
.
.

#Add new ethernet connection (DHCP)

nmcli con add type ethernet con-name vm_lan ifname enp11s0
Connection ‘vm_lan’ (0748deec-4cb5-4a56-acad-14e685c3a568) successfully added.

#Bring up connection

nmcli con up vm_lan
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/4)

#Check Status (Notice enp11s0 is now connected)

nmcli device status
DEVICE TYPE STATE CONNECTION
enp19s0 ethernet connected HassOS default
enp11s0 ethernet connected vm_lan
docker0 bridge unmanaged –
hassio bridge unmanaged –
.
.
.

Now I hope this is preserved after a reboot :slight_smile:

12 Likes

Nice. Was typing from mobile before so wasn’t able to provide much info or a guide. If you have a chance, post back if the nic config is preserved after a reboot. Curious about that as well.

Confirmed, this stays persistent after a reboot.

4 Likes

Created an account to say thanks for posting the detailed solution. I was facing the same issue and the steps above helped me get the second NIC up and running. Cheers!

2 Likes

Hello… I hope I can find someone here that could had the same problem…
Considering two network interfaces, on two different VLAN’s (LAN and IOT)… how can I set which is the “default” interface??
More details: using nodered, some nodes act like fake alexa devices and the alexa scans the network to find those fake devices… I don’t know why but some times seems like those fake devices are listening on the “LAN” VLAN which my echo devices are not allowed and it fails… If I deactivate the “LAN” interface and restart hime assistant, alexa find the device.
I need a way to assure that those fake devices listen only on my IOT VLAN.

Late response but to keep the info in the thread flowing. Try setting interface priority via something like the below:

 nmcli connection edit <Connection_you_want_to_deprioritize> 

			§ nmcli> set ipv4.route-metric 2000 - sets the inteface metric
			§ nmcli> save
			§ nmcli> quit
 systemctl restart

2 Likes

Thanks for this.
Just wanna say for the newbies (such as myself) at the HA cli, type “login” to get a SH prompt to type the nmcli commands.

5 Likes

Hi, I am using the HassOS image in Hyper-V on Windows 10. I have a separate isolated VLAN for IOT and my normal home network both with DHCP servers. The host has two (actually more, but that does not matter here) physical NICs connected to each network set up in virtual switches as external - don’t share with host, so these are for exclusive use to the guest OS (HassOS). The VM is set with two virtual NICs connected to each virtual switch. So in theory HassOS should get my IOT VLAN IP on eth0 and my home network IP on eth1. The goal was to keep IOT devices isolated in their own VLAN, but be able to access HA web admin from any device in my home network.

Unfortunately what happens is that only eth1 gets assigned an IP address when HassOS boots - nevermind which network is it connected to. When I remove the virtual network adapter, eth0 gets an IP assigned. When i run nmcli device connect eth0, it actually works (!) but disconnects eth1 (so I lose access to the server besides the Hyper-V console). It seems that for some reason HassOS only connects on one eth interface.

How to bypass this please? I guess this use scenario with two NICs in separate networks is quite common.

Thanks.

1 Like

Thanks !!!

@vlastaw I’m not sure if you figured this out but I just hit this issue. I had HASSOS setup (in a VM, running on proxmox) for about a year now. About 6 months ago I added a 2nd nic which physically connects to my IoT VLAN.

Earlier today I found my HASS randomly can’t connect to anything. I ssh’ed in, and sure enough can’t ping it. It looks like the metric for the IoT VLAN NIC somehow became lower than the normal LAN NIC, which resulted in nothing being accessible (because nothing in that VLAN can access the rest of my network).

To “Fix” this, I simply removed the DNS & Gateway IP from my IoT VLAN NIC (so it only has IP & subnet - previously it was set to DHCP). This is fine for me since this interface is only for talking to devices in that subnet, the system should really use the other NIC for everything else.

3 Likes

Are you able to cast media over your IOT network? My instance SEES all the cast groups i create, and even new speakers I add, but they are always greyed out. I’ve gone into the settings, and changed the multi-cast option to be on the IOT network, saved, shutdown HASSOS vm, and turned it back on.

I can ping the gateway of the IOT network - but for some reason the media/cast is disabled.

1 Like

Hi! unfortunately your fix does not work on my setup. When ever i remove the dns and the gateway ip from the secondary interface, the ip is automatically added again, even though its on manual. There is something buggy on this network configuration page.

However, manipulating the routing table via nmcli did the trick, but i had to do a remove ipv4.dns first, set the route-metric to 1 for the primary interface and reboot the system. I could not find a way to restart the NetworkManager daemon.

[ Edit: Apologies. Nevermind. I was using the wrong SSH/Terminal add-on. ]

I’ve been using the multi-home solution described by narsaw back in Feb '20 for some time, with no issues.

Today I did a system upgrade, to OS 10.5, supervisor 2023.09.2, and while the interfaces are up, and I can ping them externally, and from an HA ssh session I can ping devices on both networks, I think I have a routing issue. (My Unifi installation on HA isn’t communicating with either of my APs, which I suspect means a routing issue on their interface.)

But I’m hamstrung because nmcli isn’t installed. I don’t recall having to do anything special for nmcli before – has it gone away in the latest release? Can I install it?

Hi - has anyone added a network interface using USB C port on the Yellow and if so, how did you get it working?

Can someone confirm, one way or another, whether or not the network dual homing described by @narsaw, above, is preserved in the usual HA backup files? I.e., if I need to recreate my HA system due to a failed Pi, or failed SD card, will I need to recreate this config manually, or will it be restored along with everything else?

The fact that it’s persistent across upgrades gives me hope. :slight_smile: