Masquerade not working

hexblot

Member
Nov 30, 2022
7
2
8
Athens, Greece
Hello,
have a root server with one nic and public dual stack ip, trying to configure NAT (maasquerade) as per docs, however the container seems unable (?) to reach out.

PVE has the following "/etc/network/interfaces" (have also tried using the interface directly instead of vmbr1):
Code:
source /etc/network/interfaces.d/*

auto lo
iface lo inet loopback
iface lo inet6 loopback

auto enp7s0
iface enp7s0 inet manual

auto vmbr1
iface vmbr1 inet static
        address a.b.c.245/26
        gateway a.b.c.193
        bridge-ports enp7s0
        bridge-stp off
        bridge-fd 0
        up route add -net a.b.c.192 netmask 255.255.255.192 gw a.b.c.193 dev enp7s0
        # route a.b.c.192/26 via a.b.c.193
        post-up echo 1 > /proc/sys/net/ipv4/ip_forward

iface vmbr1 inet6 static
        address x:y:z:w::2/64
        gateway fe80::1

auto vmbr0
iface vmbr0 inet static
  address 10.42.100.1/24
  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.42.100.0/24' -o vmbr1 -j MASQUERADE
  post-down iptables -t nat -D POSTROUTING -s '10.42.100.0/24' -o vmbr1 -j MASQUERADE

The VM (LXC) itself has the following networking:
1669914697626.png

the container has Alpine Linux (for tests), which seems to be able to ping but not actually use it:
1669914819574.png


Any insight would be extremely helpful. Thank you in advance!
 
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!