From: Neil Moore (neil@droopy.com)
Date: Thu Dec 19 2002 - 14:56:20 GMT-3
Here is an example.. this is an older IOS so its not as verbose.. but if
gives you the idea
%snmpwalk 10.10.10.13 ccie interfaces.ifTable.ifEntry.ifDescr
interfaces.ifTable.ifEntry.ifDescr.1 = FastEthernet1/1
interfaces.ifTable.ifEntry.ifDescr.2 = FastEthernet1/2
interfaces.ifTable.ifEntry.ifDescr.3 = FastEthernet1/3
interfaces.ifTable.ifEntry.ifDescr.4 = FastEthernet1/4
interfaces.ifTable.ifEntry.ifDescr.5 = VLAN1
interfaces.ifTable.ifEntry.ifDescr.6 = FastEthernet0/1
interfaces.ifTable.ifEntry.ifDescr.7 = FastEthernet0/2
interfaces.ifTable.ifEntry.ifDescr.8 = FastEthernet0/3
interfaces.ifTable.ifEntry.ifDescr.9 = FastEthernet0/4
interfaces.ifTable.ifEntry.ifDescr.10 = FastEthernet0/5
interfaces.ifTable.ifEntry.ifDescr.11 = FastEthernet0/6
interfaces.ifTable.ifEntry.ifDescr.12 = FastEthernet0/7
interfaces.ifTable.ifEntry.ifDescr.13 = FastEthernet0/8
interfaces.ifTable.ifEntry.ifDescr.14 = FastEthernet0/9
interfaces.ifTable.ifEntry.ifDescr.15 = FastEthernet0/10
interfaces.ifTable.ifEntry.ifDescr.16 = FastEthernet0/11
interfaces.ifTable.ifEntry.ifDescr.17 = FastEthernet0/12
interfaces.ifTable.ifEntry.ifDescr.18 = FastEthernet0/13
interfaces.ifTable.ifEntry.ifDescr.19 = FastEthernet0/14
interfaces.ifTable.ifEntry.ifDescr.20 = FastEthernet0/15
interfaces.ifTable.ifEntry.ifDescr.21 = FastEthernet0/16
Grab the Number ie in this one 1-21 and put it on the end of this next walk
This one is for interface 5
snmpwalk 10.10.10.13 ccie
ip.ipNetToMediaTable.ipNetToMediaEntry.ipNetToMediaPhysAddress.5
ip.ipNetToMediaTable.ipNetToMediaEntry.ipNetToMediaPhysAddress.5.10.10.10.13
= 0:90:ab:ec:da:40
ip.ipNetToMediaTable.ipNetToMediaEntry.ipNetToMediaPhysAddress.5.10.10.10.10
0 = 0:2:2a:be:da:21
The grab the description line for the interface to make it look all purdy
snmpwalk 10.10.10.13 ccie enterprises.9.2.2.1.1.28.10
enterprises.9.2.2.1.1.28.10 = "Tivo"
----------------------------------------
Neil Moore CCIE#10044
----- Original Message -----
From: "Weidong Xiao" <Weidong.Xiao@vi.net>
To: "Neil Moore" <neil@droopy.com>; <ccielab@groupstudy.com>
Sent: Thursday, December 19, 2002 12:27 PM
Subject: RE: SNMP query
> Neil,
>
> Thanks very much for your reply.
>
> I didn't quite understand why you grep '10.10.10.100'. Does it has
something to do with transmission(10)in the MIB tree?
>
> I'd like to poll mac addresses from a switch, then consult router arp
table to decide the ip address off each switch port. Here is what I did:
>
> (Linux)snmpwalk HOSTNAME STRING@VLAN# 17.5.1.1.1.1.0
> 17.5.1.1.1.0.2.179.25.236.92.1 = OCTET STRING: Hex: 00 02 B3 19 EC 5C
> 17.5.1.1.1.0.2.179.25.239.162.1 = OCTET STRING: Hex: 00 02 B3 19 EF A2
> ......
> On the switch,
> Switch#sh mac | e 0/4[7|8]$
> Destination Address Address Type VLAN Destination Port
> ------------------- ------------ ---- --------------------
> 0002.b319.ec5c Secure 105 FastEthernet0/38
> 0002.b319.efa2 Secure 105 FastEthernet0/12
> ......
>
> If I could correlate "17.5.1.1.1.0.2.179.25.236.92.1" to
"FastEthernet0/38", then I can easily write a script to do what I want on
tens of switches. Spent the whole afternoon, still haven't got a clue.
>
> Can you help?
>
> Cheers,
> Weidong
>
> > -----Original Message-----
> > From: Neil Moore [mailto:neil@droopy.com]
> > Sent: 19 December 2002 14:48
> > To: Weidong Xiao; ccielab@groupstudy.com
> > Subject: Re: SNMP query
> >
> >
> > Here is my snmpwalk
> > %ping 10.10.10.5
> > %snmpwalk 10.10.10.5 ccie|grep 10.10.10.100
> > at.atTable.atEntry.atIfIndex.1.1.10.10.10.100 = 1
> > at.atTable.atEntry.atPhysAddress.1.1.10.10.10.100 = Hex: 00
> > 02 2A BE DA 21
> > at.atTable.atEntry.atNetAddress.1.1.10.10.10.100 = Network Address:
> > 0A:0A:0A:64
> > ip.ipNetToMediaTable.ipNetToMediaEntry.ipNetToMediaIfIndex.1.1
> > 0.10.10.100 =
> > 1
> > ip.ipNetToMediaTable.ipNetToMediaEntry.ipNetToMediaPhysAddress
> > .1.10.10.10.10
> > 0 = 0:2:2a:be:da:21
> > ip.ipNetToMediaTable.ipNetToMediaEntry.ipNetToMediaNetAddress.
> > 1.10.10.10.100
> > = IpAddress: 10.10.10.100
> > ip.ipNetToMediaTable.ipNetToMediaEntry.ipNetToMediaType.1.10.1
> > 0.10.100 =
> > dynamic(3)
> >
> > My mac address is 0:2:2a:be:da:21
> >
> > Try a similar snmpwalk with a grep of a machine you know is
> > in the table to
> > find the mib location.
> >
> > Hope that helps
> > ----------------------------------------
> > Neil Moore CCIE#10044
> > ----- Original Message -----
> > From: "Weidong Xiao" <Weidong.Xiao@vi.net>
> > To: <ccielab@groupstudy.com>
> > Sent: Thursday, December 19, 2002 7:20 AM
> > Subject: OT: SNMP query
> >
> >
> > > Hello group,
> > >
> > > How to get the "sh mac" results from a switch? What is the
> > variable-name
> > for those mac addresses?
> > >
> > > I used "snmpwalk <machine> <community-string>" on a Linux
> > host and got the
> > whole stuff from a switch, but couldn't find anything
> > relating to "sh mac"
> > results on the switch. Is it feasible to get the those mac
> > addresses via
> > SNMP?
> > >
> > > Thanks,
> > >
> > > Weidong
> > > .
.
This archive was generated by hypermail 2.1.4 : Fri Jan 17 2003 - 17:21:49 GMT-3