Hi everyone!To ensure I documented the issue clearly and thoroughly, I used ChatGPT to help structure the problem, reproduce the steps, and suggest possible improvements.
Problem Summary:
When configuring a container-level firewall in the Proxmox GUI (Datacenter → CT → Firewall), outbound traffic rules (e.g., DROP OUT) do not take effect unless firewall=1 is explicitly set on the container's network interface in its config file (/etc/pve/lxc/XXX.conf).
This behavior is not clearly documented in the UI or the Proxmox wiki, and can lead users to believe that the firewall is malfunctioning, when in fact the filtering is silently disabled.
Steps to Reproduce:
- Create a new LXC container.
- Enable the firewall globally, on the node, and on the container (GUI).
- Add a rule in CT → Firewall → Rules:
- Direction: OUT
- Action: DROP
- Start the container and test outbound connectivity (e.g., ping 1.1.1.1).
- ➜ Traffic is still allowed.
- Check container config file: firewall=1 is missing from the net0 line.
- Manually edit /etc/pve/lxc/XXX.conf and change:
Code:net0: name=eth0,bridge=vmbr0,ip=192.168.1.10/24
to:
Code:net0: name=eth0,bridge=vmbr0,ip=192.168.1.10/24,firewall=1
- Restart the container: pct restart XXX
- ➜ Firewall rules now apply correctly. Outbound traffic is blocked as expected.
- ➜ Firewall rules now apply correctly. Outbound traffic is blocked as expected.
Expected Behavior:
If the firewall is enabled at all levels (Datacenter, Node, CT) and rules are present in the GUI, it should either:
- Automatically apply firewall=1 to the container’s NIC, or
- Warn the user in the GUI or logs that firewall=1 must be manually set for rules to take effect.
Suggested Fix or Improvement:
- Add a visual warning or validation step in the GUI when creating firewall rules for containers that do not have firewall=1 set.
- Consider applying firewall=1 by default when enabling the firewall for an LXC container.
- Update documentation and tooltips to make this requirement clear.