Raisecom get vlan macs by snmp

mac addresssnmpvlan

I'm, trying to get mac addresses from switches in a network. For that i'm using snmp calls with these oids: (like in this manual) .1.3.6.1.2.1.17.4.3.1.1, .1.3.6.1.2.1.17.4.3.1.2. But i have a problem with Raisecom ISCOM device: it seems not to support this oids.

Another problem is that Raisecom doesn't answer for snmp -c community@vlan... prompt – only without vlan.

So, my question is: how can i get this mac addresses and how to manage with vlans?

Best Answer

try this small bash script to get mac - port - vlan $1 - is community $2 - is ip address/hostname

#!/bin/bash
snmpwalk -Cc  -Onq -v 2c -c $1 $2 .1.3.6.1.2.1.17.7.1.2.2.1.2 |(
 while read line ; do 
echo $line | awk '{print $1}' | awk -F. '{printf("%02x%02x%02x%02x%02x%02x\t",$16,$17,$18,$19,$20,$21)}'
echo $line | awk '{printf("%u\t",$2)}' 
echo $line | awk '{print $1}' | awk -F. '{print $15}'
done)
exit 0