## INCLUSIONS_STATIQUES_GENERALES
## EXT-DMZ: redirection des ports autorises sur les serveurs DMZ
## IP PUB 1 : serveur WWW
%if %%nb_ip_pub in ('1','2','3','4','5','6','7','8') and %%ip_pub1 != ''
/sbin/iptables -t nat -I PREROUTING -d %%ip_pub1/32 -i %%nom_zone_eth0 -p tcp -m tcp -m multiport --dports 20:22,80,81,389,443,636,1723,4129,4200 --tcp-flags SYN,RST,ACK SYN -j DNAT --to-destination %%ip_serveur_web1
/sbin/iptables -t nat -I PREROUTING -d %%ip_pub1/32 -i %%nom_zone_eth0 -p tcp -m tcp -m multiport --dports 7070,8008,8090,8443,20100,44123,49300,49400,49500 --tcp-flags SYN,RST,ACK SYN -j DNAT --to-destination %%ip_serveur_web1
/sbin/iptables -t filter -I ext-dmz -d %%ip_serveur_web1/32 -i %%nom_zone_eth0 -o %%nom_zone_eth3 -p tcp -m tcp --tcp-flags SYN,RST,ACK SYN -j ACCEPT
/sbin/iptables -t nat -I POSTROUTING -s %%ip_serveur_web1/32 -o %%nom_zone_eth0 -j SNAT --to-source %%adresse_ip_eth0
%end if
## IP PUB 2 : serveur NOTES
%if %%nb_ip_pub in ('2','3','4','5','6','7','8') and %%ip_pub2 != ''
/sbin/iptables -t nat -I PREROUTING -d %%ip_pub2/32 -i %%nom_zone_eth0 -p tcp -m tcp -m multiport --dports 20:22,80,81,389,443,636,1723,4129,4200 --tcp-flags SYN,RST,ACK SYN -j DNAT --to-destination %%ip_serveur_web2
/sbin/iptables -t nat -I PREROUTING -d %%ip_pub2/32 -i %%nom_zone_eth0 -p tcp -m tcp -m multiport --dports 7070,8008,8090,8443,20100,44123,49300,49400,49500 --tcp-flags SYN,RST,ACK SYN -j DNAT --to-destination %%ip_serveur_web2
/sbin/iptables -t filter -I ext-dmz -d %%ip_serveur_web2/32 -i %%nom_zone_eth0 -o %%nom_zone_eth3 -p tcp -m tcp --tcp-flags SYN,RST,ACK SYN -j ACCEPT
/sbin/iptables -t nat -I POSTROUTING -s %%ip_serveur_web2/32 -o %%nom_zone_eth0 -j SNAT --to-source %%adresse_ip_eth0
%end if
## IP PUB 3 : serveur COURRIER
%if %%nb_ip_pub in ('3','4','5','6','7','8') and %%ip_pub3 != ''
/sbin/iptables -t nat -I PREROUTING -d %%ip_pub3/32 -i %%nom_zone_eth0 -p tcp -m tcp -m multiport --dports 20:22,25,80,81,110,143,389,443,585,636,995,1723,4129,4200 --tcp-flags SYN,RST,ACK SYN -j DNAT --to-destination %%ip_serveur_web3
/sbin/iptables -t nat -I PREROUTING -d %%ip_pub3/32 -i %%nom_zone_eth0 -p tcp -m tcp -m multiport --dports 7070,8008,8090,8443,20100,44123,49300,49400,49500 --tcp-flags SYN,RST,ACK SYN -j DNAT --to-destination %%ip_serveur_web3
/sbin/iptables -t filter -I ext-dmz -d %%ip_serveur_web3/32 -i %%nom_zone_eth0 -o %%nom_zone_eth3 -p tcp -m tcp --tcp-flags SYN,RST,ACK SYN -j ACCEPT
/sbin/iptables -t nat -I POSTROUTING -s %%ip_serveur_web3/32 -o %%nom_zone_eth0 -j SNAT --to-source %%adresse_ip_eth0
%end if
## IP PUB 4 : serveur DISPO
%if %%nb_ip_pub in ('4','5','6','7','8') and %%ip_pub4 != ''
/sbin/iptables -t nat -I PREROUTING -d %%ip_pub4/32 -i %%nom_zone_eth0 -p tcp -m tcp --tcp-flags SYN,RST,ACK SYN -j DNAT --to-destination %%ip_serveur_web4
/sbin/iptables -t nat -I PREROUTING -d %%ip_pub4/32 -i %%nom_zone_eth0 -p udp -m udp -j DNAT --to-destination %%ip_serveur_web4
/sbin/iptables -t filter -I ext-dmz -d %%ip_serveur_web4/32 -i %%nom_zone_eth0 -o %%nom_zone_eth3 -p tcp -m tcp --tcp-flags SYN,RST,ACK SYN -j ACCEPT
/sbin/iptables -t filter -I ext-dmz -d %%ip_serveur_web4/32 -i %%nom_zone_eth0 -o %%nom_zone_eth3 -p udp -j ACCEPT
/sbin/iptables -t nat -I POSTROUTING -s %%ip_serveur_web4/32 -o %%nom_zone_eth0 -j SNAT --to-source %%adresse_ip_eth0
%end if
## IP PUB 5 :
%if %%nb_ip_pub in ('5','6','7','8') and %%ip_pub5 != ''
/sbin/iptables -t nat -I PREROUTING -d %%ip_pub5/32 -i %%nom_zone_eth0 -p tcp -m tcp -m multiport --dports 20:22,80,81,389,443,636,1723,4129,4200 --tcp-flags SYN,RST,ACK SYN -j DNAT --to-destination %%ip_serveur_web5
/sbin/iptables -t nat -I PREROUTING -d %%ip_pub5/32 -i %%nom_zone_eth0 -p tcp -m tcp -m multiport --dports 7070,8008,8090,8443,20100,44123,49300,49400,49500 --tcp-flags SYN,RST,ACK SYN -j DNAT --to-destination %%ip_serveur_web5
/sbin/iptables -t filter -I ext-dmz -d %%ip_serveur_web5/32 -i %%nom_zone_eth0 -o %%nom_zone_eth3 -p tcp -m tcp --tcp-flags SYN,RST,ACK SYN -j ACCEPT
/sbin/iptables -t nat -I POSTROUTING -s %%ip_serveur_web5/32 -o %%nom_zone_eth0 -j SNAT --to-source %%adresse_ip_eth0
%end if
## IP PUB 6 :
%if %%nb_ip_pub in ('6','7','8') and %%ip_pub6 != ''
/sbin/iptables -t nat -I PREROUTING -d %%ip_pub6/32 -i %%nom_zone_eth0 -p tcp -m tcp -m multiport --dports 20:22,80,81,389,443,636,1723,4129,4200 --tcp-flags SYN,RST,ACK SYN -j DNAT --to-destination %%ip_serveur_web6
/sbin/iptables -t nat -I PREROUTING -d %%ip_pub6/32 -i %%nom_zone_eth0 -p tcp -m tcp -m multiport --dports 7070,8008,8090,8443,20100,44123,49300,49400,49500 --tcp-flags SYN,RST,ACK SYN -j DNAT --to-destination %%ip_serveur_web6
/sbin/iptables -t filter -I ext-dmz -d %%ip_serveur_web6/32 -i %%nom_zone_eth0 -o %%nom_zone_eth3 -p tcp -m tcp --tcp-flags SYN,RST,ACK SYN -j ACCEPT
/sbin/iptables -t nat -I POSTROUTING -s %%ip_serveur_web6/32 -o %%nom_zone_eth0 -j SNAT --to-source %%adresse_ip_eth0
%end if
## IP PUB 7 :
%if %%nb_ip_pub in ('7','8') and %%ip_pub7 != ''
/sbin/iptables -t nat -I PREROUTING -d %%ip_pub7/32 -i %%nom_zone_eth0 -p tcp -m tcp -m multiport --dports 20:22,25,80,81,110,143,389,443,585,636,995,1723,4129,4200 --tcp-flags SYN,RST,ACK SYN -j DNAT --to-destination %%ip_serveur_web7
/sbin/iptables -t nat -I PREROUTING -d %%ip_pub7/32 -i %%nom_zone_eth0 -p tcp -m tcp -m multiport --dports 7070,8008,8090,8443,20100,44123,49300,49400,49500 --tcp-flags SYN,RST,ACK SYN -j DNAT --to-destination %%ip_serveur_web7
/sbin/iptables -t filter -I ext-dmz -d %%ip_serveur_web7/32 -i %%nom_zone_eth0 -o %%nom_zone_eth3 -p tcp -m tcp --tcp-flags SYN,RST,ACK SYN -j ACCEPT
/sbin/iptables -t nat -I POSTROUTING -s %%ip_serveur_web7/32 -o %%nom_zone_eth0 -j SNAT --to-source %%adresse_ip_eth0
%end if
## IP PUB 8 :
%if %%nb_ip_pub in ('8') and %%ip_pub8 != ''
/sbin/iptables -t nat -I PREROUTING -d %%ip_pub8/32 -i %%nom_zone_eth0 -p tcp -m tcp --tcp-flags SYN,RST,ACK SYN -j DNAT --to-destination %%ip_serveur_web8
/sbin/iptables -t nat -I PREROUTING -d %%ip_pub8/32 -i %%nom_zone_eth0 -p udp -m udp -j DNAT --to-destination %%ip_serveur_web8
/sbin/iptables -t filter -I ext-dmz -d %%ip_serveur_web8/32 -i %%nom_zone_eth0 -o %%nom_zone_eth3 -p tcp -m tcp --tcp-flags SYN,RST,ACK SYN -j ACCEPT
/sbin/iptables -t filter -I ext-dmz -d %%ip_serveur_web8/32 -i %%nom_zone_eth0 -o %%nom_zone_eth3 -p udp -j ACCEPT
/sbin/iptables -t nat -I POSTROUTING -s %%ip_serveur_web8/32 -o %%nom_zone_eth0 -j SNAT --to-source %%adresse_ip_eth0
%end if
## MAIL POUR SERVEUR PRONOTE
%if %%serveur_pronote
/sbin/iptables -t nat -I POSTROUTING -s %%serveur_pronote/32 -o %%nom_zone_eth0 -j SNAT --to-source %%adresse_ip_eth0
%end if
## EXCEPTIONS au PROXY HTTP et HTTPS
## ADMIN : VPN OTP (api.ac-montpellier.fr), HORIZON (172.31.0.0)
/sbin/iptables -t nat -I PREROUTING -i %%nom_zone_eth1 -p tcp -m tcp -m multiport --dports 80,443 --tcp-flags SYN,RST,ACK SYN -d api.ac-montpellier.fr -j ACCEPT
/sbin/iptables -t nat -I PREROUTING -i %%nom_zone_eth1 -p tcp -m tcp -m multiport --dports 80,443 --tcp-flags SYN,RST,ACK SYN -d 172.31.0.0/16 -j ACCEPT
## PEDA : VPN OTP (195.83.226.53), serveur GLPI (195.83.225.232) et client LEGERS
/sbin/iptables -t nat -I PREROUTING -i %%nom_zone_eth2 -p tcp -m tcp -m multiport --dports 80,443 --tcp-flags SYN,RST,ACK SYN -d api.ac-montpellier.fr -j ACCEPT
/sbin/iptables -t nat -I PREROUTING -i %%nom_zone_eth2 -p tcp -m tcp -m multiport --dports 80,443 --tcp-flags SYN,RST,ACK SYN -d 172.23.0.0/16 -j ACCEPT
## DMZ : pas de proxy pour domaine ac-montpellier (SSO pronote ENT)
/sbin/iptables -t nat -I PREROUTING -i %%nom_zone_eth3 -p tcp -m tcp -m multiport --dports 80,443 --tcp-flags SYN,RST,ACK SYN -d 195.83.225.0/24 -j ACCEPT
###########################################
## Ajout de regles hors CD34 ##
###########################################
## EXT-BAS: acces au serveur peda depuis le reseau rectorat
/sbin/iptables -t nat -I PREROUTING -s 195.83.225.0/24 -d %%adresse_ip_eth0/32 -i %%nom_zone_eth0 -p tcp -m tcp --dport 44123 --tcp-flags SYN,RST,ACK SYN -j DNAT --to-destination %%ip_serveur_pedago
/sbin/iptables -t filter -I ext-ped -s 195.83.225.0/24 -d %%ip_serveur_pedago/32 -i %%nom_zone_eth0 -p tcp -m state --state NEW -m tcp --dport 44123 --tcp-flags SYN,RST,ACK SYN -j ACCEPT
## pour NTOP
/sbin/iptables -t filter -I adm-bas -m state --state NEW -p tcp --dport 3000 --tcp-flags SYN,RST,ACK SYN -i %%nom_zone_eth1 -s %%adresse_network_eth1/%%adresse_netmask_eth2 -j ACCEPT
/sbin/iptables -t filter -I ped-bas -m state --state NEW -p tcp --dport 3000 --tcp-flags SYN,RST,ACK SYN -i %%nom_zone_eth2 -s %%adresse_network_eth2/30 -j ACCEPT
/sbin/iptables -t filter -I ext-bas -m state --state NEW -p tcp --dport 3000 --tcp-flags SYN,RST,ACK SYN -i %%nom_zone_eth0 -s 195.83.225.0/255.255.255.0 -j ACCEPT
## Pour shinken
/sbin/iptables -t filter -I ext-bas -m state --state NEW -p tcp --dport 6556 --tcp-flags SYN,RST,ACK SYN -i %%nom_zone_eth0 -s 195.83.225.0/255.255.255.0 -j ACCEPT
## Plages horaires pour WIFI LORDI
%if %%plage_wifi == 'oui' and %%plage_wifi_debut != '' and %%plage_wifi_fin != '' and %%nom_zone_eth4 != '' and %%vlan_id_eth4[0] != ''
/sbin/iptables -I INPUT -i %%nom_zone_eth4.%%vlan_id_eth4[0] -m time --timestop %%plage_wifi_debut --timestart %%plage_wifi_fin --kerneltz -j DROP
%end if
############################################
## Ajout de regles pour les COLLECTIVITES ##
############################################
## REGION ##
%if %%nom_domaine_local.startswith("lyc-") or %%nom_domaine_local.startswith("erea-")
## SNAT en IP %%nom_zone_eth2 de la zone pedago etendu si destination zone client leger (inventaire GLPI REGION) pour port 80 et 62354
/sbin/iptables -t filter -I ped-ext -s %%adresse_network_eth2/%%adresse_netmask_eth2 -d 172.23.0.0/18 -i %%nom_zone_eth2 -o %%nom_zone_eth0 -p tcp -m tcp --dport 62354 --tcp-flags SYN,RST,ACK SYN -j ACCEPT
/sbin/iptables -t nat -I POSTROUTING -s %%adresse_network_eth2/%%adresse_netmask_eth2 -d 172.23.0.0/18 -o %%nom_zone_eth0 -p tcp -m tcp --dport 62354 --tcp-flags SYN,RST,ACK SYN -j SNAT --to-source %%adresse_ip_eth2
/sbin/iptables -t filter -I ped-ext -s %%adresse_network_eth2/%%adresse_netmask_eth2 -d 172.23.0.0/18 -i %%nom_zone_eth2 -o %%nom_zone_eth0 -p tcp -m tcp --dport 80 --tcp-flags SYN,RST,ACK SYN -j ACCEPT
/sbin/iptables -t nat -I POSTROUTING -s %%adresse_network_eth2/%%adresse_netmask_eth2 -d 172.23.0.0/18 -o %%nom_zone_eth0 -p tcp -m tcp --dport 80 --tcp-flags SYN,RST,ACK SYN -j SNAT --to-source %%adresse_ip_eth2
## acces au serveur peda depuis le reseau Region (comme DANe)
/sbin/iptables -t nat -I PREROUTING -s 194.214.141.0/24 -d %%adresse_ip_eth0/32 -i %%nom_zone_eth0 -p tcp -m tcp --dport 44123 --tcp-flags SYN,RST,ACK SYN -j DNAT --to-destination %%ip_serveur_pedago
/sbin/iptables -t filter -I ext-ped -s 194.214.141.0/24 -d %%ip_serveur_pedago/32 -i %%nom_zone_eth0 -p tcp -m state --state NEW -m tcp --dport 44123 --tcp-flags SYN,RST,ACK SYN -j ACCEPT
%end if
## CD11 ##
%if %%numero_etab.startswith("011") and %%nom_domaine_local.startswith("clg-")
## Acces RDP port 44123 sur serveur PEDA
/sbin/iptables -t nat -I PREROUTING -d %%adresse_ip_eth1/32 -p tcp -m tcp --dport 44123 --tcp-flags SYN,RST,ACK SYN -j DNAT --to-destination %%ip_serveur_pedago
/sbin/iptables -t filter -I ext-ped -s 192.168.225.0/24 -d %%ip_serveur_pedago/32 -i %%nom_zone_eth0 -p tcp -m state --state NEW -m tcp --dport 44123 --tcp-flags SYN,RST,ACK SYN -j ACCEPT
/sbin/iptables -t filter -I ext-ped -s 10.11.200.0/24 -d %%ip_serveur_pedago/32 -i %%nom_zone_eth0 -p tcp -m state --state NEW -m tcp --dport 44123 --tcp-flags SYN,RST,ACK SYN -j ACCEPT
## SNAT pour remontee via tunnel ADMIN des fluc TCP et UDP a destination de AMON-COGITIS
/sbin/iptables -t nat -I POSTROUTING -s %%adresse_network_eth2/%%adresse_netmask_eth2 -d 10.11.200.0/24 -j SNAT --to-source %%adresse_ip_eth1
/sbin/iptables -t nat -I POSTROUTING -s %%adresse_network_eth3/%%adresse_netmask_eth3 -d 10.11.200.0/24 -j SNAT --to-source %%adresse_ip_eth1
## autorisation ports TCP vers COGITIS
/sbin/iptables -t filter -I ped-adm -m state --state NEW -p tcp --tcp-flags SYN,RST,ACK SYN -m multiport --dports 80,161,162,443 -d 10.11.200.0/24 -j ACCEPT
## autorisation ports UDP vers COGITIS
/sbin/iptables -t filter -I ped-adm -p udp -m udp -m multiport --dports 135,161,162,445,514,24158 -d 10.11.200.0/24 -j ACCEPT
/sbin/iptables -t filter -I dmz-adm -p udp -m udp -m multiport --dports 135,161,162,445,514,24158 -d 10.11.200.0/24 -j ACCEPT
/sbin/iptables -t nat -I PREROUTING -d %%adresse_ip_eth1/32 -p udp -m udp --dport 24158 -j DNAT --to-destination %%ip_serveur_pedago
/sbin/iptables -t filter -I ext-ped -s 10.11.200.0/24 -d %%ip_serveur_pedago/32 -i %%nom_zone_eth0 -p udp -m state --state NEW -m udp --dport 24158 -j ACCEPT
## Remontee Inventaire (HTTPS) vers reseau COGITIS via tunnel ADMIN
## exception au proxy pour remontee vers reseau COGITIS
/sbin/iptables -t nat -I PREROUTING -p tcp -m tcp -m multiport --dports 80,443 --tcp-flags SYN,RST,ACK SYN -d 10.11.200.0/24 -j ACCEPT
%end if
## CD30 ##
%if %%numero_etab.startswith("030") and %%nom_domaine_local.startswith("clg-")
## EDUTICE
## les serveurs edutice peuvent sortir pour faire telemaintenance vers l'exterieur
/sbin/iptables -t nat -I POSTROUTING -s %%ip_serveur_pedago2/32 -d 91.121.175.129/32 -o %%nom_zone_eth0 -p udp -m udp --dport 1194 -j SNAT --to-source %%adresse_ip_eth0
/sbin/iptables -t nat -I POSTROUTING -s %%ip_serveur_antivirus/32 -d 91.121.175.129/32 -o %%nom_zone_eth0 -p udp -m udp --dport 1194 -j SNAT --to-source %%adresse_ip_eth0
/sbin/iptables -t filter -I ped-ext -s %%ip_serveur_antivirus/32 -d 91.121.175.129/32 -i %%nom_zone_eth2 -o %%nom_zone_eth0 -p udp -m udp --dport 1194 -j ACCEPT
/sbin/iptables -t filter -I ped-ext -s %%ip_serveur_pedago2/32 -d 91.121.175.129/32 -i %%nom_zone_eth2 -o %%nom_zone_eth0 -p udp -m udp --dport 1194 -j ACCEPT
## autoriser l'exterieur a faire du 8099 sur ip %%nom_zone_eth0 et renvoyer vers serveur pedago
/sbin/iptables -t nat -I PREROUTING -d %%adresse_ip_eth0/32 -i %%nom_zone_eth0 -p tcp -m tcp --dport 8099 --tcp-flags SYN,RST,ACK SYN -j DNAT --to-destination %%ip_serveur_pedago2:8080
/sbin/iptables -t filter -I ext-bas -d %%adresse_ip_eth0/32 -i %%nom_zone_eth0 -p tcp -m state --state NEW -m tcp --dport 8099 --tcp-flags SYN,RST,ACK SYN -j ACCEPT
## ajout pour les AMON 2.3 pour acces NGINX owncloud
/sbin/iptables -t filter -I ext-bas -m state --state NEW -p tcp --dport 443 --tcp-flags SYN,RST,ACK SYN -i %%nom_zone_eth0 -j ACCEPT
%end if
## CD34 ##
%if %%numero_etab in ('0340109j','0340955d','0341366a','0342326u')
## acces CD34 au MDM tablettes via serveur PEDA
/sbin/iptables -t nat -I PREROUTING -s 212.51.190.239/32 -d %%adresse_ip_eth0/32 -i %%nom_zone_eth0 -p tcp -m tcp --dport 44123 --tcp-flags SYN,RST,ACK SYN -j DNAT --to-destination %%ip_serveur_pedago
/sbin/iptables -t filter -I ext-ped -s 212.51.190.239/32 -d %%ip_serveur_pedago/32 -i %%nom_zone_eth0 -p tcp -m state --state NEW -m tcp --dport 44123 --tcp-flags SYN,RST,ACK SYN -j ACCEPT
%end if
###########################################
## Ajout de regles specifiques pour EPLE ##
###########################################
## Specificite 0340042L - Lyc Mermoz MPL - plusieurs sous-reseaux
%if %%numero_etab == '0340042l'
/sbin/iptables -t nat -A POSTROUTING -s 10.134.0.0/16 -o %%nom_zone_eth0 -p tcp -m tcp --tcp-flags SYN,RST,ACK SYN -j SNAT --to-source %%adresse_ip_eth0
/sbin/iptables -t nat -A POSTROUTING -s 10.134.0.0/16 -o %%nom_zone_eth0 -p udp -m udp -j SNAT --to-source %%adresse_ip_eth0
%end if
## Specificite 0340076Y - Lyc Curie Sete - port 14000 utilise par client PRONOTE
%if %%numero_etab == '0340076y'
/sbin/iptables -t nat -I PREROUTING -d %%ip_pub2/32 -i %%nom_zone_eth0 -p tcp -m tcp --dport 14000 --tcp-flags SYN,RST,ACK SYN -j DNAT --to-destination %%ip_serveur_web2
%end if
## Specificite 0300052U - Cite Scolaire Chamson Le Vigan - ajout de regles specifiques Wifi
%if %%numero_etab == '0300052u'
## filtrage acces administration ALCAZAR (reserve reseau rectorat)
/sbin/iptables -t nat -I PREROUTING -s 194.214.141.0/24,195.83.225.0/24,194.254.31.192/29,194.254.31.200/29 -d %%adresse_ip_eth0/32 -i %%nom_zone_eth0 -p tcp -m tcp --dport 10022 --tcp-flags SYN,RST,ACK SYN -j DNAT --to-destination 10.230.27.50:22
/sbin/iptables -t filter -I ext-dmz -s 194.214.141.0/24,195.83.225.0/24,194.254.31.192/29,194.254.31.200/29 -d 10.230.27.50/32 -i %%nom_zone_eth0 -p tcp -m state --state NEW -m tcp --dport 22 --tcp-flags SYN,RST,ACK SYN -j ACCEPT
## exeption proxy pour sortie ALCASAR vers internet sans PROXY
/sbin/iptables -t nat -I PREROUTING -i %%nom_zone_eth3 -s 10.230.27.50/32 -p tcp -m tcp -m multiport --dports 80,443 --tcp-flags SYN,RST,ACK SYN -j ACCEPT
/sbin/iptables -t nat -A POSTROUTING -s 10.230.27.50 -p tcp -m tcp -m multiport --dports 80,443 -o ens160 -j SNAT --to-source %%adresse_ip_eth0
%end if
###################################################################################
## PROJET GSIC pour CD34 ##
###################################################################################
## exception au proxy sur les remontee vers Management CD34 et CodeRNE-PYTHEAS
/sbin/iptables -t nat -I PREROUTING -p tcp -m tcp --tcp-flags SYN,RST,ACK SYN -d 172.19.34.0/24 -j ACCEPT
/sbin/iptables -t nat -I PREROUTING -p tcp -m tcp --tcp-flags SYN,RST,ACK SYN -d %%ip_serveur_pytheas/32 -j ACCEPT
## Regle de Filtrage Autorisation depuis les Reseaux Admin/Pedag/WifiPedag vers serveur WSUS Local (filtrer ulterieurement sur IP serveurs WSUS)
/sbin/iptables -t filter -I adm-man -p tcp -m state --state NEW --tcp-flags SYN,RST,ACK SYN --dport 8530 -d %%ip_serveur_mgmt/32 -j ACCEPT
/sbin/iptables -t filter -I ped-man -p tcp -m state --state NEW --tcp-flags SYN,RST,ACK SYN --dport 8530 -d %%ip_serveur_mgmt/32 -j ACCEPT
/sbin/iptables -t filter -I wif-man -p tcp -m state --state NEW --tcp-flags SYN,RST,ACK SYN --dport 8530 -d %%ip_serveur_mgmt/32 -j ACCEPT
## Regle de Filtrage Autorisation depuis les Reseaux Admin/Pedag/WifiPedag vers CodeRNE-PYTHEAS
/sbin/iptables -t filter -I adm-man -p tcp -m state --state NEW --tcp-flags SYN,RST,ACK SYN -m multiport --dports 139,445 -d %%ip_serveur_pytheas/32 -j ACCEPT
/sbin/iptables -t filter -I ped-man -p tcp -m state --state NEW --tcp-flags SYN,RST,ACK SYN -m multiport --dports 139,445 -d %%ip_serveur_pytheas/32 -j ACCEPT
/sbin/iptables -t filter -I wif-man -p tcp -m state --state NEW --tcp-flags SYN,RST,ACK SYN -m multiport --dports 139,445 -d %%ip_serveur_pytheas/32 -j ACCEPT
/sbin/iptables -t filter -I adm-man -p udp -m udp -m multiport --dports 69,137,138,139 -d %%ip_serveur_pytheas/32 -j ACCEPT
/sbin/iptables -t filter -I ped-man -p udp -m udp -m multiport --dports 69,137,138,139 -d %%ip_serveur_pytheas/32 -j ACCEPT
/sbin/iptables -t filter -I wif-man -p udp -m udp -m multiport --dports 69,137,138,139 -d %%ip_serveur_pytheas/32 -j ACCEPT
/sbin/iptables -t filter -I adm-man -p tcp -m state --state NEW --tcp-flags SYN,RST,ACK SYN -m multiport --dports 80,443 -d %%ip_serveur_pytheas/32 -j ACCEPT
/sbin/iptables -t filter -I ped-man -p tcp -m state --state NEW --tcp-flags SYN,RST,ACK SYN -m multiport --dports 80,443 -d %%ip_serveur_pytheas/32 -j ACCEPT
/sbin/iptables -t filter -I wif-man -p tcp -m state --state NEW --tcp-flags SYN,RST,ACK SYN -m multiport --dports 80,443 -d %%ip_serveur_pytheas/32 -j ACCEPT
## Regle de Filtrage Autorisation de tous les flux depuis le reseau Wifipedag vers le Serveur CodeRNE-SRVPEDAG
/sbin/iptables -t filter -I wif-ped -d %%ip_serveur_pedago -m state --state NEW -p tcp --tcp-flags SYN,RST,ACK SYN -j ACCEPT
/sbin/iptables -t filter -I wif-ped -d %%ip_serveur_pedago -m udp -p udp -j ACCEPT
/sbin/iptables -t filter -I wif-ped -d %%ip_serveur_pedago -p icmp -m state --state NEW -m icmp --icmp-type 8 -j ACCEPT
## Regle de Filtrage pour Administrer AMON depuis le reseau de Management
/sbin/iptables -I man-bas -p icmp -j ACCEPT
/sbin/iptables -t filter -I man-bas -p tcp -m state --state NEW --tcp-flags SYN,RST,ACK SYN -m multiport --dports 22,4200,7000 -j ACCEPT
## Ajout NAT pour sortir sur internet depuis le reseau Management
/sbin/iptables -t nat -I POSTROUTING -s %%vlan_id_eth4[0].vlan_network_eth4/%%vlan_id_eth4[0].vlan_netmask_eth4 -o %%nom_zone_eth0 -j SNAT --to-source %%adresse_ip_eth0