Every network interface, on any device, has its own MAC address. Unlike IP addresses, which can change frequently and easily, MAC addresses are permanently tied to the hardware. Although you can spoof your MAC address with software, the real MAC address of your network interface will never change.
The MAC address identifies your device on the network. One common way they are used is for routers to hand out reserved IP addresses to a specific MAC address. To perform this configuration, you will first need to obtain your MAC address.
In this tutorial, you will learn how to obtain the MAC address on a Linux system via both command line and GUI. This will show you the MAC address for all network interfaces you have installed – for example, your Ethernet interface as well as your Wi-Fi network card.
In this tutorial you will learn:
- How to obtain MAC address via command line
- How to obtain MAC address via GUI
|Category||Requirements, Conventions or Software Version Used|
|System||Any Linux distro|
|Other||Privileged access to your Linux system as root or via the
# – requires given linux commands to be executed with root privileges either directly as a root user or by use of
$ – requires given linux commands to be executed as a regular non-privileged user
MAC stands for Media Access Control. The addresses are represented as six groups of two hexadecimal digits, and usually separated by colons. An example of a MAC address (sometimes called hardware address) looks like this:
08:00:27:ea:82:f9. Nearly all network interfaces use one, including Ethernet, Wi-Fi, and Bluetooth. Even virtual machine interfaces have one.
How to obtain MAC address in Linux step by step instructions
You will find the command line and GUI methods for obtaining your MAC address below. We recommend using the command line method, as it is universal across all Linux systems and should work regardless of which Linux distribution you are on.
Obtain MAC address via command line
- Start by opening a command line terminal and using the following
ipcommand to view information for all installed network interfaces.
$ ip a
- In the screenshot below, we have highlighted our MAC address for the
enp0s3interface. You should see yours listed, along with the MAC address for other installed network interfaces.
Obtain MAC address via GUI
The following instructions will vary depending on which desktop environment you are using. However, all desktop environments will provide a way for the user to obtain their MAC address. In the following screenshots, we are using the GNOME desktop environment. Adapt these instructions as needed for your own system.
- Open up your system’s network settings menu. On GNOME, we can access it by clicking the upper right corner and clicking on
Wi-Fi Settingsin the case of a Wi-Fi interface.
- Open the settings panel for the network interface that you wish to obtain the MAC address of. In the case of GNOME, that is done by clicking on the corresponding cog wheel.
- Our MAC address can now be seen under the label of
In this tutorial, you saw how to obtain the MAC address of a network interface on a Linux system. This can be accomplished via either command line or GUI, with the command line option being more universal across all Linux distros. Now that you have your MAC address, you can use it to whitelist your device with a router or firewall, allocate a static IP address via DHCP, etc.