Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Networking & Security
  • Search

reload iptables w/ initial settings

Having problems getting connected to the internet or running a server? Wondering about securing your box? Ask here.
Post Reply
Advanced search
3 posts • Page 1 of 1
Author
Message
Tzuriel
Apprentice
Apprentice
Posts: 271
Joined: Tue Jun 01, 2004 7:10 pm

reload iptables w/ initial settings

  • Quote

Post by Tzuriel » Fri Jul 29, 2022 8:40 pm

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?
Top
pjp
Administrator
Administrator
User avatar
Posts: 20668
Joined: Tue Apr 16, 2002 10:35 pm

  • Quote

Post by pjp » Fri Jul 29, 2022 8:56 pm

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?
Top
trilithium
n00b
n00b
Posts: 43
Joined: Mon Nov 18, 2019 7:22 pm

  • Quote

Post by trilithium » Fri Jul 29, 2022 9:16 pm

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: Select all

iptables-restore /var/lib/iptables/rules-save
Top
Post Reply

3 posts • Page 1 of 1

Return to “Networking & Security”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic