How to see mac address in linux

How to Find MAC Address on Linux

If you need to find MAC address numbers for any network interface attached to your computer, then Linux makes this quite easy. Each computer network interface receives a unique Media Access Control (MAC) address, which explains what device it belongs to. No two MAC addresses are alike. Users with multiple networking interfaces will end up with more than one address to take a look at.

You’ll need to be working on a command line interface to find MAC address information, but you won’t need to be logged in as root. Graphical desktop environment users can usually hold down Ctrl+Alt+T to open up a terminal. Ubuntu Unity users can search for the word terminal on the Dash. Those using Xfce4 can find it on the Whisker Menu in System Tools, and LXDE, KDE and GNOME Shell users should find it on the menu in the same place. You can work from whatever prompt you’re given.

Method 1: Find MAC Address Numbers with ip link

At the prompt, simply type ip link and push enter. You’ll be given a list of MAC address figures and you simply need to look for the name that GNU/Linux gives to your network adapter. For instance, you might see wls1:, which probably indicates a Wi-Fi connection that you’re working with. A reference to link/ether would point to your Ethernet connection. You’ll quite possibly see more than one of these references if you’re on a beefier modern desktop computer or a laptop that you’ve personally upgraded.

You’ll also find link/loopback more than likely, which will consist of all zeros. This just points back to your own host. For security reasons, our screenshots were taken in a virtual machine, so we only had this adapter. You don’t want to share your MAC address with people!

There really isn’t anything to do, though. This one single command is enough to find the answer to your question without any further playing around.

Method 2: Find MAC Address with the ifconfig Command

Like with almost everything on the Linux command line, there is more than one way to find MAC address data. At the prompt, type ifconfig -a | grep HWaddr and then push enter. If this command is long and you’d like to copy it from this article, then remember that you’ll need to paste from the Edit menu in your terminal window. You might instead want to hold down Shift+Ctrl+V, but the normal Ctrl+V keyboard shortcut won’t work.

Once again, you won’t have to be root to run this command. As soon as you’ve run it, you’ll receive the MAC hardware address for each networking device attached to the system. You might have only a few on a laptop, while connected routers could ultimately list dozens of different connections if they’re sending packets in many different places.

Читайте также:  Linux os with all drivers

There’s nothing else to do; you can find MAC address data with a single command. If you don’t see anything returned, then you’re probably not connected to a network. You’ll want to check to make sure that you didn’t disable networking, loose a Wi-Fi connection by moving around or unplug an Ethernet cord. You’ll probably also want to make sure you didn’t run the command in an unconnected virtual machine without a network like we did for the purposes of demonstration.

Источник

How to Look Up MAC Addresses

The MAC address, also known as Media Access Control address, is a unique and separate hardware number of a particular computer, especially in a LAN (Local area network) or in other networks. When you are connected to the Internet as a host or your computer is connected to the Internet, the IP address of your computer is linked to the physical MAC address of the computer on a LAN. The MAC address is the same as the Ethernet address on the Ethernet LAN. In telecommunication protocols, the media access control, which is the sublayer of the data-link layer, uses the MAC address. For each type of device, there is a different MAC sublayer. In the DLC layer, the other sublayer is a logical link control sublayer.

Next, we will show you how to find the IP and MAC addresses of a device with the help of the command-line in Linux.

Finding IP and MAC Address Using the Command-Line

With the help of the IP command, you can find both the IP and MAC address of your network connection. Here, we will discuss the networking command IP in Linux. The network parameters of Linux are useful to withdraw by using this command. This command will work on different Linux systems, such as Kali Linux, Arch Linux, Fedora, Ubuntu, etc.

The IP command

The IP command replaces the ifconfig command, which is part of the net-tools package. The IP command is very strong and powerful. The syntax of the IP command is written as follows:

In the above command, the xx will be replaced by the following two to obtain the preferred result. These operators include:
-s, which is used to show more information related to the command
-V, which is used to show the ip utility version

To check IP address in Kali Linux, enter the ifconfig command, as shown below:

Finding the IP Address of a Linux System

To list each of the IP addresses of a system, write the following command in the terminal:

This command will display all the IP addresses with their device names that are currently available. If someone does not like the default IP address connected to the internet, then they can use a grep parameter. The parameter can be written as shown below:

Another option is to use the device name, but in this case, it is essential to use the names of the particular network devices. To do this, enter the following command:

Here, you will see that the Ethernet connection is eth0, while wlp2s0 represents the wireless connection. We will use the eth0 in this example:

Finding the MAC Address of a Linux System

Any network device has a critical parameter, such as a MAC address, that will also include the hardware of the computer or a server. There is a unique MAC address for each device on the network that is connected to the computer.

Читайте также:  Проверка секторов hdd linux

Enter the ip link command into the terminal, as shown below:

The ip link utility lists several parameters for a device. There are two lines for each of the devices for the link-state and their properties. The first line will show the current state of the particular device, the maximum transmission unit, a set of flags on the device, etc. Similarly, the second line will indicate the current MAC address or the type of link layer currently in use. The previous example found the MAC addresses of the two LAN connections currently in use.

Conclusion

This tutorial showed you how to look up MAC addresses in Linux. The commands in this article work with many distros, including Kali, Arch, and Ubuntu Linux machines.

About the author

Younis Said

I am a freelancing software project developer, a software engineering graduate and a content writer. I love working with Linux and open-source software.

Источник

