How To Save iptables To Disk On Amazon Linux 2

Published Date Author: , Posted July 21st, 2023 at 9:38:26am

I wanted to save the iptables list to disk, but got an error when I tried:

# 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.

The solution was to install the iptables-services package:

# yum install iptables-services -y
iptables-services.x86_64 0:1.8.4-10.amzn2.1.2


I was then able to save properly:

root@inbound2:/var/log # service iptables save
iptables: Saving firewall rules to /etc/sysconfig/iptables:[ OK ]

No comments as yet.

Leave Your Comment  Leave a comment

All fields marked with "*" are required.