[TUTORIAL] Aussperrschutz, wenn man an der Proxmox Firewall (iptables) rumschraubt

treki

Well-Known Member
Sep 7, 2016
33
5
48
54
Wer kennt das nicht, man will die PVE Kiste securen und erstellt Rules in den iptables.
Plötzlich hat man sich selber ausgesperrt. Ärgerlich und kann dann nur noch mittels Rescuemodus behoben werden.
Bei grossen Kisten mit vielen VMs ist das nicht sonderlich toll.
Habe mir ein Script geschrieben, welches alle 15min die Firewall ausschaltet.
Bevor man also rumschraubt, diesen Cronjob aktivieren.
Wenn man es verkackt, wird man spätestens nach 15min wieder Zugriff haben, ohne Reboot.
Läuft bei mir auf PVE 6. Nehme an, dass das auch auf PVE 5 Dosen läuft.
Nach getaner Arbeit und die Firewall sauber läuft, einfach nur den Cronjob kommentieren (mit # voran).

dis.fw
Code:
#!/bin/sh

###############################################
####      Disable PVE Firewall V1.0       #####
####         by treki  (c) 2020           #####
###############################################

# Muss mit root-Rechten laufen und in /root liegen. Rechte 700
# Cronjob alle 15min  ( sudo crontab -e )
# */15 * * * * /root/dis.fw >/dev/null 2>&1

sed -i 's/enable\: 1/enable\: 0/' /etc/pve/firewall/cluster.fw
exit
 

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!