Commit b35b1919 authored by Gabriel Detraz's avatar Gabriel Detraz Committed by root
Browse files

Erreur dans l'offset

parent 7cbbc3c4
Pipeline #2159 failed with stages
......@@ -27,7 +27,7 @@ api_hostname = config.get('Re2o', 'hostname')
api_password = config.get('Re2o', 'password')
api_username = config.get('Re2o', 'username')
api_client = Re2oAPIClient(api_hostname, api_username, api_password, use_tls=False)
api_client = Re2oAPIClient(api_hostname, api_username, api_password, use_tls=True)
client_hostname = socket.gethostname().split('.', 1)[0]
......@@ -499,7 +499,7 @@ class iptables:
# On nat
for interface, pub_ip_range in nat_type['interfaces_ip_to_nat'].items():
ip_nat = '.'.join(pub_ip_range.split('.')[:3]) + '.' + str(int(nat_prive_ip_plage.split('.')[1][0])*40 + 4*(nat_ip_range - 1) + nat_private_ip//64)
ip_nat = '.'.join(pub_ip_range.split('.')[:3]) + '.' + str((int(nat_prive_ip_plage.split('.')[1][0]) - 1)*40 + 4*(nat_ip_range - 1) + nat_private_ip//64)
nat_rule_tcp += '\n-A %s -s %s -o %s -p tcp -j SNAT --to-source %s' % (subrange_name, ip_src, interface, ip_nat + ':' + str(port_low) + '-' + str(port_high))
nat_rule_udp += '\n-A %s -s %s -o %s -p udp -j SNAT --to-source %s' % (subrange_name, ip_src, interface, ip_nat + ':' + str(port_low) + '-' + str(port_high))
self.add("nat4", nat_rule_tcp)
......@@ -537,6 +537,7 @@ class iptables:
def restore_iptables(self, mode='4'):
"""Restoration de l'iptable générée"""
return
if mode == '6':
global_chain = self.global_chain6
command_to_execute = ["sudo","-n","/sbin/ip6tables-restore"]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment