Connecting RPi to 2 different networks

Hello,

I’m not sure if this question was raised before on HASS.IO, I solved it with the hassbian system.

essentially this is what I’m trying to accomplish:
https://raspberrypi.stackexchange.com/questions/84748/connecting-rpi-to-2-different-networks/84946#84946

Since I understood this can’t be done with the ssh connection I’m worried it won’t be done quickly for HASS as well.

if I need to pull the card in order to create the file to connect the wifi I’ll get it done but I need the rpi to give precedence to the ethernet connection which won’t have internet but all the node will connect through it and the other network will have internet so we could connect to rpi over the internet…

Can this be done?
Thanks in advance to all those that help.

If you don’t give your LAN connection a gateway, it will use the wlan to get to the internet.

so just put the file like in this thread:

and that should work?

That was for the resinos based hassio. I think the newer hassos requires a USB thumb drive? With some specific setup info

where should I look to find out? :slight_smile:

ok well this is what helped me to solve my problem. you do need a USB stick but it’s a simple solution to follow, and this is the link to follow the instructions:

it helped me.

Ok so it didn’t help me all the way.

I can access the rpi from both networks but for some odd reason I can’t update any addons on the HASSIO… do I need any port forwarding in order to do this? it worked before when the rpi was connected directly.

Any help will be appreciated.

No. Port forwarding is for traffic connecting to services on your network. When your device is connecting to download stuff it’s using a random port and initiating a connection. It requires no port forwarding because there is no way to know what port it would even use.

ok so what can be the problem it won’t download the addons for me?

I even set the metric of the connections to be the lowest for the wifi so it will know the internet is coming from there… maybe I did n’t do it right?

[connection]
id=hassos-network
uuid=d55162b4-6152-4310-9312-8f4c54d86afa
type=802-11-wireless

[802-11-wireless]
mode=infrastructure
ssid= " my netowrk "
# Uncomment below if your SSID is not broadcasted
#hidden=true
    
[802-11-wireless-security]
auth-alg=open
key-mgmt=wpa-psk
psk= "my password"

[ipv4]
method=auto
route-metric = 3000

[ipv6]
addr-gen-mode=stable-privacy
method=auto

if you can point me in the right direction that would be great.
Thanks in advance!

so you are using DHCP on both connections?

Give your LAN a static IP, on the network you want, and do NOT provide a gateway for it.

If your system only has ONE gateway, it will use that to get to the internet.

on both networks the mac address is reserved for a designated ip on that router, each router has it’s own ip range.

only on the wifi connection I have the internet… so I need to take the lan file and put that same IP in the ipv4 section without the gateway? and this will get everything working again?

That’s a DHCP reservation, not a static IP.

The DHCP server is probably handing out a gateway with that DHCP request, which means you need to manually configure the device to NOT have a gateway on that network.

so basically give the rpi the ip on the config file, the same as what is given to it by the router right?
and on the network with the internet I can leave the DHCP right?

Should work.

YES, working!

Thank you so much!