cisco-logotip

Configuració de Cisco IP Source Guard

cisco-Configuring-IP-Source-Guard-fig-1

Especificacions

  • Producte: IP Source Guard en dispositius Cisco NX-OS
  • Funcionalitat: Filtre de trànsit per interfície per al trànsit IP
  • Requisits previs: funció DHCP i snooping DHCP activats

Instruccions d'ús

Activació o desactivació d'IP Source Guard en una interfície de capa 2

  1. Introduïu el mode de configuració global:
    configure terminal
  2. Enter interface configuration mode for the specified interface:
    interface ethernet slot/port
  3. Activeu o desactiveu IP Source Guard a la interfície:
    [no] ip verify source dhcp-snooping-vlan

Afegir o eliminar una entrada d'origen d'IP estàtica

  1. Activeu IP Source Guard a la interfície:
    ip verify source dhcp-snooping vlan
  2. Mostra la configuració en execució per a l'espionatge DHCP:
    show running-config dhcp

Sobre IP Source Guard

  • IP Source Guard és un filtre de trànsit per interfície que permet el trànsit IP només quan l'adreça IP i l'adreça MAC de cada paquet coincideixen amb una de les dues fonts d'enllaços d'adreça IP i MAC:
    • Entries in the Dynamic Host Configuration Protocol (DHCP) snooping binding table
    • Static IP source entries that you configure
  • Filtering on trusted IP and MAC address bindings helps prevent spoofing attacks, in which an attacker uses the IP address of a valid host to gain unauthorized network access. To circumvent IP Source Guard, an attacker would have to spoof both the IP address and the MAC address of a valid host.
  • You can enable IP Source Guard on Layer 2 interfaces that are not trusted by DHCP snooping. IP Source Guard supports interfaces that are configured to operate in access mode and trunk mode. When you initially enable IP Source Guard, all inbound IP traffic on the interface is blocked except for the following:
    • DHCP packets, which DHCP snooping inspects and then forwards or drops, depending upon the results of inspecting the packet
    • IP traffic from static IP source entries that you have configured on the Cisco NX-OS device
  • El dispositiu permet el trànsit IP quan l'inspecció DHCP afegeix una entrada de taula d'enllaços per a l'adreça IP i l'adreça MAC d'un paquet IP o quan heu configurat una entrada d'origen IP estàtica.
  • El dispositiu descarta els paquets IP quan l'adreça IP i l'adreça MAC del paquet no tenen una entrada a la taula d'enllaços o una entrada d'origen IP estàtica. Per exemple,ampÉs a dir, suposem que l'ordre show ip dhcp snooping binding mostra la següent entrada a la taula de vincles:cisco-Configuring-IP-Source-Guard-fig-1
  • Si el dispositiu rep un paquet IP amb una adreça IP de 10.5.5.2, IP Source Guard només reenvia el paquet si l'adreça MAC del paquet és 00:02:B3:3F:3B:99.

Requisits previs per a IP Source Guard

IP Source Guard té els següents requisits previs:

  • You must enable the DHCP feature and DHCP snooping before you can configure IP Source Guard. See Configuring DHCP.
  • You must configure the ACL TCAM region size for IP Source Guard using the hardware access-list tcam region ipsg command. See Configuring ACL TCAM Region Sizes.

Nota
By default the ipsg region size is zero. You need to allocate enough entries to this region for storing and enforcing the SMAC-IP bindings.

Pautes i limitacions per a IP Source Guard

IP Source Guard té les següents directrius i limitacions de configuració:

  • IP Source Guard limits IP traffic on an interface to only those sources that have an IP-MAC address binding table entry or static IP source entry. When you first enable IP Source Guard on an interface, you may experience disruption in IP traffic until the hosts on the interface receive a new IP address from a DHCP server.
  • IP Source Guard is dependent upon DHCP snooping to build and maintain the IP-MAC address binding table or upon manual maintenance of static IP source entries.
  • IP Source Guard is not supported on fabric extender (FEX) ports or generic expansion module (GEM) ports.
  • IP Source Guard is not supported on EoR.
  • The following guidelines and limitations apply to the Cisco Nexus 9200 Series switches:
    • IPv6 adjacency is not formed with IPSG enabled on the incoming interface.
    • IPSG drops ARP packets at HSRP standby.
    • With DHCP snooping and IPSG enabled, if a binding entry exists for the host, traffic is forwarded to the host even without ARP.
    • Beginning with Cisco NX-OS Release 9.3(5), IP Source Guard is supported on Cisco Nexus 9364C-GX, Cisco Nexus 9316D-GX, and Cisco Nexus 93600CD-GX switches.
    • IP Source Guard does not require TCAM carving on the Cisco Nexus 9300-X Cloud Scale Switches.
    • If IPSG is enabled, port security can’t be enabled on the interface.

Configuració predeterminada per a IP Source Guard

Aquesta taula enumera els paràmetres predeterminats d'IP Source Guard.

Taula 1: Paràmetres predeterminats de la protecció de la font IP

Paràmetres Per defecte
IP Source Guard Disabled on each interface
IP source entries None. No static or default IP source entries exist by default.

Configuració de la protecció de la font IP

Activació o desactivació d'IP Source Guard en una interfície de capa 2

Podeu activar o desactivar IP Source Guard en una interfície de capa 2. Per defecte, IP Source Guard està desactivat a totes les interfícies.

Abans de començar
Assegureu-vos que la funció DHCP i la funció de monitorització DHCP estiguin habilitades.
Make sure that the ACL TCAM region size for IPSG (ipsg) is configured.

