Routed Setup mit zusätzlichem NAT-Netzwerk (kein Ping)

cyagon

New Member
May 27, 2021
5
2
3
28
Hallo,

Wegen des letzten IP-Preisanstiegs bei Hetzner möchte ich meine Netzwerk-Config ein wenig umgestalten. Ein Routed-Setup mit einer vmbr0 für öffentliche IPv4 und IPv6 und eine weitere vmbr1 für IPv4-NAT. Dies soll ermöglichen, dass VMs mit nur einer öffentlichen IPv6 zusätzlich auf IPv4-Only Adressen zugreifen können (wie bsw. Ubuntus snapcraft).

Hier meine Configs mit Beispiel-Adressen:

host config
Code:
auto lo
iface lo inet loopback

iface lo inet6 loopback

auto enp41s0
iface enp41s0 inet static
    address 192.168.1.120/32
    gateway 192.168.1.1
    pointopoint    192.168.1.1
    up            sysctl -p
    post-up        ip address add 2a01:db8::2/128 dev enp41s0
    post-up        ip route add default via fe80::1 dev enp41s0
    post-up     sysctl -w net.ipv4.ip_forward=1
    post-up        sysctl -w net.ipv6.conf.all.forwarding=1

auto vmbr0
iface vmbr0 inet static
    address 192.168.1.120/32
    bridge-ports none
    bridge-stp off
    bridge-fd 0
    bridge-vlan-aware yes
    bridge-vids 2-4094
    up ip route add 192.168.1.121/32 dev vmbr0
    up ip route add 192.168.1.122/32 dev vmbr0

iface vmbr0 inet6 static
    address 2a01:db8::2/64

auto vmbr1
iface vmbr1 inet static
    address 10.0.0.1/24
    bridge-ports none
    bridge-stp off
    bridge-fd 0
    post-up sysctl -w net.ipv4.ip_forward=1
    post-up iptables -t nat -A POSTROUTING -s '10.0.0.0/24' -o enp41s0 -j MASQUERADE
    post-down iptables -t nat -D POSTROUTING -s '10.0.0.0/24' -o enp41s0 -j MASQUERADE

Container config
Code:
eth0/vmbr0:
address4: 192.168.1.121/32
gateway4: 192.168.1.120
address6: 2a01:db8::121/64
gateway6: 2a01:db8::2

eth1/vmbr1:
address4: 10.0.0.121/24
gateway4: 10.0.0.1

Übers vmbr0 funktionieren öffentliche IPv4 und IPv6 problemlos, allerdings will übers vmbr1 nichts pingen.

Gibt es da eine Lösung?
 
Last edited: