MAC Address short of Media Access Control Address is a hardware address that unique for each Network Interface Card, Actually not only NIC, some Switch and routers also have it’s own MAC Address. MAC Address is network address implemented at data-link layer (in OSI Model). MAC Address also known as Ethernet Address, Physical Address or Hardware Address. So, How could we know MAC address of a Network Interface Card (NIC) in Linux? We can simply use ifconfig, yup you’re right it’s the same ifconfig that we use to configure IP Address for a NIC.
For example, if you want to see device information for eth0, you will use command ifconfig eth0
[sumodirjo@kiara ~]$ ifconfig eth0
eth0 Link encap:Ethernet HWaddr 00:26:18:00:00:00
inet addr:192.168.19.1 Bcast:192.168.19.255 Mask:255.255.255.0
inet6 addr: fe80::226:18ff:fe41:1c14/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:132359545 errors:0 dropped:0 overruns:0 frame:0
TX packets:116155333 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:995370139 (949.2 MiB) TX bytes:909399988 (867.2 MiB)
Interrupt:233
On the output above the entr that hold MAC Address is HWaddr on the first line. If there are many ethernet card and you want to show only MAC address for each card, you can use ifconfig with grep, for example
[sumodirjo@kiara ~]$ ifconfig | grep HWaddr eth0 Link encap:Ethernet HWaddr 00:26:18:00:00:00 eth0:1 Link encap:Ethernet HWaddr 00:26:18:00:00:00 eth2 Link encap:Ethernet HWaddr 00:10:4B:00:00:00
Alternatively, as root user, you can see MAC address of a network card using dmesg
[root@kiara ~]# dmesg | grep eth
eth0: RTL8168c/8111c at 0xf8920000, 00:26:18:00:00:00, XID 3c4000c0 IRQ 233
eth2: Macronix 98715 PMAC rev 37 at f895a800, 00:10:B5:00:00:00, IRQ 169.
Additional Info, if you are using FreeBSD, you can search for ether column which contain MAC Address info.



