Forward only specific interfaces to the captive portal
Signed-off-by: Yohann D'ANELLO <ynerant@crans.org>
This commit is contained in:
parent
6e53fd7bdb
commit
d5506e8568
2 changed files with 3 additions and 1 deletions
|
@ -23,9 +23,11 @@
|
|||
|
||||
|
||||
### Specify each interface role
|
||||
role = ['routeur', 'portail']
|
||||
|
||||
interfaces_type = {
|
||||
'routable' : ['eth1', 'eth2'],
|
||||
'routable-portail': ['eth2'],
|
||||
'sortie' : ['eth3', 'eth4'],
|
||||
'admin' : ['eth5', 'eth6']
|
||||
}
|
||||
|
|
2
main.py
2
main.py
|
@ -371,7 +371,7 @@ class iptables:
|
|||
def capture_connection_portail(self, subtable="PORTAIL-CAPTIF-REDIRECT"):
|
||||
"""Redirige les connexions 80 et 443 vers l'ip cible"""
|
||||
self.init_nat(subtable, decision="-")
|
||||
for interface in self.interfaces_settings['routable']:
|
||||
for interface in self.interfaces_settings['routable-portail']:
|
||||
self.jump_traficfrom("nat", interface, "PREROUTING", subtable, mode='4')
|
||||
|
||||
for protocol in self.portail_settings['authorized_hosts']:
|
||||
|
|
Loading…
Reference in a new issue