R
R
RuRoman2021-11-15 19:27:31
iptables
RuRoman, 2021-11-15 19:27:31

How to restore iptables rules after reboot?

I'm trying to restore the iptables rules after a reboot, they were originally written in the /etc/firewall.conf file. I

create a file for auto-recovery:
nano -w /etc/network/if-up.d/iptables

In the file:

#!/bin/sh
iptables-restore < /etc/firewall.conf


I set the permissions on the file:
chmod +x /etc/network/if-up.d/iptables

After a reboot, the rules are not restored ...
If you start it in manual mode:
iptables-restore < /etc/firewall.conf

Everything works ... I don’t understand what’s wrong ....

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
ky0, 2021-11-15
@ky0

What for to a crutch if there is a package which is specially intended for this purpose iptables-persistent?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question