Dell Networking SONiC: Snooping des dynamischen Hostkonfigurationsprotokolls

Zusammenfassung: In diesem Artikel wird das Dhcp-Snooping (Dynamic Host Configuration Protocol) in Dell Networking SONiC erläutert. Dieser Artikel verwendet einen Switch, auf dem Dell SONiC 4.1 ausgeführt wird. ...

Dieser Artikel gilt für Dieser Artikel gilt nicht für Dieser Artikel ist nicht an ein bestimmtes Produkt gebunden. In diesem Artikel werden nicht alle Produktversionen aufgeführt.

Weisungen

Voraussetzungen
Die Standardschnittstellenbenennung wird verwendet, um die Konzepte zu demonstrieren. Siehe Dell Artikel 202172 Dell Networking S-Serie: Grundlegende Schnittstellenkonfiguration – SONiC 4.0 für weitere Informationen zur Schnittstellenbenennung


Index

Einführung
DHCP-Layer-2-COPP-Konfiguration
IPv4-DHCP-Snooping-Konfiguration
Löschen von Einträgen aus der IPv4-DHCP-Snooping-Bindungstabelle
Anzeigen von IPv4-DHCP-Snooping-Informationen
IPv6-DHCP-Snooping-Konfiguration
Löschen von Einträgen aus der IPv6-DHCP-Snooping-Bindungstabelle
Anzeigen von IPv6-DHCP-Snooping-Informationen
 

Einführung

DHCP-Snooping (Dynamic Host Configuration Protocol) ist eine Sicherheitsfunktion, mit der Switches in einem Netzwerk DHCP-Steuermeldungen überwachen können. Ein Switch kann nicht autorisierte DHCP-Server und -Clients in einem Netzwerk mithilfe der Steuermeldungen identifizieren.

Wenn Sie DHCP-Snooping aktivieren, startet der Switch die Überwachung von DHCP-Steuerpaketen sowohl von DHCP-Servern als auch von Clients. Das System verwendet diese Informationen, um eine Datenbank zu erstellen.

Es gibt zwei Arten von DHCP-Snooping-Schnittstellen: vertrauenswürdige und nicht vertrauenswürdige Schnittstellen. Sie verbinden DHCP-Clients mit nicht vertrauenswürdigen Schnittstellen und DHCP-Servern mit vertrauenswürdigen Schnittstellen.

Wenn der Switch DHCP-Nachrichten von Clients auf nicht vertrauenswürdigen Ports empfängt, leitet er die Pakete an die vertrauenswürdigen Ports im selben VLAN weiter. Wenn Sie Ports konfigurieren, die als vertrauenswürdig mit DHCP-Servern verbunden sind, löscht das System alle DHCP-Server-zu-Client-Meldungen, die es auf nicht vertrauenswürdigen Schnittstellen empfängt.

Durch die Überprüfung der Quell-MAC-Adresse im Ethernet-Header mit der Client-MAC-Adresse im DHCP-Header minimiert DHCP-Snooping böswillige DHCP-Clients beim Erwerb eines DHCP-Leasingvertrags.

Konfigurationshinweise:
  • DHCP-Snooping wird für IPv4 und IPv6 unterstützt.
  • DHCPv6-Snooping funktioniert nur mit einem zustandsbehafteten DHCPv6-Server
  • Aktivieren Sie DHCP-Snooping global und auf bestimmten VLANs.
  • Konfigurieren Sie Ports innerhalb des VLAN als vertrauenswürdig oder nicht vertrauenswürdig.
  • Standardmäßig sind alle Ports nicht vertrauenswürdig.
  • Verbinden Sie DHCP-Server über vertrauenswürdige Ports.
  • Verbinden Sie DHCP-Clients über nicht vertrauenswürdige Ports.
  • Auf nicht vertrauenswürdigen Schnittstellen löscht der Switch DHCP-Pakete, wenn die Quell-MAC-Adresse nicht mit der Clienthardwareadresse übereinstimmt. Sie können dieses Verhalten deaktivieren, indem Sie die Funktion MAC-Adresse überprüfen deaktivieren. Verwenden Sie diese Funktion für DHCP-Relay- und DHCP-Unicast-Anforderungspakete, die geroutet werden.
  • Wenn Sie DHCP-Snooping aktivieren, ist die Funktion VERIFY MAC address standardmäßig aktiviert.
  • DHCP-Snooping wird nicht auf VLANs angewendet, auf denen Snooping nicht aktiviert ist.
  • Sie können einen manuellen Eintrag in der Dhcp-Snooping-Bindungstabelle konfigurieren.
  • Entfernen Sie vor dem Aktivieren von DHCP-Snooping die DHCP-Layer-3-COPP-Regel und installieren Sie die DHCP-Layer-2-COPP-Regel. Weitere Informationen finden Sie im Abschnitt DHCP-Layer-2-COPP-Konfiguration .
 

DHCP-Layer-2-COPP-Konfiguration

