1

Topic: how to save iptables rules?

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release):
- Deployed with iRedMail Easy or the downloadable installer?
- Linux/BSD distribution name and version:
- Store mail accounts in which backend (LDAP/MySQL/PGSQL):
- Web server (Apache or Nginx):
- Manage mail accounts with iRedAdmin-Pro?
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====
ho w can I save IPtables rules in centos7? this cmd does not work:iptables-save > iptables.dump and I can not save by service iptables save cmd.

[root@localhost ~]# service iptables save
The service command supports only basic LSB actions (start, stop, restart, try-restart, reload, force-reload, status). For other actions, please try to use systemctl.

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: how to save iptables rules?

https://support.rackspace.com/how-to/us … -centos-7/
on my Ubuntu system, they are also saved in /etc/default/iptables

3

Re: how to save iptables rules?

Why are you working with iptables? it was dropped years and years ago.

It was replaced with firewalld, so config files are in /etc/firewalld/ 
and default iredmail rules are in /etc/firewalld/zones/iredmail.xml

4

Re: how to save iptables rules?

You can use firewalld, it uses iptables at the backend. If you want to use iptables on its own CentOS 7, first mask firewalld:
# systemctl stop firewalld
# systemctl mask firewalld

And install iptables as a service:

# yum install iptables-services
# yum enable iptables

You can then edit /etc/sysconfig/iptables (and consequently, use 'iptables-save > /etc/sysconfig/iptables' to save your current setup.  Whenever you make changes to the files, you have to:

# systemctl restart iptables