two nics with different gateways

11MeG

New Member
Dec 27, 2021
2
0
1
44
Hello,
I have the following situation:
2 routers (IOT and Main) these are connected to each other but the IOT router only has Internet access going out via a port of the main router. And can not see the rest of the Main routers network.
The main router can see all the devices connected to the IOT network. So when my phone is connected to the main router i can control the IOT devices.
I have made virtual machine in Proxmox for home assistant in the IOT network (ip/ gateway 192.168.30.50/192.168.30.2) but now home assistant con not see any devices connected to my main router like my phone. I would like to add a second nic to proxmox/home assistants virtual machine so that home assistant can see the main router network and thereby my phone.

Can anyone help me to make this work? since it is not possible to add a second bridge in proxmox with a different gateway.

IOT router 192.168.30.0 range with 192.168.30.2 as default gateway
Main router 192.168.15.0 range with 192.168.15.2 as default gateway.

Hope someone can help.
Jeroen
 
I don't see the problem. A host can only use one default gateway at a time so your PVE host should use the main router as its gateway.
But you can create an additional bridge without any gateway and attach that bridge to the NIC that is connected to your IoT Router.
All guests attached to that second (IoT) bridge are then bridged to your IoT subnet and you can then set your IoT router as the guests gateway from the guests OS.
And in case your host needs to access a subnet that none of its NICs has a IP in that subnet and if that target subnet is not reachable by your gateway, you can also setup static routes to manually tell your host where to send the packets to.
 
Last edited:

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!