View previous topic :: View next topic |
Author |
Message |
Tzuriel Apprentice
Joined: 01 Jun 2004 Posts: 259
|
Posted: Fri Jul 29, 2022 8:40 pm Post subject: reload iptables w/ initial settings |
|
|
I was working with iptables and have made some mistakes to where I'd like to flush everything and reload with the configuration that comes with Gentoo, but not sure how.
Thoughts? |
|
Back to top |
|
|
pjp Administrator
Joined: 16 Apr 2002 Posts: 20067
|
Posted: Fri Jul 29, 2022 8:56 pm Post subject: |
|
|
By default, the location where rules are saved is IPTABLES_SAVE=/var/lib/iptables/rules-save as defined in /etc/conf.d/iptables.
Stop iptables, delete or move the "rules-save" file, and I believe you'll have the default rules the next time iptables is started (at least with openrc as /etc/init.d/iptables sets up some defaults).
If you don't specifically need iptables, you might instead consider using its successor, nftables. _________________ Quis separabit? Quo animo? |
|
Back to top |
|
|
trilithium n00b
Joined: 18 Nov 2019 Posts: 43
|
Posted: Fri Jul 29, 2022 9:16 pm Post subject: |
|
|
If you haven't yet restarted the iptables service you should still have a copy of all your previous rules in the file mentioned by pjp and can restore them using the script iptables-restore:
Code: | iptables-restore /var/lib/iptables/rules-save |
|
|
Back to top |
|
|
|