From d5506e8568b043acc79d436d8a179343f3042a7e Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Sun, 24 Jan 2021 11:57:49 +0100 Subject: [PATCH] Forward only specific interfaces to the captive portal Signed-off-by: Yohann D'ANELLO --- firewall_config.example.py | 2 ++ main.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/firewall_config.example.py b/firewall_config.example.py index 29683c8..c3a088e 100644 --- a/firewall_config.example.py +++ b/firewall_config.example.py @@ -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'] } diff --git a/main.py b/main.py index fa25d04..d589fef 100755 --- a/main.py +++ b/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']: