Proxmox Firewall greift nicht über die /etc/network/interfaces vom Host

Daniel22

Member
Apr 8, 2020
1
0
6
23
Guten Tag, ich habe ein (hoffentlich) kleines Problem.

Ich habe für meine freigegebenen Ports nun Einträge in der Firewall auf dem (Rechenzentrum) angelegt und die Firewall dort und in der VM an sich aktiviert.

Jetzt möchte ich zum Beispiel den in der interfaces gerouteten Port 1222 (zur Maschine 102 Port 22) in der Firewall schließen, um ihn schnell aktivieren zu können wenn ich ihn wirklich gerade benötige.

Das ganze zeigt aber leider keinerlei Wirkung, da mein Port Forwarding in der interfaces anscheinend die Firewall umgeht?

Hier die interfaces:
Code:
### Hetzner Online GmbH installimage

source /etc/network/interfaces.d/*

auto lo
iface lo inet loopback
iface lo inet6 loopback

auto enp4s0
iface enp4s0 inet static
  address x.x.x.80
  netmask 255.255.255.224
  gateway x.x.x.65
  pointopoint x.x.x.65
  # route x.x.x.64/27 via x.x.x.65
  up route add -net x.x.x.64 netmask 255.255.255.224 gw x.x.x.65 dev enp4s0

iface enp4s0 inet6 static
  address x:x:x:1341::2
  netmask 64
  gateway fe80::1

auto vmbr0
iface vmbr0 inet static
        address  x.x.x.80
        netmask  255.255.255.224
        bridge_ports none
        bridge_stp off
        bridge_fd 0

auto vmbr1
iface vmbr1 inet static
    address 192.168.0.254
    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 '192.168.0.0/24' -o enp4s0 -j MASQUERADE
    post-down iptables -t nat -D POSTROUTING -s '192.168.0.0/24' -o enp4s0 -j MASQUERADE
    ############################
    # VM/Container 102
    # Interne IP: 192.168.0.102
    #
    # Dienst: "SSH/SFTP" mit Port: 22 erreichbar über x.x.x.80:1222
    post-up iptables -t nat -A PREROUTING -i enp4s0 -p tcp --dport 1222 -j DNAT --to 192.168.0.102:22
    post-down iptables -t nat -D PREROUTING -i enp4s0 -p tcp --dport 1222 -j DNAT --to 192.168.0.102:22
    #

Und hier der Eintrag in der Firewall (Input Policy steht auf DROP)

firewallgg.JPG

MfG Daniel
 
Hi!

Hast du dein Problem schon lösen können? In Proxmox VE gibt es mehrere wichtige Stellen um Firewalls zum Laufen zu bekommen:
  • Datencenter
  • Node
  • Gast
    • Regeln in PVE
    • Interfaces in PVE
    • Alle Möglichkeit innerhalb des Gastes selbst
Um einen Überblick über die Situation zu bekommen sind die folgenden Informationen wichtig:
Code:
cat /etc/pve/firewall/cluster.fw
cat /etc/pve/nodes/{YOUR_NODE}/host.fw
cat /etc/pve/qemu-server/100.conf | grep net
 

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!