Linux firewall rules do not always survive a reboot automatically. The behavior depends on whether you're using iptables, nftables, UFW, or another firewall management tool.
It is also possible that multiple firewall services are managing rules simultaneously and overwriting each other's configurations.
Here's how to investigate:
Identify the active firewall system:
sudo systemctl status nftables
Inspect the current rules:
sudo nft list ruleset
If using UFW, check its status:
sudo ufw status verbose
Check whether the firewall service is enabled at startup:
systemctl is-enabled nftables
Verify that the configuration is saved using the method supported by your distribution and firewall tool.
Test persistence after reboot using your VPS provider's console.
Important: Before changing firewall rules remotely, make sure SSH access is explicitly allowed. Keep an alternative console session available so a configuration mistake doesn't lock you out.