Virtual interface for secondary IP on HAOS (on ODROID-N2, home assistant Blue)

I’m running Home Assistant OS on Home Assistant Blue (ODROID-N2), but I think this question applies in general to all HAOS style installations.

I’m trying to assign a second IP address on a different subnet so that integrations that talk to IOT devices that don’t accept connections from different subnets will work. E.g. Apple TV doesn’t appear to and Samsung TV ( Samsung Smart TV - Home Assistant ) is known to not accept connections from different subnets.

I’m trying to work with just using the single built-in ethernet device “eth0”, however there doesn’t appear to be a way (neither in the UI nor in the ha CLI) to create a virtual subinterface, e.g. “eth0:10”, at the host level and assign it an address. I didn’t find any help here that worked with the HAOS installation style.

I could try using a USB to ethernet adapter and attempt to assign a second address to a physical “eth1” interface that way.

ha info returns:

[core-ssh ~]$ ha info
arch: aarch64
channel: stable
docker: 20.10.14
features:
- reboot
- shutdown
- services
- network
- hostname
- timedate
- os_agent
- haos
- resolved
hassos: "8.4"
homeassistant: 2022.7.7
hostname: homeassistant
logging: info
machine: odroid-n2
operating_system: Home Assistant OS 8.4
state: running
supervisor: 2022.07.0
supported: true
supported_arch:
- aarch64
- armv7
- armhf
timezone: America/Los_Angeles

ha network info

[core-ssh ~]$ ha network info
docker:
  address: 172.30.32.0/23
  dns: 172.30.32.3
  gateway: 172.30.32.1
  interface: hassio
host_internet: true
interfaces:
- connected: true
  enabled: true
  interface: eth0
  ipv4:
    address:
    - 192.168.5.43/24
    gateway: 192.168.5.1
    method: static
    nameservers:
    - 8.8.8.8
  ipv6:
    address:
    - fe80::5444:7b29:8d92:d175/64
    gateway: null
    method: auto
    nameservers: []
  primary: true
  type: ethernet
  vlan: null
  wifi: null
supervisor_internet: true

ip addr (this is the container the CLI is running in, not the host itself which HAOS users don’t have access to):

[core-ssh ~]$ ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
18: eth0@if19: <BROADCAST,MULTICAST,UP,LOWER_UP,M-DOWN> mtu 1500 qdisc noqueue state UP
    link/ether 02:42:ac:1e:21:00 brd ff:ff:ff:ff:ff:ff
    inet 172.30.33.0/23 brd 172.30.33.255 scope global eth0
       valid_lft forever preferred_lft forever

Try nmcli.

[core-ssh ~]$ find / -name nmcli -print
<returns nothing>

HAOS manipulates the host settings via the ‘ha’ command, so there aren’t the traditional Linux utilities available.

Will be trying installation of USB ethernet adapter next.

adding USB to ethernet adapter worked. I could almost have done it without rebooting, i.e. just doing
ha network reload after plugging in the adapter and plugging it into network. However, I put it on the wrong network, so had to ha host reboot to get it to rerun DHCP and get a new address.

now ha network info returns

docker:
  address: 172.30.32.0/23
  dns: 172.30.32.3
  gateway: 172.30.32.1
  interface: hassio
host_internet: true
interfaces:
- connected: true
  enabled: true
  interface: eth0
  ipv4:
    address:
    - 192.168.5.43/24
    gateway: 192.168.5.1
    method: static
    nameservers:
    - 8.8.8.8
  ipv6:
    address:
    - fe80::5444:7b29:8d92:d175/64
    gateway: null
    method: auto
    nameservers: []
  primary: false
  type: ethernet
  vlan: null
  wifi: null
- connected: true
  enabled: true
  interface: eth1
  ipv4:
    address:
    - 192.168.6.82/24
    gateway: 192.168.6.1
    method: auto
    nameservers:
    - 8.8.8.8
  ipv6:
    address:
    - fe80::3567:827b:3627:609/64
    gateway: null
    method: auto
    nameservers: []
  primary: true
  type: ethernet
  vlan: null
  wifi: null
supervisor_internet: true

and after rebooting, a couple of new devices were discovered due to being on the new subnet.

| |  | |                          /\           (_)   | |            | |
| |__| | ___  _ __ ___   ___     /  \   ___ ___ _ ___| |_ __ _ _ __ | |_
|  __  |/ _ \| '_ \ _ \ / _ \   / /\ \ / __/ __| / __| __/ _\ | '_ \| __|
| |  | | (_) | | | | | |  __/  / ____ \\__ \__ \ \__ \ || (_| | | | | |_
|_|  |_|\___/|_| |_| |_|\___| /_/    \_\___/___/_|___/\__\__,_|_| |_|\__|

Welcome to the Home Assistant command line.

System information
  IPv4 addresses for enp2s0: 192.168.20.xxx/24
  IPv6 addresses for enp2s0: 2404:4404:1000:1300:ce3c:xxxx:xxx:xxx/64, fe80::c9f9:xxxx:xxxx:xxxx/64

  OS Version:               Debian GNU/Linux 11 (bullseye)
  Home Assistant Core:      2022.8.0

  Home Assistant URL:       http://hass.local:8123
  Observer URL:             http://hass.local:4357
➜  ~ nmcli
enp2s0: connected to Wired connection 1
        "enp2s0"
        ethernet (r8169), 00:23:24:3C:2F:A9, hw, mtu 1500 (omitted the rest)

Perhaps it is because I have a supervised install, but more likely because I run the web terminal & ssh addon, not core-ssh.

Way cool! Thanks for sharing.

I also run HA on one network and most of my wifi IOT devices on another VLAN. I was trying to nudge things into working by enabling MDNS broadcasts, etc. But just doing a 2nd NIC makes lots of sense.

Now I’ll have dongles in all 4 ODROID-N2+ USB ports-- dongles for Z-Wave, Zigbee, new Bluetooth support, & 2nd NIC. Oh crap, my Apple TV and Alexa devices are on yet a 3rd VLAN. Hmm, gotta think on that one.

I am still so amazed this stuff works so well.