Sunday, April 28, 2024
 Popular · Latest · Hot · Upcoming
0
rated 0 times [  0] [ 0]  / answers: 1 / hits: 481  / 1 Year ago, mon, february 6, 2023, 2:44:19

I installed iptables and iptables-persistent in order to save the rules and apply them after reboot, however whenever I try to restore or save I get this errors:



  1. with sudo netfilter-persistent save : usr/share/netfilter-persistent/plugins.d/15-ip4tables: 45: /usr/share/netfilter-persistent/plugins.d/15-ip4tables: /sbin/modprobe: not found

  2. with sudo netfilter-persistent reload after reboot: the rules were not saved so it does not block with my rule: sudo iptables -I INPUT -p icmp --icmp-type 8 -i eno1 -j DROP

  3. I've tried to save with iptables-save > /etc/iptables/rules.v4 && ip6tables-save > /etc/iptables/rules.v6 but it doesn't seem to add the rule, and after reboot

  4. sudo iptables-restore < /etc/iptables/rules.v4 sends: Bad argument '[unsupported' Error occurred at line: 30


my Ubuntu version is 18, please help save rules after reboot


EDIT: my error on 2: /usr/share/netfilter-persistent/plugins.d/25-ip6tables: 45: /usr/share/netfilter-persistent/plugins.d/25-ip6tables: /sbin/modprobe: not found


More From » networking

 Answers
4

So I found the problem regrading 1&2: You need reinstall the module of modprode, read more here:
https://bugs.launchpad.net/ubuntu/+source/iptables-persistent/+bug/1820144


Basically just install apt-get --reinstall install module-init-tools before apt install -y iptables-persistent netfilter-persistent and it will work


[#346] Monday, February 6, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
bleger

Total Points: 468
Total Questions: 108
Total Answers: 100

Location: Belarus
Member since Wed, Dec 7, 2022
1 Year ago
bleger questions
Wed, Mar 1, 23, 03:00, 1 Year ago
Wed, Dec 29, 21, 13:59, 2 Years ago
Fri, May 5, 23, 16:10, 1 Year ago
;