Procediment

  Comandament or Acció Propòsit
Pas 1 configurar el terminal

ExampLI:

interruptor# configurar terminal interruptor (config)#

Entra en el mode de configuració global.
Pas 2 interfície ethernet ranura/port

ExampLI:

switch(config)# interfície ethernet 2/3 commutador (config-if)#

Entra al mode de configuració de la interfície per a la interfície especificada.
  Comandament or Acció Propòsit
Pas 3 [no] ip verify source dhcp-snooping-vlan

ExampLI:

switch(config-if)# ip verifica origen dhcp-snooping vlan

Enables IP Source Guard on the interface. The no form of this command disables IP Source Guard on the interface.
Pas 4 (Opcional) show running-config dhcp

ExampLI:

switch(config-if)# mostra la configuració en execució dhcp

Displays the running configuration for DHCP snooping, including the IP Source Guard

configuració.

Pas 5 (Opcional) copia running-config startup-config

ExampLI:

switch(config-if)# copia running-config startup-config

Copia la configuració en execució a la configuració d'inici.

Afegir o eliminar una entrada d'origen d'IP estàtica

Podeu afegir o eliminar una entrada d'origen IP estàtica al dispositiu. Per defecte, no hi ha entrades d'origen IP estàtiques.

Procediment

  Comandament or Acció Propòsit
Pas 1 configurar el terminal

ExampLI:

interruptor# configurar terminal interruptor (config)#

Entra en el mode de configuració global.
Pas 2 [no] ip font enquadernació adreça IP adreça mac

vlan vlan-id interfície interface-type slot/port

ExampLI:

switch(config)# ip source binding

10.5.22.17 001f.28bd.0013 vlan 100 interface ethernet 2/3

Creates a static IP source entry for the current interface. The no forma d'aquesta comanda

elimina l'entrada d'origen IP estàtica.

Pas 3 (Opcional) show ip dhcp snooping binding [interfície interface-type slot/port]

ExampLI:

switch(config)# mostra la interfície d'enllaç IP, DHCP, Snooping, Ethernet 2/3

Mostra els enllaços d'adreça IP-MAC per a la interfície especificada, incloses les entrades d'origen IP estàtiques. Les entrades estàtiques apareixen amb el terme a la columna Tipus.
Pas 4 (Opcional) copia running-config startup-config

ExampLI:

Copia la configuració en execució a la configuració d'inici.
  Comandament or Acció Propòsit
  switch(config)# copy running-config startup-config  

Configuració de la protecció d'IP Source per als ports troncals

Quan IP Source Guard està configurat en un port, el trànsit que arriba a aquest port es descartarà tret que hi hagi una entrada de snooping DHCP que ho permeti a la TCAM. Tanmateix, quan IP Source Guard està configurat en ports troncals i no voleu que el trànsit que arriba a determinades VLAN se sotmeti a aquesta comprovació (fins i tot si la snooping DHCP no hi està habilitada), podeu especificar una llista de VLAN per excloure.

Abans de començar
Assegureu-vos que la funció DHCP i la funció de monitorització DHCP estiguin habilitades.

Procediment

  Comandament or Acció Propòsit
Pas 1 configurar el terminal

ExampLI:

interruptor# configurar terminal interruptor (config)#

Entra en el mode de configuració global.
Pas 2 [no] ip dhcp snooping ipsg-excluded vlan

llista de vlan

ExampLI:

switch(config)# ip dhcp snooping ipsg-excluded vlan 1001-1256,3097

Especifica la llista de VLAN que s'exclouen de la comprovació de snooping DHCP per a IP Source Guard als ports troncals.
Pas 3 (Opcional) show ip ver source [ethernet

ranura/port | port-canal número de canal]

ExampLI:

switch(config)# mostra la font de la versió IP

Mostra quines VLAN estan excloses.
Pas 4 (Opcional) copia running-config startup-config

ExampLI:

switch(config)# copy running-config startup-config

Copia la configuració en execució a la configuració d'inici.

Visualització dels enllaços de protecció de la font IP

Feu servir l'ordre show ip ver source [ethernet slot/port | port-channel channel-number] per mostrar els enllaços d'adreça IP-MAC.

Esborrant les estadístiques de la protecció de la font IP

To clear IP Source Guard statistics, use the commands in this table.

Comandament Propòsit
clear access-list ipsg stats [instància nombre | mòdul nombre] Clears IP Source Guard statistics.

Configuració Example per a IP Source Guard

Aquest example mostra com crear una entrada d'origen IP estàtica i habilitar IP Source Guard en una interfície:

cisco-Configuring-IP-Source-Guard-fig-2

Referències addicionals

Documents relacionats

Relacionats Tema Document Títol
Regions ACL TCAM Configure IP ACLs
DHCP and DHCP snooping Configuring DHCP

Preguntes freqüents

  • P: Quins són els requisits previs per a IP Source Guard?
    A: Ensure the ipsg region size is allocated for storing and enforcing SMAC-IP bindings.
  • P: Quina és la configuració predeterminada d'IP Source Guard?
    A: By default, IP Source Guard is disabled on each interface with no static or default IP source entries.

Documents/Recursos

Configuració de Cisco IP Source Guard [pdfGuia de l'usuari
Configuració d'IP Source Guard, IP Source Guard, Source Guard, Guard

Referències

Deixa un comentari

La teva adreça de correu electrònic no es publicarà. Els camps obligatoris estan marcats *