Problem with gateway on vmbrs

subjectx

Member
Nov 4, 2020
36
3
8
112
Greetings,

So, having 4 NICs on my server, I decided to do the following:
- bond (LACP) two copper 1Gbps NICs into one and enslave it onto vmbr0, which also has public IP defined on it.
- enslave one of optical NICs (enp67s0f1) onto vmbr 2, which also has public IP and gateway defined on it.

Code:
auto lo
iface lo inet loopback


auto eno1
iface eno1 inet manual


auto eno2
iface eno2 inet manual


auto enp67s0f0
iface enp67s0f0 inet manual


auto enp67s0f1
iface enp67s0f1 inet manual


auto bond0
iface bond0 inet manual
        bond-slaves eno1 eno2
        bond-miimon 100
        bond-mode 802.3ad
        bond-xmit-hash-policy layer2+3


auto vmbr0
iface vmbr0 inet static
        address 212.x.x.29/29
        bridge-ports bond0
        bridge-stp off
        bridge-fd 0
#WAN BAKER


auto vmbr1
iface vmbr1 inet static
        address 192.168.8.1/24
        bridge-ports none
        bridge-stp off
        bridge-fd 0

#INTERNET BAKER


auto vmbr2
iface vmbr2 inet static
        address 212.xxx.xxx.30/29
        gateway 212.xxx.xxx.25
        bridge-ports enp67s0f1
        bridge-stp off
        bridge-fd 0
#WAN OPTIKA


auto vmbr3
iface vmbr3 inet static
        address 192.168.4.1/24
        bridge-ports none
        bridge-stp off
        bridge-fd 0

Problem is, I dont get any internet on VMs, that are using vmbr1 as bridge on guest NIC type virtio. If I move gateway from vmbr2 to vmbr0, then VMs on vmbr3 dont get any internet.

Is there a fix I'm to thick to see? Must I specify gateway in some other way on VMs that are not using vmbr3 without gateway? How to google it?

I tried with iptables:

Code:
iptables -t nat -A POSTROUTING ! -d 192.168.4.0/24 -o vmbr2 -j SNAT --to-source 212.xxx.xxx.25
ip route add 192.168.4.0/24 dev vmbr2

But it doesnt work..

Maybe, to mention, I'm using masquerade to make internet working on VMs:
Code:
iptables -t nat -A POSTROUTING -s 192.168.4.0/24 -o vmbr2 -j MASQUERADE

It doesnt help if I do the same for other vmbr0 like, I think it even stops working on vmbr2
Code:
iptables -t nat -A POSTROUTING -s 192.168.8.0/24 -o vmbr0 -j MASQUERADE
 
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!