[firewall4] Oublis lors de la création de add_ports
This commit is contained in:
parent
3a69230c2b
commit
1e4b2a4612
1 changed files with 6 additions and 6 deletions
|
@ -852,7 +852,7 @@ class firewall_komaz(firewall_base_routeur):
|
||||||
port = '0%s' % port
|
port = '0%s' % port
|
||||||
return port
|
return port
|
||||||
|
|
||||||
def add_ports(ip, proto, sens):
|
def add_ports(ip, machine, proto, sens):
|
||||||
self.add(
|
self.add(
|
||||||
table,
|
table,
|
||||||
chain,
|
chain,
|
||||||
|
@ -860,7 +860,7 @@ class firewall_komaz(firewall_base_routeur):
|
||||||
proto,
|
proto,
|
||||||
(sens=='out' and 's') or (sens == 'in' and 'd'),
|
(sens=='out' and 's') or (sens == 'in' and 'd'),
|
||||||
ip,
|
ip,
|
||||||
','.join( format_port(port) for port in machine['portTCP%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 machine in self.machines():
|
||||||
for ip in machine['ipHostNumber']:
|
for ip in machine['ipHostNumber']:
|
||||||
if 'portTCPout' in machine.attrs.keys():
|
if 'portTCPout' in machine.attrs.keys():
|
||||||
add_ports(ip,'tcp','out')
|
add_ports(ip, machine, 'tcp', 'out')
|
||||||
if 'portUDPout' in machine.attrs.keys():
|
if 'portUDPout' in machine.attrs.keys():
|
||||||
add_ports(ip,'udp','out')
|
add_ports(ip, machine, 'udp', 'out')
|
||||||
if 'portTCPin' in machine.attrs.keys():
|
if 'portTCPin' in machine.attrs.keys():
|
||||||
add_ports(ip,'tcp','in')
|
add_ports(ip, machine, 'tcp', 'in')
|
||||||
if 'portUDPin' in machine.attrs.keys():
|
if 'portUDPin' in machine.attrs.keys():
|
||||||
add_ports(ip,'udp','in')
|
add_ports(ip, machine, 'udp', 'in')
|
||||||
|
|
||||||
self.add(table, chain, '-j REJECT')
|
self.add(table, chain, '-j REJECT')
|
||||||
print OK
|
print OK
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue