Rgle spciale pour ovh dans le TEST_MAC-IP

darcs-hash:20080106235950-61eff-b10dfdf132498034f1035b8bceeeed0a9ad967b6.gz
This commit is contained in:
Stephane Glondu 2008-01-07 00:59:50 +01:00
parent 087278d849
commit 10528470f3
2 changed files with 9 additions and 1 deletions

View file

@ -43,6 +43,7 @@ cimetiere = '/home/cimetiere'
## Adresses mac utiles ## Adresses mac utiles
mac_komaz = '00:19:BB:31:3B:80' mac_komaz = '00:19:BB:31:3B:80'
mac_wifi = '00:e0:81:58:d1:39' mac_wifi = '00:e0:81:58:d1:39'
mac_titanic = 'aa:73:65:63:6f:76'
## Serveur principal de cfengine ## Serveur principal de cfengine
cfengine_main = "vert.adm.crans.org" cfengine_main = "vert.adm.crans.org"

View file

@ -35,7 +35,7 @@ from ldap_crans import AssociationCrans, Machine, MachineWifi
from affich_tools import * from affich_tools import *
from commands import getstatusoutput from commands import getstatusoutput
from iptools import AddrInNet, NetSubnets, IpSubnet from iptools import AddrInNet, NetSubnets, IpSubnet
from config import NETs, mac_komaz, mac_wifi, conf_fw, p2p from config import NETs, mac_komaz, mac_wifi, mac_titanic, conf_fw, p2p
syslog.openlog('firewall') syslog.openlog('firewall')
debug = 1 debug = 1
@ -256,6 +256,13 @@ class firewall_crans :
# Machine wifi, c'est la mac de Nectaris # Machine wifi, c'est la mac de Nectaris
iptables("-t nat %s TEST_MAC-IP -s "%(insert)+\ iptables("-t nat %s TEST_MAC-IP -s "%(insert)+\
"%s -m mac --mac-source %s -j RETURN"%(ip, mac_wifi)) "%s -m mac --mac-source %s -j RETURN"%(ip, mac_wifi))
elif machine.nom() == "ovh.adm.crans.org":
# Pour ovh, on met les MACs de komaz et de titanic
# qui font proxy ARP
iptables("-t nat %s TEST_MAC-IP -s "%(insert)+\
"%s -m mac --mac-source %s -j RETURN"%(ip, mac_komaz))
iptables("-t nat %s TEST_MAC-IP -s "%(insert)+\
"%s -m mac --mac-source %s -j RETURN"%(ip, mac_titanic))
else: else:
# Machine fixe # Machine fixe
iptables("-t nat %s TEST_MAC-IP -s "%(insert)+\ iptables("-t nat %s TEST_MAC-IP -s "%(insert)+\