I am using a script (one that I have created with fwbuilder) to set up my iptables
firewall. Since the device we are talking about is a notbook rather than a server in a quasi static network, I need to run the script whenever the interfaces change, e.g. because I switch wifi on and of.
How do I achieve that reliably way, such that my notebook does not stay unprotected, e.g. at boot time or during initialization of any of the interfaces.
Edit
How about placing a symlink to the script in /etc/NetworkManager/dispatcher.d/pre-up.d/
(https://people.freedesktop.org/~lkundrak/nm-docs/NetworkManager.html). Does that make sense?
ifconfig
. Note that I could e.g. also connect/deconect external network adapters. What I need is a mechanism that runs the script at boot and whenever the interfaces or their connection status changes such that the rules are always apt, as defined in the script, no matter where I am.net-o-matic
script,git clone https://github.com/waltinator/net-o-matic.git