Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Benjamin Graillot
scripts
Commits
1e4b2a46
Commit
1e4b2a46
authored
May 21, 2013
by
Valentin Samir
Browse files
[firewall4] Oublis lors de la création de add_ports
parent
3a69230c
Changes
1
Hide whitespace changes
Inline
Side-by-side
gestion/gen_confs/firewall4.py
View file @
1e4b2a46
...
...
@@ -852,7 +852,7 @@ class firewall_komaz(firewall_base_routeur):
port
=
'0%s'
%
port
return
port
def
add_ports
(
ip
,
proto
,
sens
):
def
add_ports
(
ip
,
machine
,
proto
,
sens
):
self
.
add
(
table
,
chain
,
...
...
@@ -860,7 +860,7 @@ class firewall_komaz(firewall_base_routeur):
proto
,
(
sens
==
'out'
and
's'
)
or
(
sens
==
'in'
and
'd'
),
ip
,
','
.
join
(
format_port
(
port
)
for
port
in
machine
[
'port
TCP
%s'
%
sens
])
','
.
join
(
format_port
(
port
)
for
port
in
machine
[
'port
%s
%s'
%
(
proto
.
upper
(),
sens
)
])
)
)
...
...
@@ -876,13 +876,13 @@ class firewall_komaz(firewall_base_routeur):
for
machine
in
self
.
machines
():
for
ip
in
machine
[
'ipHostNumber'
]:
if
'portTCPout'
in
machine
.
attrs
.
keys
():
add_ports
(
ip
,
'tcp'
,
'out'
)
add_ports
(
ip
,
machine
,
'tcp'
,
'out'
)
if
'portUDPout'
in
machine
.
attrs
.
keys
():
add_ports
(
ip
,
'udp'
,
'out'
)
add_ports
(
ip
,
machine
,
'udp'
,
'out'
)
if
'portTCPin'
in
machine
.
attrs
.
keys
():
add_ports
(
ip
,
'tcp'
,
'in'
)
add_ports
(
ip
,
machine
,
'tcp'
,
'in'
)
if
'portUDPin'
in
machine
.
attrs
.
keys
():
add_ports
(
ip
,
'udp'
,
'in'
)
add_ports
(
ip
,
machine
,
'udp'
,
'in'
)
self
.
add
(
table
,
chain
,
'-j REJECT'
)
print
OK
...
...
Write
Preview
Supports
Markdown
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