SONiC Dell Networking : Surveillance dynamique du protocole de configuration d’hôte
Summary: Cet article explique comment le protocole DHCP (Dynamic Host Configuration Protocol) est utilisé dans Dell Networking SONiC. Cet article utilise un commutateur exécutant Dell SONiC 4.1. ...
This article applies to
This article does not apply to
This article is not tied to any specific product.
Not all product versions are identified in this article.
Instructions
|
Configuration requise
La dénomination de l’interface standard est utilisée pour démontrer les concepts. Reportez-vous à l’article Dell 202172 Dell Networking série S : Configuration de l’interface de base - SONiC 4.0 pour plus d’informations sur la dénomination des interfaces |
Index
Introduction
Configuration
COPP de couche 2 DHCPConfiguration
de surveillance DHCP IPv4Effacer les entrées de la table de liaison de surveillance DHCP IPv4
Afficher les informations
de surveillance DHCP IPv4Configuration
de surveillance DHCP IPv6Effacer les entrées de la table de liaison de surveillance DHCP IPv6
Afficher les informations de surveillance DHCP IPv6
Introduction
La surveillance DHCP (Dynamic Host Configuration Protocol) est une fonction de sécurité qui permet aux commutateurs d’un réseau de surveiller les messages de contrôle DHCP. Un commutateur peut identifier les serveurs et clients DHCP malveillants d’un réseau à l’aide des messages de contrôle.Lorsque vous activez la surveillance DHCP, le commutateur commence à surveiller les paquets de contrôle DHCP à la fois à partir des serveurs et des clients DHCP. Le système utilise ces informations pour créer une base de données.
Il existe deux types d’interfaces de surveillance DHCP : des interfaces fiables et non fiables. Vous connectez des clients DHCP à des interfaces non fiables et des serveurs DHCP à des interfaces fiables.
Lorsque le commutateur reçoit des messages DHCP des clients sur des ports non approuvés qu’il transfère les paquets vers les ports de confiance dans le même VLAN. Lorsque vous configurez des ports qui se connectent aux serveurs DHCP comme fiables, le système supprime tous les messages DHCP-server-to-client qu’il reçoit sur les interfaces non approuvées.
En vérifiant l’adresse MAC source dans l’en-tête Ethernet avec l’adresse MAC du client dans l’en-tête DHCP, la surveillance DHCP minimise l’acquisition d’un bail DHCP par les clients malveillants.
Remarques sur la configuration :
- La surveillance DHCP est prise en charge pour IPv4 et IPv6.
- La surveillance DHCPv6 fonctionne uniquement avec le serveur stateful DHCPv6
- Activez la surveillance DHCP globalement et sur des VLAN spécifiques.
- Configurez les ports du VLAN pour qu’ils soient approuvés ou non approuvés.
- Par défaut, tous les ports ne sont pas approuvés.
- Connectez les serveurs DHCP via des ports de confiance.
- Connectez les clients DHCP via des ports non approuvés.
- Sur les interfaces non approuvées, le commutateur abandonne les paquets DHCP si l’adresse MAC source ne correspond pas à l’adresse matérielle du client. Vous pouvez désactiver ce comportement en désactivant la fonction Vérifier l’adresse MAC. Utilisez cette fonctionnalité pour le relais DHCP et les paquets de demande de monodiffusion DHCP qui sont acheminés.
- Lorsque vous activez la surveillance DHCP, la fonction Vérifier l’adresse MAC est activée par défaut.
- La surveillance DHCP n’est pas appliquée aux VLAN sur lesquels la surveillance n’est pas activée.
- Vous pouvez configurer une entrée manuelle dans la table de liaison de surveillance DHCP.
- Avant d’activer la surveillance DHCP, supprimez la règle DHCP Layer 3 COPP et installez la règle DHCP Layer 2 COPP. Pour plus d’informations, reportez-vous à la section Configuration COPP de couche 2 DHCP .
Configuration COPP de couche 2 DHCP
Pour que la surveillance DHCP fonctionne, effectuez cette configuration :- Désinstallez les règles COPP de couche 3 DHCP. Il s’agit d’une règle par défaut.
admin@DELLSONiC:~$ sonic-cli DELLSONiC# configure terminal DELLSONiC(config)# policy-map copp-system-policy type copp DELLSONiC(config-policy-map)# no class copp-system-dhcp
-
Installez la règle COPP de couche 2 DHCP pour la surveillance DHCP.
admin@DELLSONiC:~$ sonic-cli DELLSONiC# configure terminal DELLSONiC(config)# policy-map copp-system-policy type copp DELLSONiC(config-policy-map)# class copp-system-dhcpl2 DELLSONiC(config-policy-map-flow)# set copp-action copp-system-dhcp
Configuration de surveillance DHCP IPv4
Pour configurer la surveillance DHCP, procédez comme suit :- Activez la surveillance DHCP globalement.
sonic(config)# ip dhcp snooping admin@DELLSONiC:~$ sonic-cli DELLSONiC#configure terminal DELLSONiC(config)# ip dhcp snooping
- Configurez les interfaces connectées au serveur DHCP comme fiables.
sonic(config-if)# ip dhcp snooping trust admin@DELLSONiC:~$ sonic-cli DELLSONiC#configure terminal DELLSONiC(config)# interface Eth 1/1 DELLSONiC(config-if-Eth1/1)# ip dhcp snooping trust
DELLSONiC(config-if-Eth1/1)# show configuration ! interface Eth1/1 mtu 9100 speed 100000 unreliable-los auto no shutdown ip dhcp snooping trust DELLSONiC(config-if-Eth1/1)# DELLSONiC# show ip dhcp snooping DHCP snooping is Enabled DHCP snooping source MAC verification is Enabled DHCP snooping is enabled on the following VLANs: 100 200 201 DHCP snooping trusted interfaces: Eth1/1
- Activez la surveillance DHCP sur un VLAN ou une liste VLAN.
sonic(config)# ip dhcp snooping vlan {vlan-id | vlan-list}
admin@DELLSONiC:~$ sonic-cli
DELLSONiC#configure terminal
DELLSONiC(config)# ip dhcp snooping vlan 100,200-201
%Info: Configuring only existing vlans in range
Remarque : Vous trouverez ci-dessus un message INFO.
DELLSONiC# show ip dhcp snooping DHCP snooping is Enabled DHCP snooping source MAC verification is Enabled DHCP snooping is enabled on the following VLANs: 100 200 201 DHCP snooping trusted interfaces: Eth1/1
- (En option) Désactiver la vérification de l’adresse MAC source DHCP
sonic(config)# no ip dhcp snooping verify mac-address admin@DELLSONiC:~$ sonic-cli DELLSONiC#configure terminal DELLSONiC(config)# no ip dhcp snooping verify mac-address
DELLSONiC# show ip dhcp snooping DHCP snooping is Enabled DHCP snooping source MAC verification is Disabled DHCP snooping is enabled on the following VLANs: 100 200 201 DHCP snooping trusted interfaces: Eth1/1 DELLSONiC#
- (En option) Créez une entrée statique dans la table de liaison de surveillance DHCP.
sonic(config)# ip source binding source-ip-address source-mac-address vlan vlan-id interface interface-name
Remarque : Utilisez la commande no form of the IP source binding pour supprimer une entrée statique.
admin@DELLSONiC:~$ sonic-cli DELLSONiC#configure terminal DELLSONiC(config)# ip source binding 10.10.100.150 aa:bb:cc:dd:11:22 Vlan 100 Eth 1/1
DELLSONiC# show ip dhcp snooping binding Total number of Dynamic bindings: 0 Total number of Static bindings: 1 Total number of Tentative bindings: 0 MAC Address IP Address VLAN Interface Type Lease (Secs) ----------------- --------------- ---- ----------- ------- ----------- aa:bb:cc:dd:11:22 10.10.100.150 100 Eth1/1 static NA DELLSONiC#
Effacer les entrées de la table de liaison de surveillance DHCP pour IPv4
Utilisez les commandes suivantes pour effacer tout ou une entrée dynamique spécifique :- Effacez toutes les entrées dynamiques de liaison de surveillance DHCP IP :
sonic(config)# clear ip dhcp snooping binding
- Effacez une entrée de liaison de surveillance DHCP IP dynamique spécifique :
sonic(config)# clear ip dhcp snooping binding source-ip-address source-mac-address vlan vlan-id interface interface-name
- Effacer les statistiques de surveillance DHCP :
sonic# clear ip dhcp snooping statistics
Afficher les informations de surveillance DHCP pour IPv4.
- Afficher des informations générales sur la surveillance DHCP :
sonic# show ip dhcp snooping admin@DELLSONiC:~$ sonic-cli DELLSONiC# show ip dhcp snooping DHCP snooping is Enabled DHCP snooping source MAC verification is Disabled DHCP snooping is enabled on the following VLANs: 100 200 201 DHCP snooping trusted interfaces: Eth1/1
- Affichez la base de données de liaison de surveillance DHCP :
sonic# show ip dhcp snooping binding admin@DELLSONiC:~$ sonic-cli DELLSONiC# show ip dhcp snooping binding Total number of Dynamic bindings: 0 Total number of Static bindings: 1 Total number of Tentative bindings: 0 MAC Address IP Address VLAN Interface Type Lease (Secs) ----------------- --------------- ---- ----------- ------- ----------- aa:bb:cc:dd:11:22 10.10.100.150 100 Eth1/1 static NA
- Afficher les statistiques de surveillance DHCP :
sonic# show ip dhcp snooping statistics admin@DELLSONiC:~$ sonic-cli DELLSONiC# show ip dhcp snooping statistics Interface MAC Verify Client Ifc DHCP Server Failures Mismatch Msgs Recvd --------------- ---------- ---------- ----------- Eth1/1 0 0 0 Eth1/2 0 0 0 Eth1/3 0 0 0 Eth1/4 0 0 0 Eth1/5 0 0 0 Eth1/6 0 0 0 Eth1/7 0 0 0
Configurer le snooping DHCP pour IPv6.
Pour configurer la surveillance DHCP, procédez comme suit :
- Activez la surveillance DHCP globalement.
sonic(config)# ipv6 dhcp snooping admin@DELLSONiC:~$ sonic-cli DELLSONiC#configure terminal DELLSONiC(config)# ipv6 dhcp snooping
DELLSONiC# show ipv6 dhcp snooping DHCPv6 snooping is Enabled DHCPv6 snooping source MAC verification is Enabled DHCPv6 snooping is enabled on the following VLANs: DHCPv6 snooping trusted interfaces: DELLSONiC#
- Configurez les interfaces connectées au serveur DHCP comme fiables.
sonic(config-if)# ipv6 dhcp snooping trust admin@DELLSONiC:~$ sonic-cli DELLSONiC#configure terminal DELLSONiC(config)# interface Eth 1/1 DELLSONiC(config-if-Eth1/1)# ipv6 dhcp snooping trust
DELLSONiC(config-if-Eth1/1)# show configuration ! interface Eth1/1 mtu 9100 speed 100000 unreliable-los auto no shutdown ip dhcp snooping trust ipv6 dhcp snooping trust DELLSONiC(config-if-Eth1/1)#
DELLSONiC# show ipv6 dhcp snooping DHCPv6 snooping is Enabled DHCPv6 snooping source MAC verification is Enabled DHCPv6 snooping is enabled on the following VLANs: DHCPv6 snooping trusted interfaces: Eth1/1
- Activez la surveillance DHCP sur un VLAN ou une liste VLAN.
sonic(config)# ipv6 dhcp snooping vlan {vlan-id | vlan-list}
admin@DELLSONiC:~$ sonic-cli
DELLSONiC# configure
DELLSONiC(config)# ipv6 dhcp snooping vlan 100,200-201
%Info: Configuring only existing vlans in range
Remarque : Vous trouverez ci-dessus un message INFO.
DELLSONiC# show ipv6 dhcp snooping DHCPv6 snooping is Enabled DHCPv6 snooping source MAC verification is Enabled DHCPv6 snooping is enabled on the following VLANs: 100 200 201 DHCPv6 snooping trusted interfaces: Eth1/1
- (En option) Désactiver la vérification de l’adresse MAC source DHCP
sonic(config)# no ipv6 dhcp snooping verify mac-address admin@DELLSONiC:~$ sonic-cli DELLSONiC# configure DELLSONiC(config)# no ipv6 dhcp snooping verify mac-address
DELLSONiC# show ipv6 dhcp snooping DHCPv6 snooping is Enabled DHCPv6 snooping source MAC verification is Disabled DHCPv6 snooping is enabled on the following VLANs: 100 200 201 DHCPv6 snooping trusted interfaces: Eth1/1 DELLSONiC#
- (En option) Créez une entrée statique dans la table de liaison de surveillance DHCP.
sonic(config)# ipv6 source binding source-ip-address source-mac-address vlan vlan-id interface interface-name admin@DELLSONiC:~$ sonic-cli DELLSONiC# configure DELLSONiC(config)# ipv6 source binding 2001:db8:3333::7778 aa:bb:cc:dd:11:11 Vlan 100 Eth 1/1
DELLSONiC# show ipv6 dhcp snooping binding Total number of Dynamic bindings: 0 Total number of Static bindings: 1 Total number of Tentative bindings: 0 MAC Address IPv6 Address VLAN Interface Type Lease (Secs) ----------------- --------------- ---- ----------- ------- ----------- aa:bb:cc:dd:11:11 2001:db8:3333::7778 100 Eth1/1 static NA DELLSONiC#
Remarque : Utilisez la commande no form of the IP source binding pour supprimer une entrée statique.
Effacer les entrées de la table de liaison de surveillance DHCP pour IPv6
Utilisez les commandes suivantes pour effacer tout ou une entrée dynamique spécifique :
- Effacez toutes les entrées dynamiques de liaison de surveillance DHCP IP :
sonic(config)# clear ipv6 dhcp snooping binding
- Effacez une entrée de liaison de surveillance DHCP IP dynamique spécifique :
sonic(config)# clear ipv6 dhcp snooping binding source-ip-address source-mac-address vlan vlan-id interface interface-name
- Effacer les statistiques de surveillance DHCP :
sonic# clear ipv6 dhcp snooping statistics
Afficher les informations de surveillance DHCP pour IPv6.
- Afficher des informations générales sur la surveillance DHCP :
sonic# show ipv6 dhcp snooping DELLSONiC# show ipv6 dhcp snooping DHCPv6 snooping is Enabled DHCPv6 snooping source MAC verification is Disabled DHCPv6 snooping is enabled on the following VLANs: 100 200 201 DHCPv6 snooping trusted interfaces: Eth1/1 DELLSONiC#
- Affichez la base de données de liaison de surveillance DHCP :
sonic# show ipv6 dhcp snooping binding DELLSONiC# show ipv6 dhcp snooping binding Total number of Dynamic bindings: 0 Total number of Static bindings: 1 Total number of Tentative bindings: 0 MAC Address IPv6 Address VLAN Interface Type Lease (Secs) ----------------- --------------- ---- ----------- ------- ----------- aa:bb:cc:dd:11:11 2001:db8:3333::7778 100 Eth1/1 static NA DELLSONiC#
- Afficher les statistiques de surveillance DHCP :
sonic# show ipv6 dhcp snooping statistics DELLSONiC# show ipv6 dhcp snooping statistics Interface MAC Verify Client Ifc DHCP Server Failures Mismatch Msgs Recvd --------------- ---------- ---------- ----------- Eth1/1 0 0 0 Eth1/2 0 0 0 Eth1/3 0 0 0 Eth1/4 0 0 0
Affected Products
Enterprise SONiC Distribution, PowerSwitch S5048F-ON, PowerSwitch S5148F-ON, PowerSwitch S5212F-ON, PowerSwitch S5224F-ON, PowerSwitch S5232F-ON, PowerSwitch S5248F-ON, PowerSwitch S5296F-ON, PowerSwitch S5448F-ONArticle Properties
Article Number: 000218723
Article Type: How To
Last Modified: 31 Oct 2023
Version: 2
Find answers to your questions from other Dell users
Support Services
Check if your device is covered by Support Services.