The built-in Proxmox VE firewall is one of the most effective security layers you can enable, yet it’s frequently overlooked in homelab deployments. A default Proxmox installation leaves the web UI (port 8006) and SSH accessible to every device on the LAN — and worse, if your host has a public IP or a forwarded port, accessible from the entire internet.
Proxmox’s firewall operates at four levels: datacenter (cluster-wide), node (per-host), VM/CT, and SDN. Policy inherits downward — a datacenter-level deny applies to every node and VM unless explicitly overridden. With nftables as the backend since Proxmox VE 8.x, the firewall is fast, modern, and fully manageable via CLI or API.
This guide walks through a production-ready harden: default-deny datacenter policy, IPsets for trusted management networks, host-level segmentation, fail2ban for brute-force prevention, and audit logging.
Firewall Architecture and Enabling the Firewall
The Proxmox firewall is an nftables wrapper managed through pve-firewall and pveproxy. Each node runs its own nftables ruleset, but the datacenter scope allows you to push consistent rules across your entire cluster.
To confirm the service status:
|
|
If it’s not running or disabled, enable it system-wide:
|
|
Or enable it through the API. Start with the datacenter level:
|
|
Repeat for each node if needed, but the datacenter enable flag triggers firewall activation on all cluster nodes.
Datacenter-Level Default-Deny Policy
The single most impactful change: switch the datacenter firewall from default-allow to default-deny.
|
|
Once applied, no inbound traffic reaches any node unless an explicit rule permits it. Your Proxmox web UI will become unreachable immediately — don’t panic. You need to add allow rules first.
Allow Management Access via Datacenter Rules
Add rules for SSH and the Proxmox web UI, scoped to your management network. Using a CIDR directly:
|
|
Allow ICMP (ping) for network troubleshooting:
|
|
Allow Cluster and Storage Traffic
If you run a Proxmox cluster, the nodes need to communicate on specific ports. Add rules for corosync (multicast), SSH replication, and NFS/CIFS storage:
|
|
IPSet Management for Trusted Networks
Hardcoding CIDR ranges in every rule is brittle. If your management IP range changes or you add a VPN subnet, you’d need to update every rule. IPSets solve this — a named set of CIDRs that rules reference by name. Update the set, and all referencing rules automatically use the new members.
Create IPsets
|
|
Create a separate set for backup traffic:
|
|
Reference IPsets in Firewall Rules
The IPset name goes in the --source field. Proxmox resolves it at apply time:
|
|
List all IPsets and their members:
|
|
Remove an IPset Entry
|
|
The CIDR is URL-encoded in the path — %2F for /. This is the standard Proxmox API behavior.
Host-Level Firewall Rules
Datacenter rules apply everywhere. Host-level rules apply to a single node. Use them for node-specific services that shouldn’t be cluster-wide.
|
|
Block everything else explicitly (already covered by datacenter default-deny, but explicit documentation helps):
|
|
The --enable 0 flag creates the rule in a disabled state — useful for staging before enforcement.
Apply firewall changes on the node:
|
|
Check the ruleset:
|
|
VM and Container Firewall Policies
Enabling the firewall on a VM or container interface gives you east-west traffic control — preventing a compromised container from probing other hosts.
First, enable the firewall on the VM network interface in the Proxmox web GUI (check the Firewall checkbox in the NIC settings), or via CLI:
|
|
Security Groups
Security groups let you define a reusable set of rules and assign them to multiple VMs:
|
|
Then apply the group to a VM:
|
|
Groups compose well with IPsets — use --source mgmt_net inside a group rule to restrict SSH access to your management IPset.
Fail2ban for Proxmox Web UI Brute-Force Protection
Proxmox’s web UI (pveproxy) logs authentication failures to /var/log/pveproxy/access.log. Hook fail2ban into those logs to ban IPs that hit auth endpoints repeatedly.
Create the fail2ban Filter
|
|
Create the Jail
|
|
Reload and Test
|
|
Test the filter by triggering a failed login:
|
|
Then check:
|
|
If fail2ban picks it up, you’ll see the failed count increment.
Firewall Logging and Audit
Every dropped or accepted packet can be logged. Set log level on a per-rule basis:
|
|
View the firewall log stream:
|
|
Or read the log file directly:
|
|
A typical log line looks like this:
Jun 16 10:23:45 srv1 pve-firewall[1234]: DROP IN=vmbr0 OUT= MAC=... SRC=203.0.113.5 DST=10.0.20.30 LEN=40 TOS=0x00 PREC=0x00 TTL=118 ID=54321 PROTO=TCP SPT=40001 DPT=8006 WINDOW=65535
Forward these logs to your monitoring stack. On a Grafana Loki setup:
|
|
Rule Ordering and Best Practices
The Proxmox firewall processes rules first-match. Order matters:
- Put explicit allow rules for trusted sources early
- Place log rules before blocking rules so you see what’s denied
- End with a catch-all deny (the default-deny policy covers this at datacenter level)
Best Practices Checklist
- Always use IPsets — never hardcode CIDRs in individual rules
- Comment every rule —
--comment "SSH from mgmt VLAN"saves future-you hours - Stage rules with –enable 0 — test before enforcing
- Document IPset CIDR entries — use
--commenton the CIDR add command - Check the ruleset periodically:
|
|
- Test connectivity after each change — have a management session open before applying host-level deny rules
- Enable VM-level firewalls on any VM exposed to the internet (web servers, game servers)
Conclusion
The Proxmox VE firewall is a powerful, nftables-based security layer that many homelabs leave disabled. With a datacenter default-deny policy, dynamic IPsets for management networks, host-level segmentation, security groups for VMs, and fail2ban guarding the web UI, you build a defense-in-depth posture that stops automated scanners, limits lateral movement, and keeps your hypervisor accessible only from trusted networks.
Start small: enable the firewall, deploy a mgmt_net IPset with your admin LAN and VPN pool, and switch inbound policy to DROP. Everything else builds on that foundation.