Save iptables configuration

How to save iptables configuration, i have read to save configuration iptables use /etc/sysconfig/iptables but after i open file with i found this file still empty. How to save iptables configuration?

Thanks

Have a look at iptables-save and iptables-restore. These allow you to save and restore iptables rules which you have built. Otherwise you need to put all the rules in a script which you can execute on firewall start.

On 11/19/2013 11:16 AM, rositsetiawan wrote:
>
> How to save iptables configuration, i have read to save configuration
> iptables use /etc/sysconfig/iptables but after i open file with i found
> this file still empty. How to save iptables configuration?
>
> Thanks
>
>
rositsetiawan;

SuSEfirewall2 regenerates the iptables on each boot. You can add “custom rules” using the file:
/etc/sysconfig/scripts/SuSEfirewall2-custom
Documentation for custom rules is provides by the comments in that file.

It is not clear what you wish to accomplish. Perhaps it may be easier to just use YaST > Security and Users > Firewall.
There is additional documentation on SuSEfirewall2 here:
/usr/share/doc/packages/SuSEfirewall2


P.V.
“We’re all in this together, I’m pulling for you” Red Green

Ok thanks fora all.

I have try to set up iptables on my computer with command line “iptables -t filter -A RH-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 1080 -j ACCEPT”, i know this command to set up on Red Hat Linux. So this command give a result “WARNING: The state match is obsolete. Use conntrack instead.
iptables: No chain/target/match by that name.”, how to find or set up chain/target/match.

Thanks

You cannot expect Red Hat tables to be found on openSUSE. If you want very simple instructions you should start by telling us what software you have installed (what version of openSUSE), and explaining what you are trying to achieve, as well as what you have done.

It looks as if you simply want to open TCP port 1080. In that case I would concur with venzkep](https://forums.opensuse.org/members/venzkep.html) and suggest the YaST firewall module.

If you cannot use the GUI YaST from a desktop; in a bash session type

 # yast2 firewall

for a curses menu system.
It is mostly self-explanatory. In th Allowed Services section choose “aDvanced” to open a new dialogue rhat lets you enter arbitrary port numbers to open.