Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
awall
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
7
Issues
7
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
alpine
awall
Commits
19b7b2b6
Commit
19b7b2b6
authored
Jun 28, 2012
by
Kaarle Ritvanen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
command for flushing ip[6]tables rules
parent
805dec16
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
13 deletions
+25
-13
awall-cli
awall-cli
+9
-1
awall/iptables.lua
awall/iptables.lua
+16
-12
No files found.
awall-cli
View file @
19b7b2b6
...
...
@@ -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
(
'
\n
Timeout, reverting to the old configuration\n'
)
awall
.
iptables
.
revert
()
elseif
mode
==
'flush'
then
awall
.
iptables
.
flush
()
else
assert
(
false
)
end
awall/iptables.lua
View file @
19b7b2b6
...
...
@@ -68,18 +68,7 @@ function BaseIPTables:restore(test)
end
function
BaseIPTables
:
activate
()
local
empty
=
IPTables
.
new
()
for
family
,
params
in
pairs
(
families
)
do
local
success
,
lines
=
pcall
(
io.lines
,
params
.
procfile
)
if
success
then
for
tbl
in
lines
do
for
i
,
chain
in
ipairs
(
builtin
[
tbl
])
do
empty
.
config
[
family
][
tbl
][
chain
]
=
{}
end
end
end
end
empty
:
restore
(
false
)
flush
()
self
:
restore
(
false
)
end
...
...
@@ -146,3 +135,18 @@ end
function
revert
()
Backup
.
new
():
activate
()
end
function
flush
()
local
empty
=
IPTables
.
new
()
for
family
,
params
in
pairs
(
families
)
do
local
success
,
lines
=
pcall
(
io.lines
,
params
.
procfile
)
if
success
then
for
tbl
in
lines
do
for
i
,
chain
in
ipairs
(
builtin
[
tbl
])
do
empty
.
config
[
family
][
tbl
][
chain
]
=
{}
end
end
end
end
empty
:
restore
(
false
)
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment