qosaapt.blogg.se

Linux get mac address script
Linux get mac address script












To translate that into a normal interface name, you have to map that to an ifName.

linux get mac address script

In the output above, 52 is the value of dot1dBasePort, which is a number the MIB uses to index the dot1dTp table.

linux get mac address script

In my example below, the switch at 172.16.1.210 is configured with snmp-server community public ro, and I'm polling the mac-address table in vlan-10 with dot1dTpFdbPort from BRIDGE-MIB. each vlan you poll needs a different community. If you really want the mac-address table from the switch, then remember you have to change the community string you poll with. I wish polling with SNMP wasn't as complicated. I apologize in advance for the length of this answer. you just need to remove the -m option in the commands if you don't have the MIBs loaded locally. Some of my examples assume you have the MIBs loaded on your server. please let me know if you need pointers for doing this (see this question for hints about loading MIBs in linux). I am assuming you know how to login to your Ubuntu server, and that NET-SNMP is installed. 1.3.6.1.2.1.17.4.3.1.2 however, that OID actually is for the mac-address table in the switch. you are asking about ARP tables, and you're using OID.














Linux get mac address script