{"id":1380,"date":"2012-11-11T13:59:43","date_gmt":"2012-11-11T18:59:43","guid":{"rendered":"http:\/\/www.microdevsys.com\/WordPress\/?p=1380"},"modified":"2012-11-11T14:06:35","modified_gmt":"2012-11-11T19:06:35","slug":"how-to-find-the-mac-address-of-an-ethernet-or-wireless-card","status":"publish","type":"post","link":"https:\/\/microdevsys.com\/wp\/how-to-find-the-mac-address-of-an-ethernet-or-wireless-card\/","title":{"rendered":"How to find the MAC address of an ethernet or wireless card."},"content":{"rendered":"<p>To find the MAC address of an ethernet or wireless card is generally straight forward for straight forward configurations.&nbsp; The MAC address is a unique identifier for every NIC (Network Interface Card) that uniquely identifies that card amongst all others.<\/p>\n<p>There&#39;s several commands that can be used for this depending on your network configuration and setup.&nbsp; The basic command to use for this is <strong>ifconfig <\/strong>(Equivalent of<strong> netstat -ie<\/strong>):<\/p>\n<p style=\"margin-left: 40px;\"><span style=\"font-family:courier new,courier,monospace;\"># ifconfig eth0<br \/>\n\teth0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Link encap:Ethernet&nbsp; HWaddr <span style=\"color:#008000;\"><strong>1C:6F:65:3F:FC:14<\/strong><\/span>&nbsp; <br \/>\n\t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; UP BROADCAST RUNNING SLAVE MULTICAST&nbsp; MTU:1500&nbsp; Metric:1<br \/>\n\t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RX packets:339061 errors:0 dropped:0 overruns:0 frame:0<br \/>\n\t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TX packets:183764 errors:0 dropped:0 overruns:0 carrier:0<br \/>\n\t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; collisions:0 txqueuelen:1000 <br \/>\n\t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RX bytes:82692563 (78.8 MiB)&nbsp; TX bytes:121295829 (115.6 MiB)<br \/>\n\t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Interrupt:32 Base address:0x4000 <\/p>\n<p>\t<\/span><\/p>\n<p>However once the network configuration becomes a bit more complex, this just won&#39;t do:<\/p>\n<p><!--more-->For example, in a bonding configuration, <strong>ifconfig<\/strong> will list the same MAC address for all the cards:<\/p>\n<p style=\"margin-left: 40px;\"><span style=\"font-family:courier new,courier,monospace;\"><strong># ifconfig<\/strong><\/span><\/p>\n<p style=\"margin-left: 40px;\"><span style=\"font-family:courier new,courier,monospace;\">bond0&nbsp;&nbsp;&nbsp;&nbsp; Link encap:Ethernet&nbsp; HWaddr 1C:6F:65:3F:FC:14&nbsp; <br \/>\n\t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; inet addr:192.168.7.10&nbsp; Bcast:192.168.1.255&nbsp; Mask:255.255.254.0<br \/>\n\t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; inet6 addr: fe80::1e6f:65ff:fe3f:fc14\/64 Scope:Link<br \/>\n\t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; UP BROADCAST RUNNING MASTER MULTICAST&nbsp; MTU:1500&nbsp; Metric:1<br \/>\n\t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RX packets:345632 errors:0 dropped:0 overruns:0 frame:0<br \/>\n\t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TX packets:186780 errors:0 dropped:0 overruns:0 carrier:0<br \/>\n\t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; collisions:0 txqueuelen:0 <br \/>\n\t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RX bytes:85617681 (81.6 MiB)&nbsp; TX bytes:122381805 (116.7 MiB)<br \/>\n\t<\/span><\/p>\n<p style=\"margin-left: 40px;\"><span style=\"font-family:courier new,courier,monospace;\">eth0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Link encap:Ethernet&nbsp; HWaddr 1C:6F:65:3F:FC:14&nbsp; <br \/>\n\t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; UP BROADCAST RUNNING SLAVE MULTICAST&nbsp; MTU:1500&nbsp; Metric:1<br \/>\n\t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RX packets:345632 errors:0 dropped:0 overruns:0 frame:0<br \/>\n\t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TX packets:186780 errors:0 dropped:0 overruns:0 carrier:0<br \/>\n\t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; collisions:0 txqueuelen:1000 <br \/>\n\t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RX bytes:85617681 (81.6 MiB)&nbsp; TX bytes:122381805 (116.7 MiB)<br \/>\n\t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Interrupt:32 Base address:0x4000 <\/span><\/p>\n<p style=\"margin-left: 40px;\"><span style=\"font-family:courier new,courier,monospace;\">eth1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Link encap:Ethernet&nbsp; HWaddr 1C:6F:65:3F:FC:14&nbsp; <br \/>\n\t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; UP BROADCAST SLAVE MULTICAST&nbsp; MTU:1500&nbsp; Metric:1<br \/>\n\t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RX packets:0 errors:0 dropped:0 overruns:0 frame:0<br \/>\n\t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TX packets:0 errors:0 dropped:0 overruns:0 carrier:0<br \/>\n\t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; collisions:0 txqueuelen:1000 <br \/>\n\t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RX bytes:0 (0.0 b)&nbsp; TX bytes:0 (0.0 b)<\/p>\n<p>\t<\/span><\/p>\n<p>Unfortunately, even with udevadm the addresses come back looking the same:<\/p>\n<p style=\"margin-left: 40px;\"><span style=\"font-family:courier new,courier,monospace;\"><strong># udevadm info -a -p \/sys\/class\/net\/eth0|grep address<\/strong><br \/>\n\t&nbsp;&nbsp;&nbsp; ATTR{address}==&quot;1c:6f:65:3f:fc:14&quot;<br \/>\n\t<strong># udevadm info -a -p \/sys\/class\/net\/eth1|grep address<\/strong><br \/>\n\t&nbsp;&nbsp;&nbsp; ATTR{address}==&quot;1c:6f:65:3f:fc:14&quot;<br \/>\n\t<strong># udevadm info -a -p \/sys\/class\/net\/wlan0|grep address<\/strong><br \/>\n\t&nbsp;&nbsp;&nbsp; ATTR{address}==&quot;00:25:86:f1:65:d0&quot;<br \/>\n\t<strong># udevadm info -a -p \/sys\/class\/net\/bond0|grep address<\/strong><br \/>\n\t&nbsp;&nbsp;&nbsp; ATTR{address}==&quot;1c:6f:65:3f:fc:14&quot;<br \/>\n\t<\/span><\/p>\n<p>An alternate command is:<\/p>\n<p style=\"margin-left: 40px;\"><strong><span style=\"font-family:courier new,courier,monospace;\"># udevadm info &#8211;attribute-walk &#8211;path \/sys\/class\/net\/eth0<br \/>\n\t<\/span><\/strong><\/p>\n<p>And after a bonding configuration, <strong>wlan0<\/strong> will show the MAC of <strong>bond0<\/strong>.&nbsp; In cases like this, we can use the <strong>bond0<\/strong> interface to get the real <strong>MAC<\/strong> address for the device:<\/p>\n<p style=\"margin-left: 40px;\"><span style=\"font-family:courier new,courier,monospace;\"><strong># cat \/proc\/net\/bonding\/bond0<\/strong><br \/>\n\tEthernet Channel Bonding Driver: v3.6.0 (September 26, 2009)<\/span><\/p>\n<p style=\"margin-left: 40px;\"><span style=\"font-family:courier new,courier,monospace;\">Bonding Mode: load balancing (round-robin)<br \/>\n\tMII Status: up<br \/>\n\tMII Polling Interval (ms): 100<br \/>\n\tUp Delay (ms): 0<br \/>\n\tDown Delay (ms): 0<\/span><\/p>\n<p style=\"margin-left: 40px;\"><span style=\"font-family:courier new,courier,monospace;\">Slave Interface: <strong>eth0<\/strong><br \/>\n\tMII Status: up<br \/>\n\tSpeed: 1000 Mbps<br \/>\n\tDuplex: full<br \/>\n\tLink Failure Count: 0<br \/>\n\tPermanent HW addr: <span style=\"color: rgb(0, 128, 0);\"><strong>1c:6f:65:3f:fc:14<\/strong><\/span><br \/>\n\tSlave queue ID: 0<\/span><\/p>\n<p style=\"margin-left: 40px;\"><span style=\"font-family:courier new,courier,monospace;\">Slave Interface: <strong>eth1<\/strong><br \/>\n\tMII Status: down<br \/>\n\tSpeed: Unknown<br \/>\n\tDuplex: Unknown<br \/>\n\tLink Failure Count: 0<br \/>\n\tPermanent HW addr: <span style=\"color: rgb(0, 128, 0);\"><strong>90:e2:ba:1a:08:28<\/strong><\/span><br \/>\n\tSlave queue ID: 0<br \/>\n\t# <br \/>\n\t<\/span><\/p>\n<p>Any active devices in a bonding configuration will show the MAC of the primary device but using the above command will display the real \/ permanent MAC address of the participating NIC&#39;s.<\/p>\n<p><span style=\"font-family:courier new,courier,monospace;\">Cheers,<br \/>\n\tTK<br \/>\n\t<\/span><\/p>\n\n    <div class=\"xs_social_share_widget xs_share_url after_content \t\tmain_content  wslu-style-1 wslu-share-box-shaped wslu-fill-colored wslu-none wslu-share-horizontal wslu-theme-font-no wslu-main_content\">\n\n\t\t\n        <ul>\n\t\t\t        <\/ul>\n    <\/div> \n","protected":false},"excerpt":{"rendered":"<p>To find the MAC address of an ethernet or wireless card is generally straight forward for straight forward configurations.&nbsp; The MAC address is a unique identifier for every NIC (Network Interface Card) that uniquely identifies that card amongst all others. There&#39;s several commands that can be used for this depending on your network configuration and [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"footnotes":""},"categories":[3],"tags":[330,1417,1418,1416,534,437,340,734],"class_list":["post-1380","post","type-post","status-publish","format-standard","hentry","category-unix-linux-admin-stuff","tag-address","tag-cardk","tag-discover","tag-ethernet-or-wireless","tag-find","tag-how","tag-mac","tag-nic"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/microdevsys.com\/wp\/wp-json\/wp\/v2\/posts\/1380","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/microdevsys.com\/wp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/microdevsys.com\/wp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/microdevsys.com\/wp\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/microdevsys.com\/wp\/wp-json\/wp\/v2\/comments?post=1380"}],"version-history":[{"count":0,"href":"https:\/\/microdevsys.com\/wp\/wp-json\/wp\/v2\/posts\/1380\/revisions"}],"wp:attachment":[{"href":"https:\/\/microdevsys.com\/wp\/wp-json\/wp\/v2\/media?parent=1380"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/microdevsys.com\/wp\/wp-json\/wp\/v2\/categories?post=1380"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/microdevsys.com\/wp\/wp-json\/wp\/v2\/tags?post=1380"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}