[SOLVED] Only VMs on main bridged NW can access the Internet

michalisk

New Member
Jan 12, 2022
6
0
1
37
Hi,
I have the following configuration in which I am trying to modyify accordingly so the VMs belonging to both bridged NW 0 (vmbr0) and bridged NW 1 (vmbr1) to be able to access the internet trough the main interface which eno1.

The following configuration allows my VMs belonging to vmbr0 NW to access the internet (obviously due to IP FW and MASQUERADE) however when I am trying to do something similar for vmbr1 (192.168.1.0/24) after reboot the lines I appended disappear.

Can you please help understand what I need to do in order to access the internet from the VMs belonging to vmbr1 (192.168.1.0/24)?

Thanks,
Michalis

Following my network interfaces configuration


Code:
# network interface settings; autogenerated
# Please do NOT modify this file directly, unless you know what
# you're doing.

auto lo
iface lo inet loopback

auto eno1
iface eno1 inet static
        address 10.28.10.71/24
        gateway 10.27.0.1

auto enx00116b6659d7
iface enx00116b6659d7 inet manual

auto enp2s0
iface enp2s0 inet manual


auto vmbr0
iface vmbr0 inet static
        address 192.168.0.1/24
        bridge-ports none
        bridge-stp off
        bridge-fd 0

auto vmbr1
iface vmbr1 inet static
        address 192.168.1.1/24
        bridge-ports enp2s0
        bridge-stp off
        bridge-fd 0

auto vmbr2
iface vmbr2 inet static
        address 192.168.2.1/24
        bridge-ports enx00116b6659d7
        bridge-stp off
        bridge-fd 0

        post-up   echo 1 > /proc/sys/net/ipv4/ip_forward
        post-up   iptables -t nat -A POSTROUTING -s '192.168.0.0/24' -o eno1 -j MASQUERADE
        post-down iptables -t nat -D POSTROUTING -s '192.168.0.0/24' -o eno1 -j MASQUERADE
 
after reboot the lines I appended disappear.

config don't disappear themself.
the only case, could be a pending config done with gui, written in /etc/network/interfaces.new.
at reboot, this file replace /etc/network/interfaces.


So maybe, try to change the config file again. (simply add the post-up/down postrouting on the corresponding vmbrX)
 
  • Like
Reactions: michalisk
Hi spirit,

Thank you for that.
The solution was easy. Looks like I did not set bridged ports on vmbr2 as the above network configuration file I posted claims.
I tried this after setting this and the MASQUERATE worked perfectly.

Thanks
Michalis
 

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!