Wednesday, January 22, 2020

Snmpwalk and Link Aggregation Groups

Hi!

In my company we have a PowerShell script to find in which switch port a specific IP address is connected to. It is something like this:

Import-Module Proxx.SNMP $SwitchesIPs = ("192.168.40.1","192.168.40.2","192.168.40.3","192.168.40.4") $MAC = "48 4D 7E FE 17 EE" foreach ($IP in $SwitchesIPs) { $OID = (Invoke-SnmpWalk -IP $IP -OID .1.3.6.1.2.1.17.4.3.1.1 -Community public | Where-Object { $_.Value -eq $MAC }) $OID = $OID.OID.Remove(0, 23) $SwitchPort = (Invoke-SnmpWalk -IP $IP -OID .1.3.6.1.2.1.17.4.3.1.2 -Community public | Where-Object { $_.OID -match $OID }).Value } 

Since the person in charge of the switches configured a LAG on them, all we can find using that script is the port of that LAG.

Does anyone knows a way to find again that information even with LAG configured?



No comments:

Post a Comment