Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iptables rules are not persistent #6

Open
o-l-a-v opened this issue Apr 26, 2023 · 1 comment
Open

iptables rules are not persistent #6

o-l-a-v opened this issue Apr 26, 2023 · 1 comment

Comments

@o-l-a-v
Copy link

o-l-a-v commented Apr 26, 2023

Rules generated by this script are not persistent. Script and README.md says nothing about this.

Either mention it in the README.md, and point to options for persistence. Like iptables-persistent.
Or handle it in the script.

I managed to make it persistent like so:

Make iptables persistent

Export current IP tables to a file

sudo iptables-save > ~/rules.v4

Copy file to the location iptables-persistent will use on reboot

sudo /bin/cp -rf ~/rules.v4 /etc/iptables/rules.v4

@LucianFrango
Copy link

With Ubuntu 22.04 LTS, to get this to work, I had to:

Install IP tables
sudo apt-get install iptables-persistent

Save IP tables
sudo iptables-save | sudo tee /etc/iptables/rules.v4

Reboot and test
sudo reboot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants