Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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

This comment has been minimized.

Copy link

@5ilv4n0 5ilv4n0 commented May 24, 2017

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

@JonthanLT

This comment has been minimized.

Copy link

@JonthanLT JonthanLT commented Jun 12, 2017

Thank you 👍

@ikeycc

This comment has been minimized.

Copy link

@ikeycc ikeycc commented Jun 13, 2017

Thank you !

@ActionScripted

This comment has been minimized.

Copy link

@ActionScripted ActionScripted commented Nov 20, 2017

@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
@ghost

This comment has been minimized.

Copy link

@ghost ghost commented Sep 20, 2018

Thank you +1

@m-adrien

This comment has been minimized.

Copy link

@m-adrien m-adrien commented Jun 21, 2019

Thank you ! Very useful for bash script !

@slmg

This comment has been minimized.

Copy link

@slmg 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment