easywall icon indicating copy to clipboard operation
easywall copied to clipboard

save iptables on reboot

Open cj0duke opened this issue 4 years ago • 4 comments

Although it is a beta, would it be possible to save the iptables on reboot?

cj0duke avatar Nov 23 '20 01:11 cj0duke

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.

jp1337 avatar Nov 23 '20 13:11 jp1337

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.

cj0duke avatar Nov 23 '20 23:11 cj0duke

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?

rcmcdonald91 avatar Dec 22 '20 13:12 rcmcdonald91

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

themelektaus avatar Jun 15 '21 21:06 themelektaus