3

We have two different network interfaces eno1 and eno2 (eno3 and eno4 are not connected) and we have one bridge vmbr0 we want to add another bridge vmbr1 and we want to set two different gateways on these bridges.

Currently vmbr0's gateway is set to 172.20.10.1. now we want to create another bridge vmbr1 and set it's gateway to 172.20.1.40

I entered these parameters for creating vmbr1 enter image description here

but the proxmox interface doesn't allow this proxmox's error

This is my configuration config

and this is the output of ifconfig.

I am using Proxmox VE 5.4-13 on HP ProLiant DL380p Gen8

and uname -a shows

Linux vmserver1 4.15.18-21-pve #1 SMP PVE 4.15.18-48 (Fri, 20 Sep 2019 11:28:30 +0200) x86_64 GNU/Linux

The main reason I want to do this is for creating VMs on two different networks.

The networks are separate and NOT PHYSICALLY CONNECTED to each other.

Erfan Azhdari
  • 216
  • 2
  • 7

1 Answers1

2

You're confusing the network routing table for the host with the definition of a bridge. A bridge does not have a default route; it's just a device for connecting different network interfaces. Routing tables can have a default route (or not).

When you define a bridge you also get the opportunity to define a default route for a host interface through that bridge, but you do not need to assign either a host IP address or default route.

In your case you say, "Currently vmbr0's gateway is set to 172.20.10.1. now we want to create another bridge vmbr1 and set its gateway to 172.20.1.40". You can't do that: a server can have just a single default gateway*, which by definition defines the route for packets that have no other explicit destination.

However, your virtual machines can have a default route, and they could have an IP address on the subnet you've planned for vmbr1 (172.20.1.0/24, perhaps?), and an associated default route of 172.20.1.40.

An example. On my home network I also have two NICs each attached to a bridge. The host itself has an IP address only on one of these bridges. A firewall has an IP address on both bridges, and the remainder of my VMs are attached to just one bridge.

DO NOT plan for your Proxmox host to route between the two networks. It won't do that by default and it would be a very bad idea to make it do so.

* Unless you choose the complexity of multiple routing tables, but let's not go there.

roaima
  • 107,089
  • 14
  • 139
  • 261
  • What are the reasons *why* having the Proxmox host route between the two networks is a bad idea (other than that it's not the default behavior)? – cpit Apr 29 '23 at 07:15
  • 2
    @cpit Proxmox is a hypervisor. Let it do that one thing well. If you want a router between two networks you should use a specialised device or if that's not possible then set it up in a VM – roaima Apr 29 '23 at 07:33
  • Gotcha. Then if you had, for example, a Proxmox host with multiple NICs on separate, otherwise unconnected, networks, it would be reasonable to route between them given that functionality was isolated to a container? And so it would be the isolation that made such a setup not as much of a "very bad idea"? – cpit Apr 30 '23 at 12:59
  • 1
    @cpit I would say so, yes – roaima Apr 30 '23 at 19:38