Masquerading not working in routed config

Matadmin

Member
Jan 24, 2022
1
0
6
23
Hi,

I have a server on Hetzner where I wanted to use Proxmox 7.1.2, so I configured it according to the tutorial (https://community.hetzner.com/tutorials/install-and-configure-proxmox_ve).

I noticed that when I use the routed config IP masquerading stops working, the containers/vms have no more internet access.

I'm really curious to the cause of this since I've spend some time trying to get things to work, below are the 2 config examples. Any idea what could be the cause of this ?

------------------------------------------------------------
Working masquerading with bridged port
------------------------------------------------------------

auto lo
iface lo inet loopback

iface enp35s0 inet manual

auto vmbr0
iface vmbr0 inet static
address xx.xx.xx.xx
hwaddress xx:xx:xx:xx:xx:xx
netmask 255.255.255.255
pointtopoint xx.xx.xx.xx
gateway xx.xx.xx.xx
bridge_ports enp35s0
bridge_stp off
bridge_fd 0

auto vmbr1
iface vmbr1 inet static
address 10.10.10.1
netmask 255.255.255.0
bridge_ports none
bridge_stp off
bridge_fd 0

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 -A POSTROUTING -s '10.10.10.0/24' -o vmbr0 -j MASQUERADE

--------------------------------------------------------------------
Routed config with non working masquerading
--------------------------------------------------------------------

auto lo
iface lo inet loopback


auto enp35s0
iface enp35s0 inet static
address xx.xx.xx.xx
netmask 255.255.255.255
pointopoint xx.xx.xx.xx
gateway xx.xx.xx.xx

auto vmbr0
iface vmbr0 inet static
address xx.xx.xx.xx
netmask 255.255.255.255
bridge_ports none
bridge_stp off
bridge_fd 0

auto vmbr1
iface vmbr1 inet static
address 10.10.10.1
netmask 255.255.255.0
bridge_ports none
bridge_stp off
bridge_fd 0

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 -A POSTROUTING -s '10.10.10.0/24' -o vmbr0 -j MASQUERADE
 

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!