Switch – Determine what MAC addresses are connected to a given port on a Netgear GS724T via SNMP

hardwaresnmpswitch

In looking through the output of an snmpwalk against our GS724T Netgear switch I was surprised that it doesn't list what MAC address(es) are connected and/or using a given port on the switch. This would seem to be useful information. Is this just a limitation of the GS724T? I see it's labeled as a "Smart Switch" which would seem to indicate that it's subpar to a fully managed switch, yet something as basic as collecting the MACs would seem like something that should be included, even in a lower level switch such as this.

When I run the the following command I only am getting back the MAC address of the switch on each port.

$ snmpwalk -v2c -c public switch01 mib-2.interfaces
IF-MIB::ifPhysAddress.1 = STRING: 84:1b:5e:6f:65:21
IF-MIB::ifPhysAddress.2 = STRING: 84:1b:5e:6f:65:21
IF-MIB::ifPhysAddress.3 = STRING: 84:1b:5e:6f:65:21
IF-MIB::ifPhysAddress.4 = STRING: 84:1b:5e:6f:65:21
IF-MIB::ifPhysAddress.5 = STRING: 84:1b:5e:6f:65:21
IF-MIB::ifPhysAddress.6 = STRING: 84:1b:5e:6f:65:21
IF-MIB::ifPhysAddress.7 = STRING: 84:1b:5e:6f:65:21
IF-MIB::ifPhysAddress.8 = STRING: 84:1b:5e:6f:65:21
IF-MIB::ifPhysAddress.9 = STRING: 84:1b:5e:6f:65:21
...

Am I missing something basic here?

Best Answer

I have a GS716T "Smart Switch" and was never able to get this to work. What I ended up doing was using a Python script to send a web request, login, and go to the web page that lists this information. Then I scraped it and stored it as needed. I don't use that switch anymore.

I know it's a slightly different model, but same product family.


Here is the relevant code. I no longer use it so YMMV.

import urllib, urllib2
import cookielib
from BeautifulSoup import BeautifulSoup

def getMACTable():
   password = 'password'
   base_url = 'http://1.2.3.4/base'

   cookies = cookielib.CookieJar()
   opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cookies))
   login_data = urllib.urlencode({'pwd' : password})
   opener.open(base_url + '/main_login.html', login_data)
   resp = opener.open(base_url + '/base/system/fwd_db.html')

   result = resp.read()
   soup = BeautifulSoup(result)
   tbl1 = soup.find('table', id='tbl1')

   return tbl1