![]() The only way to find the original MAC address is to use the same method the network card driver does - unfortunately, I don't believe there is a generic way to tell the driver to provide its MAC address "as provided by the hardware". Memcpy(mac, ifr.ifr_hwaddr.sa_data, IFHWADDRLEN) #include /* for the glibc version number */ I suppose it should be possible to write C code for it, below code gives my current MAC but not the original MAC: #include /* Standard I/O */ ![]() Is there any utility or command for that? How do I find the original MAC address? There must be a way to find it, because it is still burned permanently into the card, but I can't find a tool to read the burned in address. Or setting it "permanently" using /etc/sysconfig/network-scripts/ifcfg-eth0. I understand how to find the current MAC address using ifconfig.īut the address can be changed, say by using ifconfig eth0 hw ether uu:vv:ww:yy:xx:zz I'm trying to figure out how to find the original MAC address of an Ethernet NIC on my Linux box. Well, you're out of luck unless you can have the client volunteer that information and transmit via other means.Is it possible to read the MAC address from the NIC directly? I have the code below but it just reads from the layer above but not the card itself. #look for the output line describing our IP address #run the external command, break output into lines So, if you are building some kind of LAN based system and your clients are on the same ethernet segment, then you could get the MAC address by parsing the output of arp -n (linux) or arp -a (windows).Įdit: you ask in comments how to get the output of an external command - one way is to use backticks, e.g. ![]() The client MAC address will not be available to you except in one special circumstance: if the client is on the same ethernet segment as the server. You can get the client IP from $_SERVER Client MAC address Server MAC addressįor the MAC address, you could parse the output of netstat -ie in Linux, or ipconfig /all in Windows. You can get the server IP address from $_SERVER. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |