bw/nfs close ports no longer needed for nfs4

This commit is contained in:
Sophie Schiller 2025-04-05 20:15:50 +02:00
parent d584fd88d7
commit c905b7dc13
2 changed files with 10 additions and 1 deletions

View file

@ -33,7 +33,10 @@ def firewall(metadata):
ips.add(share_target)
rules = {}
for port in ('111', '2049', '1110', '4045', '35295'):
ports = ('111', '2049', '1110', '4045', '35295')
if metadata.get('nfs-server/version', 3) == 4:
ports = ('111', '2049')
for port in ports:
for proto in ('/tcp', '/udp'):
rules[port + proto] = atomic(ips)