Frank,

On Sunday 13 November 2005 08:33, [EMAIL PROTECTED] wrote:
> Is there a way to programmatically (perl, etc.) detect whether a
> local firewall has been enabled in SuSE?

If you're running as root, you can issue the command "iptables --list" 
to see what rules are in effect and base a determination on that. When 
there's no firewall defined, the output is pretty terse whereas when 
there are rules defined the list gets rather longer. It can be very 
long, in fact.

At the moment for my system, whose firewall is not particularly 
complicated and which I set up using Guarddog, "iptables --list" 
produces 202 lines of output, while on a system with no local firewall 
in effect, it looks like this:

Chain INPUT (policy ACCEPT)
target     prot opt source               destination

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination


You could play with your firewall in various states to see if there's a 
readily (programmatically) determined pattern or criterium for deciding 
whether it's on.


On the other hand, this is one of those issues that suggests you might 
be asking the wrong question. Is there a particular service to which 
you wish to connect or for which you wish to accept connections? Since 
the definition of "firewall" and the effects it has is so varied, 
there's very little definite that can be tied to having it "enabled" or 
"disabled."


Randall Schulz

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to