Proxmox VEXV · Security & HardeningFirewall
Proxmox firewall: host, VM, security groups
What you'll learn
- Enable the host and VM firewalls
- Write effective firewall rules
- Use security groups, IP sets, and aliases for DRY rules
- Avoid common firewall mistakes
Prerequisites
Verified against Proxmox VE 9.2.4 · Proxmox Backup Server 4.2.5 · Ceph Squid / Tentacle · Debian 13 (Trixie) · Linux kernel 7.0 (PVE 9.2 default) · 2026-08-07
Why this matters in production
The Proxmox firewall is the layer between the network and your workloads. Misconfigured firewalls either expose too much (security risk) or block legitimate traffic (operational pain).
Layers
The Proxmox firewall operates at three layers:
| Layer | Where | What it controls |
|---|---|---|
| Datacenter | /etc/pve/firewall/cluster.fw | Cluster-wide rules |
| Node | /etc/pve/nodes/<node>/host.fw | Host firewall (affects node itself) |
| VM | VM’s network config | Per-VM rules on tap interface |
flowchart LR
A[Network] --> B[Datacenter rules]
B --> C[Node rules]
C --> D[VM rules]
D --> E[VM guest]
Enabling the firewall
GUI: Datacenter → Firewall → Options → Firewall: Yes. Or:
pvesh set /cluster/firewall/options --enable 1
Each VM has its own firewall=1 flag on each NIC.
Rule structure
A rule has:
- Direction (in/out)
- Action (ACCEPT, DROP, REJECT)
- Source / destination (IP, CIDR, alias, ipset)
- Port
- Comment (mandatory in production)
Aliases and IP sets
Aliases and IP sets let you write rules once and reuse them.
pvesh create /cluster/firewall/aliases --name mgmt-net --cidr 10.10.0.0/16
pvesh create /cluster/firewall/ipset --name blocklist --cidr 198.51.100.0/24
Then reference in rules: source = mgmt-net, source = +blocklist (negative).
Security groups
Security groups are collections of rules applied to multiple VMs:
pvesh create /cluster/firewall/groups --group web-tier --rule 'action=ACCEPT,iface=net0,source=mgmt-net,dport=443,proto=tcp,comment=Allow HTTPS from management'
Attach the group to a VM:
pvesh create /nodes/pve-01/qemu/100/firewall/groups --group web-tier --pos 0
Common mistakes
- “I’ll add rules later” — leaving the firewall off. Default is off.
- ACCEPT all for “simplicity” — that’s no firewall.
- Blocking Corosync traffic — breaks cluster.
A break/fix exercise
Cluster loses quorum after enabling host firewall
Symptoms
- After enabling the host firewall, pvecm status shows Votequorum: 1; expected 3
- Nodes cannot reach each other on UDP 5404-5405
Available evidence
- Host firewall was just enabled cluster-wide
- No specific rules were added before enabling
- The default Proxmox firewall policy is ACCEPT but cluster traffic is not explicitly allowed
- tcpdump on the Corosync interface shows no inbound UDP 5404-5405 from peers
Show diagnosis & remediation
Root cause
The default firewall policy in Proxmox is DROP inbound except for established connections. Cluster traffic from peer nodes appears as new inbound and is dropped.
Safe remediation
Add explicit rules to allow cluster traffic: ACCEPT UDP 5404-5405 from cluster nodes; ACCEPT TCP 22, 2224, 8006 from management. Apply cluster-wide. Verify pvecm status recovers.
Verification
pvecm status returns to Votequorum: 3. Cluster operations work.
Prevention
Before enabling the firewall cluster-wide, prepare and test rules on a single node. Always allow cluster traffic (Corosync, SSH between nodes, pveproxy).
Production considerations
Common mistakes
- Enabling firewall without explicit allow-list for cluster traffic.
- Using ACCEPT-all as a “temporary” measure.
- Not testing rules before applying cluster-wide.
Key takeaways
- Default firewall is OFF. Enable it deliberately.
- Use aliases and security groups.
- Always allow cluster traffic.
Knowledge check
Knowledge check · 3 questions
Q1. Which Proxmox firewall layer controls traffic to the node itself (not guest VMs)?
Q2. The Proxmox firewall defaults to DROP on new inbound connections, yet enabling it does not break Corosync.
Q3. Which UDP ports must always be open between cluster nodes?
Passing score: 75%. Answers are checked in this browser.