How to Find Your MAC address in Ubuntu and Other Linux Distros

When you are learning networking or troubleshooting it, you would need to know the MAC address.

A computer can have more than one MAC address. It is because the MAC address is a core part of networking, and each networking peripheral device has its own MAC address.

So, your WiFi card has a MAC address, and so does the Ethernet (LAN) port. Even the Bluetooth has one.

The MAC address, also known as the physical address, is a 12-digit hexadecimal code (48-bits) and is represented as MM:MM:MM:SS:SS:SS

In this tutorial, I’ll share the steps for finding the MAC address of your desired networking interface in Linux. I’ll show both command line and GUI methods.

Method 1: Find MAC address using command line

There are serveral Linux networking commands that can be used to get the MAC address of the WiFi or LAN cards.

Open up your terminal and use the following command, and it will bring the address of the present network cards in your system:

And you’ll be met with the following output:

use ip link command to show mac address

Generally, the wireless device names will be wlan0, wlan1, wlan2, wlo0, wlo1, and wlo2, whereas the Ethernet (wired device) will probably have eth0, eth1, eno0, eno1,enpls0, or enpls1.

You can find the MAC address of each device at the last line of the device description, followed by link/ether and it’s 52:54:00:5c:92:bf in my case.

Get the MAC address of Bluetooth

As I mentioned earlier, all networking devices have a physical address. If you want to see the MAC address of your Bluetooth adapter, you can use this command:

You can see it beside the BD Address field.

[email protected]:~$ hciconfig hci0: Type: Primary Bus: USB BD Address: DC:41:A9:FB:7A:C4 ACL MTU: 1021:4 SCO MTU: 96:6 UP RUNNING RX bytes:17895787 acl:275 sco:250783 events:298882 errors:0 TX bytes:303664302 acl:295384 sco:249895 commands:3380 errors:0

You can also use the bluetoothctl command here.

Method 2: Get MAC address using GUI

If you’re afraid of using the terminal you can use the network settings to get the MAC address details.

I am using Ubuntu with the GNOME desktop environment. If you use some other desktop environments, the screenshots may not look the same.

First, search for settings in the system menu and open the first result.

search for settings in system menu

Now, for the left menu bar, select Network and click on the little gear icon located near to wired network toggle. Even if you’re not connected to a wired network, you can still follow the same approach.

select networks and click on gear icon

If you’re on Wi-Fi, there will be an option for Wi-Fi in the left menu bar. From there, you have to follow the same approach (clicking on the gear icon) to get your MAC address.

Читайте также:  Linux group and user permissions

Once you click on the gear icon, you’ll be met with details of the selected network interface. Here, the MAC address is given as the Hardware address.

find mac address using gui

Here you have it in the easiest way possible!

Final Words

Did you know that the first half of hexadecimal code (24 bits) is used to represent the manufacturer of your network adapter?

Finding a MAC address in Linux is quite easy as you have seen it here. On the same note, you may like to learn about changing the MAC address in Linux.

Let me know if you have any questions or suggestions.

Источник

How to Find Network MAC Address in Linux System

The term MAC Address is a derived abbreviation for Media Access Control Address. The network interface controller (NIC) uses the MAC address as its assigned unique identifier within an existing network segment.

To practically relate to or understand what a MAC address is, think of it as the postal or physical address to a house. The house in this case is the network interface controller (NIC).

There is a key difference between MAC address and IP address and therefore we should not confuse the two. MAC address identifies the device you are using since it is imprinted on the device hardware whereas IP address identifies the connection status among devices seeking to communicate on an existing/configured network.

The MAC address of any device is represented by a 12-digit hexadecimal number. Its display includes a colon or hyphen after every two MAC address digits for easy readability.

For instance, a MAC address can be represented in the following manner.

aa:bb:cc:dd:ee:ff or gg-hh-ii-jj-kk-ll

Approaches to Finding MAC Address in Linux

Depending on the number of network interfaces on your Linux machine like Wi-Fi built-in and Ethernet port, your computer can be associated with more than one MAC Address.

1. Find Linux System Mac Address Using IP Command

The ip command is part of the iproute2 package and can be used to display both the MAC address and IP address of your Linux-powered machine using either of the following commands.

$ ip addr or $ ip address or $ ip address show

Find Linux System MAC Address

Depending on the network adapter or interface present, we can see the availed MAC addresses. In the above screen capture, three distinct MAC addresses can be identified from the ip address command.

Another useful command is the ip link which only focuses on the MAC address and does not display the IP addresses.

Show Linux System MAC Address

2. Find Linux System Mac Address Using Ifconfig Command

The ifconfig command is another effective approach to identifying the MAC address of your Linux machine. We however need to install it first since it is a member of the net-tools package and not installed on Linux by default.

$ sudo apt install net-tools [On Debian, Ubuntu and Mint] $ sudo yum install net-tools [On RHEL/CentOS/Fedora and Rocky Linux/AlmaLinux] $ sudo emerge -a sys-apps/net-tools [On Gentoo Linux] $ sudo pacman -S net-tools [On Arch Linux] $ sudo zypper install net-tools [On OpenSUSE]

Once installed, run the ifconfig command to find the IP address and MAC address of your Linux system.

Check Linux System MAC Address

Different network interfaces or adapters showcase different MAC addresses as highlighted in the above screen capture.

We have successfully defined and understood how to get the MAC address(es) on our Linux machines.

Источник

Оцените статью
Adblock
detector