port-securitystorm-controldhcp-snooping
MDstable
NoteSnippetChecklistPlaybook
Port Security & Storm Control
Sécuriser les ports switch : MAC sticky, storm control, DHCP snooping, DAI
snippetintermediate 2025-05-14 7 min read
port-securitystorm-controldhcp-snoopingdaiciscoswitchingsecurity
Port Security
Concepts
Port Security limiter les adresses MAC autorises sur un port accessProtge contre MAC flooding attaque CAM table connexions non autorisesModes dapprentissage MACstatic MAC configure manuellementdynamic apprise automatiquement perdue au rebootsticky apprise dynamiquement sauvegarde dans running-config recommandModes de violationprotect silencieusement drop les frames des MACs non autorisesrestrict drop incrmente le compteur de violation syslogshutdown err-disable le port immdiatement recommand en production
Configuration de base
text
Variables
{{VLAN_ID}}
conf tinterface GigabitEthernet0/1! Prérequis : port doit être en mode accessswitchport mode accessswitchport access vlan {{VLAN_ID}}! Activer port-securityswitchport port-security! Maximum de MACs autorisées (défaut = 1)switchport port-security maximum 2! Apprentissage sticky (persistant)switchport port-security mac-address sticky! Mode de violationswitchport port-security violation shutdownno shutdown
MAC statique
text
Variables
{{MAC_ADDRESS}}
conf tinterface GigabitEthernet0/2switchport mode accessswitchport port-securityswitchport port-security maximum 1! MAC fixe — utile pour les serveurs ou équipements critiquesswitchport port-security mac-address {{MAC_ADDRESS}}switchport port-security violation restrict
Appliquer en masse (range)
text
conf tinterface range GigabitEthernet0/1-20switchport mode accessswitchport port-securityswitchport port-security maximum 1switchport port-security mac-address stickyswitchport port-security violation shutdown
Vérifications Port Security
text
! Vue globale de tous les ports avec port-securityshow port-security! Détail d'une interfaceshow port-security interface GigabitEthernet0/1! Toutes les MACs sécurisées (sticky + statiques)show port-security address! Ports en err-disableshow interfaces status err-disabledshow errdisable recovery! Voir les MACs sticky dans la configshow running-config interface GigabitEthernet0/1
Récupérer un port en err-disable
text
conf tinterface GigabitEthernet0/1shutdownno shutdown! Récupération automatiqueconf terrdisable recovery cause psecure-violationerrdisable recovery interval 300 ! secondes avant récupération auto
Storm Control
Concepts
Storm Control limiter le trafic broadcast/multicast/unicast inconnu enProtge contre les temptes de broadcast loop virus mauvaise configNiveaux exprims en de la bande passante de linterfaceAction en cas de dpassement shutdown err-disable) ou trap syslog uniquement
Configuration
text
conf tinterface GigabitEthernet0/1! Limiter le broadcast à 10% de la bande passantestorm-control broadcast level 10.00! Limiter le multicaststorm-control multicast level 10.00! Limiter l'unicast inconnustorm-control unicast level 20.00! Action en cas de dépassementstorm-control action shutdown ! err-disable le port! storm-control action trap ! syslog uniquement (moins agressif)no shutdown! En masseinterface range GigabitEthernet0/1-24storm-control broadcast level 10.00storm-control multicast level 10.00storm-control action shutdown
Vérifications Storm Control
text
show storm-controlshow storm-control GigabitEthernet0/1show storm-control GigabitEthernet0/1 broadcast
DHCP Snooping
Concepts
DHCP Snooping filtre les rponses DHCP pour empcher les rogue DHCP serversConstruit une binding table MAC IP VLAN port utilise par DAI et IP Source GuardPorts trusted ports connects au DHCP server ou aux switches upstreamPorts untrusted tous les ports access clients par dfaut
Configuration
text
conf t! 1. Activer globalementip dhcp snooping! 2. Activer par VLANip dhcp snooping vlan 10,20,30! 3. Désactiver l'insertion de l'option 82 (evite problèmes avec certains DHCP)no ip dhcp snooping information option! 4. Marquer les ports uplink/DHCP server comme trustedinterface GigabitEthernet0/24description ** Uplink vers Core / DHCP Server **ip dhcp snooping trustinterface GigabitEthernet0/23description ** DHCP Server direct **ip dhcp snooping trust! Les ports access clients restent untrusted (défaut)! Limiter le débit DHCP sur les ports untrusted (anti-DHCP starvation)interface range GigabitEthernet0/1-20ip dhcp snooping limit rate 15 ! max 15 paquets DHCP/s par port
Vérifications DHCP Snooping
text
show ip dhcp snoopingshow ip dhcp snooping binding ! binding table complèteshow ip dhcp snooping statisticsshow ip dhcp snooping database ! si persistance en TFTP/flash
Dynamic ARP Inspection (DAI)
⚠ Attention —
DHCP Snooping doit être activé et la binding table peuplée AVANT d'activer DAI. Les hôtes avec IP statique ne seront pas dans la binding table — configurer des ARP ACL pour eux.
Concepts
DAI valide les paquets ARP contre la binding table DHCP SnoopingEmpche ARP poisoning man-in-the-middle sur les VLANsPorts trusted interfaces uplink mme logique que DHCP SnoopingPorts untrusted ports access ARP vrifi contre binding table
Configuration
text
Variables
{{STATIC_IP}}
{{STATIC_MAC}}
conf t! 1. Activer DAI par VLAN (DHCP Snooping doit être actif)ip arp inspection vlan 10,20,30! 2. Marquer les ports uplink comme trustedinterface GigabitEthernet0/24ip arp inspection trust! 3. Pour les hôtes avec IP statique — ARP ACL statiquearp access-list STATIC_HOSTSpermit ip host {{STATIC_IP}} mac host {{STATIC_MAC}}ip arp inspection filter STATIC_HOSTS vlan 10! 4. Limiter le débit ARP sur les ports untrustedinterface range GigabitEthernet0/1-20ip arp inspection limit rate 100 ! 100 ARP/s max
Vérifications DAI
text
show ip arp inspection vlan 10show ip arp inspection interfacesshow ip arp inspection statistics vlan 10
IP Source Guard
text
! Complément DHCP Snooping — filtre les paquets IP par MAC+IP (binding table)conf tinterface GigabitEthernet0/1ip verify source ! filtre sur IP uniquement! ip verify source port-security ! filtre sur IP + MAC (plus strict)
802.1X — Authentification de port
Concepts
802 authentification avant accs au rseauActeursSupplicant le client PC tlphone avec logiciel 802Authenticator le switch relais entre client et serveur RADIUSAuth Server serveur RADIUS FreeRADIUS Cisco ISE NPS Windows
Configuration de base
text
Variables
{{RADIUS_NAME}}
{{RADIUS_IP}}
{{RADIUS_SECRET}}
conf t! Activer AAAaaa new-modelaaa authentication dot1x default group radiusaaa authorization network default group radius! Activer 802.1X globalementdot1x system-auth-control! Configurer le serveur RADIUSradius server {{RADIUS_NAME}}address ipv4 {{RADIUS_IP}} auth-port 1812 acct-port 1813key {{RADIUS_SECRET}}! Activer 802.1X sur un portinterface GigabitEthernet0/1authentication mode multi-auth ! plusieurs MACs authentifiéesauthentication port-control auto ! auto = négocie 802.1Xdot1x pae authenticatormab ! MAC Authentication Bypass (fallback)spanning-tree portfast! Vérifiershow dot1x allshow authentication sessions interface GigabitEthernet0/1
Checklist sécurité ports switch
Checklist0/14
💡 Tip —
DHCP Snooping doit être activé et la binding table doit être peuplée (les clients doivent avoir obtenu une IP via DHCP) avant d'activer DAI — DAI utilise cette binding table pour valider les paquets ARP. Si DAI est activé avant que les clients aient leur IP dans la table, leurs requêtes ARP seront droppées et ils perdront la connectivité.
OPS·BRAIN v1.027 notes · Networklocal