Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm new to network programming and I don't know if this is the right place where to ask.

I have a small router with a proprietary control panel (= no openwrt or similar). I'd like to know programmatically what are the MAC addresses connected to the router.

Is it possible?

share|improve this question
    
I remember some routers export this information via SNMP. – grawity Jun 16 '14 at 9:34
1  
Use nmap and scan your local subnet. Or maybe all private subnets. Since you don’t have to operate stealthily, a full-speed scan is possible. If you already have the IP addresses, just arp them. – Daniel B Jun 16 '14 at 9:40
1  
@DanielB ARP would do it but if arp doesn't have the IPs, then i'd be surprised if nmap can scan his local subnet. OTOH I suppose nmap could help trigger an ARP request. But in that case, pinging every ip on a subnet would also be effective at filling the arp table – barlop Jun 16 '14 at 10:39
    
nmap has built-in optimizations for host discovery, including so-called ARP Pinging (-RP). In this case, nmap itself generates ARP requests and collects responses. It’s much faster than letting the OS handle it. – Daniel B Jun 16 '14 at 11:56

As @grawity said check if in the config there is SNMP settings.

The other option would be to use something like http://casperjs.org/ to scrap the arp table it lists.

Or run a sniffer and watch for ARP requests with the IP of the router.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .