WiFi Connection after first boot (multiple networks and routing on Hass.io)

Hi, I recently had a situation where I needed to connect to WiFi after I had first installed, I wanted to find a way around starting with a fresh install. I am using Hass.io on a raspberry pi 3 and therefore no extra WiFi card was needed. I connected via ssh, and used the command
nmcli d wifi list
to scan for local networks, and this command
nmcli d wifi connect my_wifi password <password>
to connect to the WiFi network. After restarting home assistant I checked my IP address using ifconfig in the terminal, I also then setup a static route so that all IP address in the 192.168.2.X range get sent to the WiFi card instead of the Ethernet card, for this I used this route add -net 192.168.2.1 netmask 255.255.255.0 gw 192.168.2.0.
I hope this helps others who are trying to use multiple networks on the same Hass.io instance.

1 Like

Thanks. I was just wondering how to do this.

Ok . So I ssh’ed into hassio and started this process but I immediately get an error - nmcli:command not found.

I think it’s because I may be sshed into a container rather than the device. But I started an ssh add on in the web interface, then I created keys and ssh’ed in. Is this right?

I used the Web Terminal add on from the store and didn’t have to install any other packages.