Skip to content

Instantly share code, notes, and snippets.

@alonisser
Last active October 10, 2024 07:21
Show Gist options
  • Save alonisser/a2c19f5362c2091ac1e7 to your computer and use it in GitHub Desktop.
Save alonisser/a2c19f5362c2091ac1e7 to your computer and use it in GitHub Desktop.
Installing iptables-persistent on ubuntu without manual input
echo iptables-persistent iptables-persistent/autosave_v4 boolean true | sudo debconf-set-selections
echo iptables-persistent iptables-persistent/autosave_v4 boolean true | sudo debconf-set-selections
sudo apt-get -y install iptables-persistent
@5ilv4n0
Copy link

5ilv4n0 commented May 24, 2017

both lines are v4! i think one have to be v6? :)

@JonathanLT
Copy link

Thank you 👍

@wzw1990
Copy link

wzw1990 commented Jun 13, 2017

Thank you !

@ActionScripted
Copy link

@5ilv4n0: yes, correct. To any wayward web search folks, here's an updated version:

echo iptables-persistent iptables-persistent/autosave_v4 boolean true | sudo debconf-set-selections
echo iptables-persistent iptables-persistent/autosave_v6 boolean true | sudo debconf-set-selections

sudo apt-get -y install iptables-persistent

You can verify these fields by installing debconf-utils and searching for iptables values:

sudo apt install debconf-utils

sudo debconf-get-selections | grep iptables

Copy link

ghost commented Sep 20, 2018

Thank you +1

@m-adrien
Copy link

Thank you ! Very useful for bash script !

@slmg
Copy link

slmg commented Jan 11, 2021

Thanks. Here's a variation.

sudo debconf-set-selections <<EOF
iptables-persistent iptables-persistent/autosave_v4 boolean true
iptables-persistent iptables-persistent/autosave_v6 boolean true
EOF

@gluehbirnenkopf
Copy link

thx! ;)

@pogossian
Copy link

thanks

@malikshi
Copy link

@slmg

Thanks. Here's a variation.

sudo debconf-set-selections <<EOF
iptables-persistent iptables-persistent/autosave_v4 boolean true
iptables-persistent iptables-persistent/autosave_v6 boolean true
EOF

Is it works for debian 11?

@thuanpham582002
Copy link

Thankiu

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment