F
F
Forest Fox2021-03-18 16:44:41
linux
Forest Fox, 2021-03-18 16:44:41

Why doesn't autoloading iptables ubuntu iptables-restore rules work?

After each restart of the system, network settings are reset,
I used the command ( iptables-save > /home/linux/Vlad/iptables3.backup )
and then wrote in ( interfaces ) ( iptables-restore < /home/linux/Vlad/iptables3.backup )
that I could do it wrong or what other options are there?
60535790327e0296689267.png

Answer the question

In order to leave comments, you need to log in

3 answer(s)
K
ky0, 2021-03-18
@ky0

The parenthesis in the team with participation iptables-restoreis superfluous - just iptables-restore /home/linux/Vlad/iptables3.backuptry it.

F
Forest Fox, 2021-03-18
@SilentFoxix

after reboot, the settings also flew off
6053684c01b41113679231.png605368512b84a983606439.png

V
VSF, 2021-03-19
@Viksf

In /etc/network/if-pre-up.d/ , create a file with the code below, change ownership to root, and set the startup flag.

#!/bin/bash
/sbin/iptables-restore < /home/linux/Vlad/iptables3.backup

ps File iptables3.backup , it is better to throw in /etc and rights only for root

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question