2nd NAT Network with access to the Internet

abacao

New Member
Sep 1, 2023
3
0
1
Hello all,

I want to have a segregated network configuration for a group of VMs but I only have one NIC.

vmbr0 is working fine and I wanted to have a vmbr1 with a different IP set just for all the VMs in that network.

I was able to create vmbr1 and attach it to 2 VMs.
I can ping VM1 from VM2 and vice-versa.

Now I want to add internet to that network.

How can that be done?
 
Thank you.

For later help, I was able to add this with success.

vim /etc/network/interfaces

Code:
auto vmbr1
iface vmbr1 inet static
        address 10.10.10.1/24
        bridge-ports none
        bridge-stp off
        bridge-fd 0
#Private LAN RC

post-up   echo 1 > /proc/sys/net/ipv4/ip_forward
post-up   iptables -t nat -A POSTROUTING -s 10.10.10.0/24 -o vmbr0 -j MASQUERADE
post-down iptables -t nat -D POSTROUTING -s 10.10.10.0/24 -o vmbr0 -j MASQUERADE
post-up   iptables -t raw -I PREROUTING -i fwbr+ -j CT --zone 1
post-down iptables -t raw -D PREROUTING -i fwbr+ -j CT --zone 1


Remember that you need to setup IPs by hand as we don't have a DHCP server.
 

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!