Este documento describe cómo borrar una sola entrada de Address Resolution Protocol (ARP) en un router con Simple Network Management Protocol (SNMP).
No hay requisitos específicos para este documento.
La información en este documento se basa en todos los dispositivos que soportan RFC1213MIB que ejecutan el software Cisco IOS®.
The information in this document was created from the devices in a specific lab environment. All of the devices used in this document started with a cleared (default) configuration. If your network is live, make sure that you understand the potential impact of any command.
No hay ningún comando de software de Cisco IOS para borrar una sola entrada de tabla ARP. El comando clear arp-cache del software Cisco IOS borra toda la tabla.
Puede utilizar el SNMP con el objeto MIB ipNetToMediaType (.1.3.6.1.2.1.4.22.1.4) dentro de la tabla ipNetToMediaTable (.1.3.6.1.2.1.4.22) de la MIB1213 RFC.
.1.3.6.1.2.1.4.22 ipNetToMediaTable OBJECT-TYPE -- FROM RFC1213-MIB DESCRIPTION "The IP Address Translation table used for mapping from IP addresses to physical addresses." ::= { iso(1) org(3) dod(6) internet(1) mgmt(2) mib-2(1) ip(4) 22 } .1.3.6.1.2.1.4.22.1.4 ipNetToMediaType OBJECT-TYPE -- FROM RFC1213-MIB SYNTAX Integer { other(1), invalid(2), dynamic(3), static(4) } MAX-ACCESS read-create STATUS Current DESCRIPTION "The type of mapping. Setting this object to the value invalid(2) has the effect of invalidating the corresponding entry in the ipNetToMediaTable. That is, it effectively disassociates the interface identified with said entry from the mapping identified with said entry. It is an implementation-specific matter as to whether the agent removes an invalidated entry from the table. Accordingly, management stations must be prepared to receive tabular information from agents that corresponds to entries not currently in use. Proper interpretation of such entries requires examination of the relevant ipNetToMediaType object." ::= { iso(1) org(3) dod(6) internet(1) mgmt(2) mib-2(1) ip(4) ipNetToMediaTable(22) ipNetToMediaEntry(1) 4 }
Cuando ejecuta ansnmpseton el objeto MIB, ipNetToMediaType (.1.3.6.1.2.1.4.22.1.4), a invalid=2, puede eliminar una sola entrada ARP.
Nota: Asegúrese de configurar las cadenas de comunidad SNMP de sólo lectura (RO)/lectura y escritura (RW) en el router.
A continuación, se ilustra el resultado de snmpwalk del objeto MIB ipNet ipNetToMediaType en el router:
snmpwalk 172.16.99.1 public .1.3.6.1.2.1.4.22.1.4 ip.ipNetToMediaTable.ipNetToMediaEntry.ipNetToMediaType.1.172.16.98.1 = other(1) ip.ipNetToMediaTable.ipNetToMediaEntry.ipNetToMediaType.1.172.16.98.2 = dynamic(3) ip.ipNetToMediaTable.ipNetToMediaEntry.ipNetToMediaType.2.172.16.98.36 = dynamic(3) ip.ipNetToMediaTable.ipNetToMediaEntry.ipNetToMediaType.2.172.16.98.37 = other(1) ip.ipNetToMediaTable.ipNetToMediaEntry.ipNetToMediaType.3.172.16.97.1 = other(1) ip.ipNetToMediaTable.ipNetToMediaEntry.ipNetToMediaType.3.172.16.97.101 = other(1) ip.ipNetToMediaTable.ipNetToMediaEntry.ipNetToMediaType.3.172.16.97.254 = dynamic(3) ip.ipNetToMediaTable.ipNetToMediaEntry.ipNetToMediaType.4.172.16.98.41 = dynamic(3) ip.ipNetToMediaTable.ipNetToMediaEntry.ipNetToMediaType.4.172.16.98.45 = other(1) ip.ipNetToMediaTable.ipNetToMediaEntry.ipNetToMediaType.7.172.16.96.1 = other(1) --<snip>--
Cuando ejecuta un snmpset en una entrada ARP, por ejemplo:
ip.ipNetToMediaTable.ipNetToMediaEntry.ipNetToMediaType.1.172.16.98.2 = dynamic(3)
y establezca su valor en 2=inválido, según la definición de MIB:
snmpset 172.16.99.1 private ipNetToMediaType.1.172.16.98.2 i 2 ip.ipNetToMediaTable.ipNetToMediaEntry.ipNetToMediaType.1.172.16.98.2 = invalid(2)
Si ejecuta otra snmpwalk del objeto MIB ipNetToMediaType en el router, verá este resultado:
snmpwalk 172.16.99.1 public .1.3.6.1.2.1.4.22.1.4 ip.ipNetToMediaTable.ipNetToMediaEntry.ipNetToMediaType.1.172.16.98.1 = other(1) ip.ipNetToMediaTable.ipNetToMediaEntry.ipNetToMediaType.2.172.16.98.36 = dynamic(3) ip.ipNetToMediaTable.ipNetToMediaEntry.ipNetToMediaType.2.172.16.98.37 = other(1) ip.ipNetToMediaTable.ipNetToMediaEntry.ipNetToMediaType.3.172.16.97.1 = other(1) ip.ipNetToMediaTable.ipNetToMediaEntry.ipNetToMediaType.3.172.16.97.101 = other(1) ip.ipNetToMediaTable.ipNetToMediaEntry.ipNetToMediaType.3.172.16.97.254 = dynamic(3) ip.ipNetToMediaTable.ipNetToMediaEntry.ipNetToMediaType.4.172.16.98.41 = dynamic(3) ip.ipNetToMediaTable.ipNetToMediaEntry.ipNetToMediaType.4.172.16.98.45 = other(1) ip.ipNetToMediaTable.ipNetToMediaEntry.ipNetToMediaType.7.172.16.96.1 = other(1) ip.ipNetToMediaTable.ipNetToMediaEntry.ipNetToMediaType.7.172.16.96.31 = dynamic(3) ip.ipNetToMediaTable.ipNetToMediaEntry.ipNetToMediaType.7.172.16.96.40 = dynamic(3) --<snip>--
El resultado objetivo ya no está en el resultado.
ip.ipNetToMediaTable.ipNetToMediaEntry.ipNetToMediaType.1.172.16.98.2 = dynamic(3)
Aquí hay con una explicación de las variables utilizadas anteriormente:
172.16.99.1 = Dirección IP del router utilizado en este ejemplo.
privado = cadena de comunidad RW SNMP del router
public = cadena de comunidad RO SNMP del router
.1.3.6.1.2.1.4.22.1.4= ID del objeto (OID) para el objeto MIB ipNetToMediaType
i = Entero como se define SYNTAX en la MIB
2 (inválido)= Valor del objeto MIB