From 97d88d2766abfe8fc69bd3df05d0c8fb6a5317dc Mon Sep 17 00:00:00 2001 From: Jeremie Dimino Date: Tue, 9 Sep 2008 19:32:36 +0200 Subject: [PATCH] firewall pour le proxy sur les vlans radin et accueil sur sable darcs-hash:20080909173236-af139-61df3405e266e697acddd575a5a513c156171e4e.gz --- gestion/gen_confs/firewall.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/gestion/gen_confs/firewall.py b/gestion/gen_confs/firewall.py index 25185bcf..37674854 100755 --- a/gestion/gen_confs/firewall.py +++ b/gestion/gen_confs/firewall.py @@ -1172,14 +1172,23 @@ class firewall_sable(firewall_rouge): """Comme pour rouge, avec le proxy transparent en plus""" def mangle_table(self): - # Pour le proxy transparent iptables("-t mangle -F PREROUTING") + + # Pour le proxy transparent iptables("-t mangle -i eth0.2 -A PREROUTING -p tcp --destination-port 3128 " + "--destination 10.231.136.9 " + "-m mac --mac-source %s " % mac_komaz + "-j MARK --set-mark %s" % conf_fw.mark['proxy']) iptables("-t mangle -A PREROUTING -m mark --mark %s -j ACCEPT" % conf_fw.mark['proxy']) + # Proxy transparent sur le vlan accueil + iptables("-t nat -i eth0.7 -A PREROUTING -p tcp --destination-port 80 -j DNAT --to-destination 10.51.0.1:3128") + iptables("-t nat -i eth0.7 -A PREROUTING -p tcp --destination-port 3128 -j ACCEPT") + + # Proxy transparent sur le vlan radin + iptables("-t nat -i eth0.6 -A PREROUTING -p tcp --destination-port 80 -j DNAT --to-destination 10.42.0.1:3128") + iptables("-t nat -i eth0.6 -A PREROUTING -p tcp --destination-port 3128 -j ACCEPT") + def nat_table(self): firewall_rouge.nat_table(self) # Pour le proxy transparent