How do I get the MAC address of a particular machine?

How do I get the MAC address of a particular machine?

Date Entered: 09/26/2007    Last Updated: 09/26/2007

One way is to use the IPInfo component's GetMAC method:
string macaddress = ipinfo.GetMAC("10.0.1.1");
Another way is to use SNMP. To do this, first send a get request for the number of interfaces on the device (ifEntryNum - 1.3.6.1.2.1.2.1). Then for each interface, send a get request for its MAC address (ifPhysAddress - 1.3.6.1.2.1.2.2.1.6). You can also determine a lot of other information about the interface (the ifEntry table has several children) including the type of the device (ifEntryType - 1.3.6.1.2.1.2.2.1.3).

We appreciate your feedback.  If you have any questions, comments, or suggestions about this entry please contact our support team at kb@nsoftware.com.