How to find the MAC address on a Linux machine
I have installed a CentOS 8 Linux on a virtualbox.
I have requested a company to provide me a license for their software.
They asked me for my MAC address to create that license for me.
How can I find my MAC address?
For ethernet
It depends on what device's MAC address are you looking.
In the console type
ifconfig
or
netstat -ie
it will show you an output like this
Kernel Interface table
enp5s0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
ether f0:5e:41:8b:76:ac txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device memory 0xfc200000-fc2fffff
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 8373 bytes 734084 (734.0 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 8373 bytes 734084 (734.0 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
wlp4s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.121 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe20::2e5c:1ca0:132f:dec6 prefixlen 64 scopeid 0x20<link>
ether 85:1b:47:28:6c:7d txqueuelen 1000 (Ethernet)
RX packets 135050 bytes 170217922 (170.2 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 35092 bytes 6367349 (6.3 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
For each interface, check the MAC address in front of the word ether
.
The MAC address is made of 12-digit hexadecimal code (48-bits) in the form of MM:MM:MM:SS:SS:SS
.
You can alternatively look for
cat /sys/class/net/wlp4s0/address cat /sys/class/net/enp5s0/address
These commands give you the MAC address without any extra information
For Bluetooth
For Bluetooth however, use the command
hciconfig
The MAC address is the hexa-decimal number in front of BD Address
.
Finding MAC address by GUI
On Ubuntu, if you have access to the GUI, go to the settings, then network or wireless, click on the gear button. Under "details" tab look for "Hardware address".