Search for:

Available article translations:

Rules disappear after restarting iptables

Article ID: 114881, created on Oct 3, 2012, last review on May 11, 2014

  • Parallels Plesk for Linux/Unix
  • Parallels Plesk Sitebuilder for Linux/Unix
  • Parallels Plesk Expand
  • Parallels Operations Automation
  • Parallels Business Automation - Enterprise
  • Parallels Business Automation - Standard
  • Parallels Virtuozzo Containers for Linux
  • Parallels Server


I have stopped and started iptables with these commands:

# /etc/init.d/iptables stop
# /etc/init.d/iptables start

Now I see that some rules have disappeared. What could be the reason?


If rules were added using /sbin/iptables utility, they were added to a chain in the memory and were not committed to the hard disk. Upon restart, those rules were flushed from the memory and not restored.


In order to avoid losing rules during an iptables restart, you need to save them before the restart.

Method 1:
# iptables-save > iptables_save.txt

If using this method, you will need to restore the rules after the restart:
# iptables-restore <iptables_save.txt

Method 2:
# /etc/init.d/iptables save
Saving firewall rules to /etc/sysconfig/iptables: [ OK ]

The above command saves the rules to the file system, and an iptables restart will not affect them.
This method is preferable if you want to leave the server intact.

56797cefb1efc9130f7c48a7d1db0f0c c81e59b61af9dca603ba03b14aabe968 9f8baf78266b4e54525d1c6bf06305a5 790d5a2891858d1226e682d00e6106a9 bfe5815000fa4d6406f980c3dc0b4088 3ab1af55c4b84a70b6e8e87334f3a6ea ca05eaf5b843fbd53589c90d7228a6df 2897d76d56d2010f4e3a28f864d69223 4f06e569887915c59ae1fa4680142e7f caea8340e2d186a540518d08602aa065 d475fdc3db14382c01697df7c71c3b94 64cafed7cc15bceb3b240d8c2f92dce3 eb0ea3b827d18de2329b6477e24c1d59 909d99074e442b52ce54cc7b31cf065d bb8d08f557ff7e4b314b6bbaa846b034

Was this article helpful?
Tell us how we may improve it.
Yes No
Server Virtualization
- Parallels Cloud Server
- Parallels Containers for Windows 6.0
- Parallels Virtuozzo Containers
- Parallels Automation
- Parallels Automation for Cloud Infrastructure
- Parallels Business Automation Standard
- Parallels Virtual Automation
- Parallels Plesk Panel Suite
- Web Presence Builder
- Parallels Plesk Automation
- Parallels Small Business Panel
- Value-added Services for Hosters
- Parallels Partner Storefront
Services & Resources
- Cloud Acceleration Services
- Professional Services
- Support Services
- Training & Certification