Damit DHCP-Snooping funktioniert, führen Sie diese Konfiguration aus:
  1. Deinstallieren Sie DHCP Layer 3 COPP-Regeln. Dies ist eine Standardregel.
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
  1. Installieren Sie die DHCP-Layer-2-COPP-Regel für DHCP-Snooping.
    
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
 

IPv4-DHCP-Snooping-Konfiguration

Gehen Sie wie folgt vor, um DHCP-Snooping zu konfigurieren:
  1. Aktivieren Sie DHCP-Snooping global.
sonic(config)# ip dhcp snooping

admin@DELLSONiC:~$ sonic-cli
DELLSONiC#configure terminal
DELLSONiC(config)# ip dhcp snooping
  1. Konfigurieren Sie Schnittstellen, die mit dem DHCP-Server verbunden sind, als vertrauenswürdig.
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
  1. Aktivieren Sie DHCP-Snooping auf einem VLAN oder einer VLAN-Liste.
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
HINWEIS: Im Obigen wird eine INFO-Meldung angezeigt.
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
  1. (Optional) Überprüfung der DHCP-Quell-MAC-Adresse deaktivieren
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#
  1. (Optional) Erstellen Sie einen statischen Eintrag in der Dhcp-Snooping-Bindungstabelle.
sonic(config)# ip source binding source-ip-address source-mac-address vlan vlan-id interface interface-name
HINWEIS: Verwenden Sie die Form "no" des Befehls für die IP-Quellbindung, um einen statischen Eintrag zu entfernen.
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#
 

Löschen von Einträgen aus der Dhcp-Snooping-Bindungstabelle für IPv4

Verwenden Sie die folgenden Befehle, um alle oder einen bestimmten dynamischen Eintrag zu löschen:
  • Löschen Sie alle Einträge für dynamische IP-DHCP-Snooping-Bindungen:
sonic(config)# clear ip dhcp snooping binding
  • Löschen Sie einen bestimmten dynamischen IP-DHCP-Snooping-Bindungseintrag:
sonic(config)# clear ip dhcp snooping binding source-ip-address source-mac-address vlan vlan-id interface interface-name
  • Löschen Sie DHCP-Snooping-Statistiken:
sonic# clear ip dhcp snooping statistics
 

Anzeigen von DHCP-Snooping-Informationen für IPv4.

  • Anzeigen allgemeiner Informationen zum DHCP-Snooping:
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
  • Zeigen Sie die DHCP-Snooping-Bindungsdatenbank an:
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
  • Anzeigen von DHCP-Snooping-Statistiken:
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
 

Konfigurieren Sie DHCP-Snooping für IPv6. 

Gehen Sie wie folgt vor, um DHCP-Snooping zu konfigurieren:

  1. Aktivieren Sie DHCP-Snooping global.
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#
  1. Konfigurieren Sie Schnittstellen, die mit dem DHCP-Server verbunden sind, als vertrauenswürdig.
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
  1. Aktivieren Sie DHCP-Snooping auf einem VLAN oder einer VLAN-Liste.
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
HINWEIS: Im Obigen wird eine INFO-Meldung angezeigt.
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
  1. (Optional) Überprüfung der DHCP-Quell-MAC-Adresse deaktivieren
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#
  1. (Optional) Erstellen Sie einen statischen Eintrag in der Dhcp-Snooping-Bindungstabelle.
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#
HINWEIS: Verwenden Sie die Form "no" des Befehls für die IP-Quellbindung, um einen statischen Eintrag zu entfernen.

 

Löschen von Einträgen aus der Dhcp-Snooping-Bindungstabelle für IPv6 

Verwenden Sie die folgenden Befehle, um alle oder einen bestimmten dynamischen Eintrag zu löschen:

  • Löschen Sie alle Einträge für dynamische IP-DHCP-Snooping-Bindungen:
sonic(config)# clear ipv6 dhcp snooping binding
  • Löschen Sie einen bestimmten dynamischen IP-DHCP-Snooping-Bindungseintrag:
sonic(config)# clear ipv6 dhcp snooping binding source-ip-address source-mac-address vlan vlan-id interface interface-name
 
  • Löschen Sie DHCP-Snooping-Statistiken:
sonic# clear ipv6 dhcp snooping statistics

 

Anzeigen von DHCP-Snooping-Informationen für IPv6. 

  • Anzeigen allgemeiner Informationen zum DHCP-Snooping:
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#
  • Zeigen Sie die DHCP-Snooping-Bindungsdatenbank an: 
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#
  • Anzeigen von DHCP-Snooping-Statistiken: 
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

Betroffene Produkte

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-ON
Artikeleigenschaften
Artikelnummer: 000218723
Artikeltyp: How To
Zuletzt geändert: 31 Okt. 2023
Version:  2
Antworten auf Ihre Fragen erhalten Sie von anderen Dell NutzerInnen
Support Services
Prüfen Sie, ob Ihr Gerät durch Support Services abgedeckt ist.