Sample Header Ad - 728x90

cannot get iptables to auto load rules on reboot with iptables-persistent

0 votes
2 answers
2595 views
I need some help, or advice. I have a latest server I am trying to get into production and I cannot get it to load its rules on a reboot. "Debian GNU/Linux 10 (buster)" it is up to date in its packages I have installed iptables-persistent, I have ran dpkg-reconfigure iptables-persistent, and it does save the rules in /etc/iptables I have the following in the folder rules.v4 rules.v6 On a reboot it will not load my rules. IF I do this below, it works just fine! IT will just not do this for me on reboot.
iptables-restore < /etc/iptables/rules.v4
I have tried following many leads online, starting from these. https://unix.stackexchange.com/questions/52376/why-do-iptables-rules-disappear-when-restarting-my-debian-system https://unix.stackexchange.com/questions/125833/why-isnt-the-iptables-persistent-service-saving-my-changes I don't know what I am doing wrong. I do have fail2ban installed and working. I can't see this conflicting, but on boot they both would be working with iptables... Are there ways to view the iptables logs? Does it log to journalctl? I cannot find any msges that can give me an idea why it is not working. These rules gotta load on boot. Someone did mention to load this in /etc/rc.local, which I am unfamiliar with, that file is not there on Debian, and some have explained to just stick with iptables-persistent, which I would tend to agree with. https://unix.stackexchange.com/questions/52376/why-do-iptables-rules-disappear-when-restarting-my-debian-system#answer-52378 Any help is appreciated, or logs to iptables if any. This is my boot logs when I try a reboot journalctl -f -unetfilter-persistent
Jan 02 15:09:06 domain.ca netfilter-persistent: run-parts: executing /usr/share/netfilter-persistent/plugins.d/25-ip6tables start
Jan 02 15:09:06 domain.ca systemd: Started netfilter persistent configuration.
Jan 02 15:09:50 domain.ca systemd: Stopping netfilter persistent configuration...
Jan 02 15:09:50 domain.ca netfilter-persistent: Automatic flush disabled; use '/usr/sbin/netfilter-persistent flush'
Jan 02 15:09:50 domain.ca systemd: netfilter-persistent.service: Succeeded.
Jan 02 15:09:50 domain.ca systemd: Stopped netfilter persistent configuration.
Jan 02 15:09:50 domain.ca systemd: Starting netfilter persistent configuration...
Jan 02 15:09:50 domain.ca netfilter-persistent: run-parts: executing /usr/share/netfilter-persistent/plugins.d/15-ip4tables start
Jan 02 15:09:50 domain.ca netfilter-persistent: run-parts: executing /usr/share/netfilter-persistent/plugins.d/25-ip6tables start
Jan 02 15:09:50 domain.ca systemd: Started netfilter persistent configuration.
Asked by gstlouis (85 rep)
Dec 27, 2022, 03:22 PM
Last activity: Feb 2, 2024, 07:03 PM