[CentOS] /etc/sysconfig/iptables syntax

Mon May 23 04:39:01 UTC 2016
Mike <1100100 at gmail.com>

On Sun, May 22, 2016 at 11:55 PM, Barak Korren <bkorren at redhat.com> wrote:

> בתאריך 23 במאי 2016 05:56,‏



> The syntax comes from the output of the 'iptables-save' command.
> You can configure 'iptables' from the command line as you normally would
> and then run
>
> iptables-save > /etc/sysconfig/iptables
>
> On centos<=6 the init.d script also included a 'save' command to do it for
> you, I'm not sure about the systemd unit file though.
>
> HTH,
> Barak _______________________________________________
>


Hi Barak,

If I'm understanding correctly, write out all rules in a bash terminal and
run them, and then do /usr/sbin/iptables-save ---

~#/usr/sbin/iptables rule;
~#/usr/sbin/iptables rule;
~#/usr/sbiniptables rule;
~#/usr/sbin/iptables rule;
~#/usr/sbin/iptables rule;
~#/usr/sbiniptables rule;
~#/usr/sbin/iptables rule;
~#/usr/sbin/iptables rule;
~#/usr/sbiniptables rule;
~#/usr/sbin/iptables rule;
~#/usr/sbin/iptables rule;
~#/usr/sbiniptables rule

~#/usr/sbin/iptables-save > /etc/sysconfig/iptables