Commit 790df726 authored by Gabriel Detraz's avatar Gabriel Detraz

Nat sur sable et odlyd à partir de config

parent ff649898
......@@ -39,6 +39,17 @@ dev = {
},
}
nat_source = {
'appartement' : {
'odlyd' : '138.231.136.44',
'sable' : '138.231.136.45'
},
'federez' : {
'odlyd' : '138.231.136.77',
'sable' : '138.231.136.78'
},
}
#: Pour marquer les paquets
mark = { 'https-radin': '0x3',
'https-gratuit' : '0x3',
......
......@@ -4,7 +4,7 @@ import utils
import base
from utils import pretty_print, OK, anim
from base import dev
from base import dev, hostname
class firewall(base.firewall_routeur):
"""Pare-feu du routeur principal de l'association"""
......@@ -342,7 +342,7 @@ class firewall(base.firewall_routeur):
pretty_print(table, chain)
for dev_key in ['out', 'fil', 'wifi']:
for net in base.config.NETs['personnel-ens']:
self.add(table, chain, '-o %s -s %s -j SNAT --to 138.231.136.44' % (dev[dev_key], net))
self.add(table, chain, '-o %s -s %s -j SNAT --to %s' % (dev[dev_key], net, base.config.firewall.nat_source['appartement'][hostname]))
print OK
if table == 'filter':
......@@ -364,7 +364,7 @@ class firewall(base.firewall_routeur):
pretty_print(table, chain)
for dev_key in ['out', 'fil', 'wifi']:
for net in base.config.NETs['federez']:
self.add(table, chain, '-o %s -s %s -j SNAT --to 138.231.136.77' % (dev[dev_key], net))
self.add(table, chain, '-o %s -s %s -j SNAT --to %s' % (dev[dev_key], net, base.config.firewall.nat_source['federez'][hostname]))
print OK
if table == 'filter':
......
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