aboutsummaryrefslogtreecommitdiffstats
path: root/awall-cli
diff options
context:
space:
mode:
authorKaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>2012-06-28 10:54:38 +0000
committerKaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>2012-06-28 10:54:38 +0000
commit19b7b2b638a9c88d7152936db00c88cc6654de31 (patch)
tree4c7f964654642065caf0e7e493a6fe017964af83 /awall-cli
parent805dec167217f6dee81afbf22021eef860f158d8 (diff)
downloadawall-19b7b2b638a9c88d7152936db00c88cc6654de31.tar.bz2
awall-19b7b2b638a9c88d7152936db00c88cc6654de31.tar.xz
command for flushing ip[6]tables rules
Diffstat (limited to 'awall-cli')
-rwxr-xr-xawall-cli10
1 files changed, 9 insertions, 1 deletions
diff --git a/awall-cli b/awall-cli
index 8768243..2a4b779 100755
--- a/awall-cli
+++ b/awall-cli
@@ -38,6 +38,12 @@ Run-time activation of new firewall configuration:
by hitting RETURN within 10 seconds, the configuration is saved to
the files. Otherwise, the old configuration is restored.
+Flush firewall configuration:
+ awall flush
+
+ This command deletes all firewall rules and configures it to drop
+ all packets.
+
Enable/disable optional policies:
awall {enable|disable} <policy>...
@@ -96,7 +102,7 @@ end
require 'awall.util'
util = awall.util
-if not util.contains({'translate', 'activate', 'fallback',
+if not util.contains({'translate', 'activate', 'fallback', 'flush',
'enable', 'disable', 'list', 'dump'},
mode) then help() end
@@ -222,4 +228,6 @@ elseif mode == 'fallback' then
io.stderr:write('\nTimeout, reverting to the old configuration\n')
awall.iptables.revert()
+elseif mode == 'flush' then awall.iptables.flush()
+
else assert(false) end