RB260GS - get mac address

Hello,

It is possible to get list mac address from the switch automatically?
From the web page is working.

I try with snmp with no luck. The snmp server do not return list of mac address.

I need the list of mac addresses from a php script.

Thanks.

It is not possible. Currently, SwOS does not provide host table information with SNMP.

If you are using php and have access to the switch remotely, the mac address table (sort of) is available at:

http://<switch url>/!dhost.b

I use curl to retrieve it.
The response is pseudo json,

[{adr:'<mac>',prt:0x04,drp:0x00,mir:0x00},{adr:'<mac>',prt:0x04,drp:0x00,mir:0x00},{...},{...}...]

adr: mac address
prt: port
drp: drop
mir: mirror

No vlan information: :confused:
The hex fields for port, drop and mirror are not legal json data (they need quotes), so you can’t use a json library to manipulate the response without doing some preg_replaces, but that’s fairly easy to do.

I hope this helps.

Edit: I just realized you asked about RB260 and I’ve never used the 260. This works on the 250 v1.6. Newer versions might be different.

I found that:
0x01 first port
0x02 second port
0x04 third port
0x08 fouth port
0x10 fifth port
0x20 SFP port