easywall
easywall copied to clipboard
save iptables on reboot
Although it is a beta, would it be possible to save the iptables on reboot?
Hi @cj0duke, thank you for creating the issue! I also had the idea since I use easywall in production on nearly 20 systems and when I reboot them I always have to activate the firewall rules. The last day I thought about implementing that as configuration parameter since if you lock yourself out you still can reboot the system and the firewall is empty then.
The last day I thought about implementing that as configuration parameter since if you lock yourself out you still can reboot the system and the firewall is empty then.
Sounds good.
This would be nice to have.
Also, maybe an reverse acceptance timer option on reboot? So instead of immediately applying the firewall rules, it waits for x seconds before applying the rules on startup?
I created a python script called force_apply.py
from easywall.__main__ import CONFIG_PATH
from easywall.config import Config
from easywall.easywall import Easywall
config = Config(CONFIG_PATH)
easywall = Easywall(config)
easywall.rules.apply_new_rules()
easywall.apply_iptables()
Then I just created a bash script and use it at in my crontab routine
#!/bin/bash
cd /home/easywall/easywall
/usr/bin/env python3 -m easywall.force_apply