Procédure complète · Zone-Based Policy Firewall · WAN · DMZ · STATIONS · SERVEURS · Cisco IOS
Le ZPF organise les interfaces en zones de sécurité. Tout trafic entre deux zones distinctes est bloqué par défaut — contrairement aux ACL qui autorisent tout sauf ce qui est bloqué.
| Mécanisme | Rôle |
|---|---|
zone security | Crée une zone logique — regroupement d'interfaces |
class-map type inspect | Identifie les types de trafic par protocole (HTTP, DNS, ICMP...) |
policy-map type inspect | Associe une class-map à une action : inspect, drop ou pass |
zone-pair security | Définit le sens du trafic (source → destination) et y attache une policy-map |
zone-member security | Rattache une interface physique à une zone |
inspect : autorise ET crée une session stateful. Le trafic retour est automatiquement autorisé. Utiliser pour TCP/UDP/ICMP.drop : bloque silencieusement. Aucun ICMP de rejet envoyé.pass : autorise sans suivi de session. Déconseillé (pas de retour automatique).WAN ≠ wan. Il doit être recopié exactement dans les class-maps, policy-maps et zone-pairs. Dès qu'une interface est rattachée à une zone, tout trafic sans zone-pair correspondant est droppé silencieusement — y compris SSH/Telnet de gestion.| Interface | Zone | Adresse IP | Masque |
|---|---|---|---|
| FastEthernet 0/0 | WAN | 10.0.0.254 | 255.0.0.0 |
| FastEthernet 0/1 | STATIONS | 192.168.2.254 | 255.255.255.0 |
| FastEthernet 0/2 | SERVEURS | 192.168.1.254 | 255.255.255.0 |
| FastEthernet 0/3 | DMZ | 192.168.50.254 | 255.255.255.0 |
| Source → Destination | Flux autorisés | Zone-pair |
|---|---|---|
| STATIONS → SERVEURS | TCPUDPICMP | ZP-STATIONS-TO-SERVEURS |
| STATIONS → DMZ | HTTPDNSSMTPICMPSYSLOG | ZP-STATIONS-TO-DMZ |
| STATIONS → WAN | HTTPHTTPSDNSICMP | ZP-STATIONS-TO-WAN |
| SERVEURS → DMZ | HTTPDNSSMTPICMPSYSLOG | ZP-SERVEURS-TO-DMZ |
| SERVEURS → WAN | HTTPHTTPSDNSICMP | ZP-SERVEURS-TO-WAN |
| WAN → DMZ | HTTPDNSSMTPSYSLOG IP 192.168.50.1 seulement | ZP-WAN-TO-DMZ |
| DMZ → tout | ❌ BLOQUÉ — Aucun zone-pair | — |
| WAN → STATIONS | ❌ BLOQUÉ — Aucun zone-pair | — |
| WAN → SERVEURS | ❌ BLOQUÉ — Aucun zone-pair | — |
inspect, le trafic retour est géré automatiquement par la table stateful. Il est inutile de créer un zone-pair inverse pour le retour.enable
configure terminal
! Interface WAN
interface FastEthernet0/0
ip address 10.0.0.254 255.0.0.0
no shutdown
exit
! Interface STATIONS
interface FastEthernet0/1
ip address 192.168.2.254 255.255.255.0
no shutdown
exit
! Interface SERVEURS
interface FastEthernet0/2
ip address 192.168.1.254 255.255.255.0
no shutdown
exit
! Interface DMZ
interface FastEthernet0/3
ip address 192.168.50.254 255.255.255.0
no shutdown
exit
! Création des 4 zones de sécurité
zone security WAN
exit
zone security DMZ
exit
zone security STATIONS
exit
zone security SERVEURS
exit
match-any = logique OR — le flux est identifié si au moins un protocole correspond. C'est le mode utilisé ici (plusieurs protocoles différents).
! CM-1 : STATIONS → SERVEURS (TCP, UDP, ICMP)
class-map type inspect match-any CM-STATIONS-TO-SERVEURS
match protocol tcp
match protocol udp
match protocol icmp
exit
! CM-2 : vers DMZ (HTTP, DNS, SMTP, ICMP, SYSLOG)
! Utilisée par STATIONS→DMZ et SERVEURS→DMZ
class-map type inspect match-any CM-TO-DMZ
match protocol http
match protocol dns
match protocol smtp
match protocol icmp
match protocol syslog
exit
! CM-3 : vers WAN (HTTP, HTTPS, DNS, ICMP)
! Utilisée par STATIONS→WAN et SERVEURS→WAN
class-map type inspect match-any CM-TO-WAN
match protocol http
match protocol https
match protocol dns
match protocol icmp
exit
! CM-4 : WAN → DMZ (services publiés)
class-map type inspect match-any CM-WAN-TO-DMZ
match protocol http
match protocol dns
match protocol smtp
match protocol syslog
exit
match-all (AND logique, rarement utile pour des protocoles différents).Chaque policy-map associe une class-map à une action. Le bloc class class-default drop est une bonne pratique — il bloque explicitement tout trafic non identifié.
! PM-1 : STATIONS → SERVEURS
policy-map type inspect PM-STATIONS-TO-SERVEURS
class type inspect CM-STATIONS-TO-SERVEURS
inspect
class class-default
drop
exit
! PM-2 : STATIONS → DMZ
policy-map type inspect PM-STATIONS-TO-DMZ
class type inspect CM-TO-DMZ
inspect
class class-default
drop
exit
! PM-3 : SERVEURS → DMZ
policy-map type inspect PM-SERVEURS-TO-DMZ
class type inspect CM-TO-DMZ
inspect
class class-default
drop
exit
! PM-4 : STATIONS → WAN
policy-map type inspect PM-STATIONS-TO-WAN
class type inspect CM-TO-WAN
inspect
class class-default
drop
exit
! PM-5 : SERVEURS → WAN
policy-map type inspect PM-SERVEURS-TO-WAN
class type inspect CM-TO-WAN
inspect
class class-default
drop
exit
! PM-6 : WAN → DMZ (services publiés)
policy-map type inspect PM-WAN-TO-DMZ
class type inspect CM-WAN-TO-DMZ
inspect
class class-default
drop
exit
Le zone-pair définit le sens du flux (source → destination) et y attache une policy-map. Un zone-pair = un sens. Le retour est géré automatiquement par la table stateful.
! ZP-1 : STATIONS → SERVEURS
zone-pair security ZP-STATIONS-TO-SERVEURS source STATIONS destination SERVEURS
service-policy type inspect PM-STATIONS-TO-SERVEURS
exit
! ZP-2 : STATIONS → DMZ
zone-pair security ZP-STATIONS-TO-DMZ source STATIONS destination DMZ
service-policy type inspect PM-STATIONS-TO-DMZ
exit
! ZP-3 : STATIONS → WAN
zone-pair security ZP-STATIONS-TO-WAN source STATIONS destination WAN
service-policy type inspect PM-STATIONS-TO-WAN
exit
! ZP-4 : SERVEURS → DMZ
zone-pair security ZP-SERVEURS-TO-DMZ source SERVEURS destination DMZ
service-policy type inspect PM-SERVEURS-TO-DMZ
exit
! ZP-5 : SERVEURS → WAN
zone-pair security ZP-SERVEURS-TO-WAN source SERVEURS destination WAN
service-policy type inspect PM-SERVEURS-TO-WAN
exit
! ZP-6 : WAN → DMZ (filtrage IP 192.168.50.1 uniquement)
zone-pair security ZP-WAN-TO-DMZ source WAN destination DMZ
service-policy type inspect PM-WAN-TO-DMZ
exit
inspect.C'est l'étape qui active le ZPF. Dès qu'une interface est rattachée à une zone, le filtrage prend effet immédiatement.
! Fa0/0 → zone WAN
interface FastEthernet0/0
zone-member security WAN
exit
! Fa0/1 → zone STATIONS
interface FastEthernet0/1
zone-member security STATIONS
exit
! Fa0/2 → zone SERVEURS
interface FastEthernet0/2
zone-member security SERVEURS
exit
! Fa0/3 → zone DMZ
interface FastEthernet0/3
zone-member security DMZ
exit
end
write memory
La politique impose que le WAN n'accède à la DMZ que vers le serveur 192.168.50.1 (HTTP/DNS/SMTP). Le serveur Syslog 192.168.50.2 ne doit pas être accessible depuis le WAN.
! ACL étendue — autorise uniquement le serveur DMZ 192.168.50.1
ip access-list extended ACL-WAN-TO-DMZ-SERVER
10 permit ip any host 192.168.50.1
20 deny ip any any
exit
! Méthode 1 — IOS réel : class-map avec filtrage ACL
class-map type inspect match-all CM-WAN-TO-DMZ-FILTERED
match access-group name ACL-WAN-TO-DMZ-SERVER
exit
match access-group name peut être partiellement supporté selon la version. Si non disponible, appliquer l'ACL directement sur l'interface WAN en entrée comme alternative :interface FastEthernet0/0 ip access-group ACL-WAN-TO-DMZ-SERVER in! Vérifier les zones et leurs interfaces membres
show zone security
! Vérifier les zone-pairs et les policy-maps associées
show zone-pair security
! Statistiques de trafic par policy (compteurs)
show policy-map type inspect zone-pair
! Lister toutes les class-maps
show class-map type inspect
! Vérifier toute la configuration ZPF
show run
! Suivi des sessions en temps réel (attention : verbeux !)
debug ip inspect events
| Test | Action | Résultat attendu | Zone-pair |
|---|---|---|---|
| STATIONS → Srv HTTP DMZ | Ping + HTTP vers 192.168.50.1 | ✅ Autorisé | ZP-STATIONS-TO-DMZ |
| STATIONS → WAN HTTP | HTTP vers 10.0.0.1 | ✅ Autorisé | ZP-STATIONS-TO-WAN |
| STATIONS → Srv DNS | DNS vers 192.168.1.2 | ✅ Autorisé | ZP-STATIONS-TO-SERVEURS |
| WAN → Srv DMZ HTTP | HTTP vers 192.168.50.1 | ✅ Autorisé | ZP-WAN-TO-DMZ |
| DMZ → STATIONS | Ping depuis 192.168.50.1 | ❌ Bloqué | Aucun zone-pair |
| DMZ → WAN | HTTP depuis DMZ | ❌ Bloqué | Aucun zone-pair |
| WAN → STATIONS | Ping vers 192.168.2.x | ❌ Bloqué | Aucun zone-pair |
| WAN → Syslog DMZ | Syslog vers 192.168.50.2 | ❌ Bloqué | Filtrage IP — .50.2 non ciblé |
show policy-map type inspect zone-pair que les compteurs drop augmentent.enable
configure terminal
! ── 1. ZONES ─────────────────────────────────────────────
zone security WAN
exit
zone security DMZ
exit
zone security STATIONS
exit
zone security SERVEURS
exit
! ── 2. CLASS-MAPS ────────────────────────────────────────
class-map type inspect match-any CM-STATIONS-TO-SERVEURS
match protocol tcp
match protocol udp
match protocol icmp
exit
class-map type inspect match-any CM-TO-DMZ
match protocol http
match protocol dns
match protocol smtp
match protocol icmp
match protocol syslog
exit
class-map type inspect match-any CM-TO-WAN
match protocol http
match protocol https
match protocol dns
match protocol icmp
exit
class-map type inspect match-any CM-WAN-TO-DMZ
match protocol http
match protocol dns
match protocol smtp
match protocol syslog
exit
! ── 3. POLICY-MAPS ───────────────────────────────────────
policy-map type inspect PM-STATIONS-TO-SERVEURS
class type inspect CM-STATIONS-TO-SERVEURS
inspect
class class-default
drop
exit
policy-map type inspect PM-STATIONS-TO-DMZ
class type inspect CM-TO-DMZ
inspect
class class-default
drop
exit
policy-map type inspect PM-SERVEURS-TO-DMZ
class type inspect CM-TO-DMZ
inspect
class class-default
drop
exit
policy-map type inspect PM-STATIONS-TO-WAN
class type inspect CM-TO-WAN
inspect
class class-default
drop
exit
policy-map type inspect PM-SERVEURS-TO-WAN
class type inspect CM-TO-WAN
inspect
class class-default
drop
exit
policy-map type inspect PM-WAN-TO-DMZ
class type inspect CM-WAN-TO-DMZ
inspect
class class-default
drop
exit
! ── 4. ZONE-PAIRS ────────────────────────────────────────
zone-pair security ZP-STATIONS-TO-SERVEURS source STATIONS destination SERVEURS
service-policy type inspect PM-STATIONS-TO-SERVEURS
exit
zone-pair security ZP-STATIONS-TO-DMZ source STATIONS destination DMZ
service-policy type inspect PM-STATIONS-TO-DMZ
exit
zone-pair security ZP-STATIONS-TO-WAN source STATIONS destination WAN
service-policy type inspect PM-STATIONS-TO-WAN
exit
zone-pair security ZP-SERVEURS-TO-DMZ source SERVEURS destination DMZ
service-policy type inspect PM-SERVEURS-TO-DMZ
exit
zone-pair security ZP-SERVEURS-TO-WAN source SERVEURS destination WAN
service-policy type inspect PM-SERVEURS-TO-WAN
exit
zone-pair security ZP-WAN-TO-DMZ source WAN destination DMZ
service-policy type inspect PM-WAN-TO-DMZ
exit
! ── 5. INTERFACES → ZONES ────────────────────────────────
interface FastEthernet0/0
zone-member security WAN
exit
interface FastEthernet0/1
zone-member security STATIONS
exit
interface FastEthernet0/2
zone-member security SERVEURS
exit
interface FastEthernet0/3
zone-member security DMZ
exit
end
write memory
| § | Étape | Commande clé | Vérification |
|---|---|---|---|
| 4 | Config interfaces | ip address + no shutdown | 🧪 Pings inter-zones en clair |
| 5 | Zones (×4) | zone security NOM | show zone security |
| 6 | Class-maps (×4) | class-map type inspect match-any | show class-map type inspect |
| 7 | Policy-maps (×6) | policy-map type inspect + inspect + drop | show run |
| 8 | Zone-pairs (×6) | zone-pair security + service-policy | show zone-pair security |
| 9 | Interfaces → zones | zone-member security | 🧪 Test 1, 2, 3 |
| 10 | Filtrage IP WAN→DMZ | ip access-list extended | 🧪 WAN→.50.1 ✅ / WAN→.50.2 ❌ |
BTS SIO SISR — Cyber-Sécurité · Pare-feu ZPF 4 zones · Cisco Packet Tracer · 15 janvier 2026