- How to Find MAC Address on Linux
- Method 1: Find MAC Address Numbers with ip link
- Method 2: Find MAC Address with the ifconfig Command
- How to List/Get/Display/Find MAC Address in Linux Using 11 Popular Methods
- What is MAC Address
- Find MAC Address in Linux
- Method 1: How to find MAC Address in Linux Using ifconfig command
- Method 2: How to find an ethernet MAC Address in Linux Using ifconfig command
- Method 3: How to find MAC Address in Linux Using ip addr sh command
- Method 4: How to find an ethernet MAC Address in Linux using ip addr sh command
- Method 5: How to find MAC Address in Linux Using ip link show command
- Method 6: How to find an ethernet MAC Address in Linux using ip link show command
- Method 7: How to find MAC Address in Linux using ethtool command
- Method 8: How to find MAC Address in Linux using Regex with ifconfig command
- Method 9: How to find MAC Address in Linux using SYS Files
- Method 10: How to find MAC Address in Linux using AWK Regex with ifconfig command
- Method 11: How to find MAC Address in Linux using Sed Regex with ifconfig command
- How to find my MAC address on Linux?
- The first way
- The second way
- Find MAC address on different platforms
- More questions
- More questions
- Domain Research Suite
- IP Geolocation API
- Have questions?
- How to Look Up MAC Addresses
- Media Access Control (MAC) Address
- Finding IP and MAC Address Using the Command-Line
- The IP command
- Finding the IP Address of a Linux System
- Finding the MAC Address of a Linux System
- Conclusion
- About the author
- Younis Said
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.
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 List/Get/Display/Find MAC Address in Linux Using 11 Popular Methods
Table of Contents
In this article, I will take you through different ways to List/Get/Display/Find MAC Address in Linux. You might be aware of Ethernet Card/Network Card/NIC Controller which works at Network level and is responsible for communicating with other network devices in a Network Topology. It is used in Layer-2 Communication. You can find the usage of MAC address in wide range of Network Devices currently in use. This is typically in-line with IEEE 802 Network technologies.
What is MAC Address
MAC is abbreviated as Media Access Control. It is a unique 48 bit(6-byte) address assigned to a Network Interface. It is almost used in all the Network Devices which has network controller in it. It will always show in this form 00:07:Y7:1C:6L:03.
Find MAC Address in Linux
Method 1: How to find MAC Address in Linux Using ifconfig command
If you want to check MAC Address of all the network interfaces in Linux using our traditional ifconfig command then you need to use ifconfig -a command as shown below.
Method 2: How to find an ethernet MAC Address in Linux Using ifconfig command
If you want to check the MAC Address of a specific network interface using ifconfig command then you need to use network interface name with ifconfig command as shown below. Here we are checking MAC Address of interface enp0s3 using ifconfig enp0s3 command.
Method 3: How to find MAC Address in Linux Using ip addr sh command
If you want to check the MAC address of all the network interfaces then you need to simply use ip addr sh command and check the MAC address from ether field as shown below.
Method 4: How to find an ethernet MAC Address in Linux using ip addr sh command
If you want to check the MAC address of some specific network interface then you need to use the interface name with ip addr sh command and check the MAC address from ether field as shown below. In this example we are checking MAC address of enp0s3 network interface.
Method 5: How to find MAC Address in Linux Using ip link show command
If you want to check the MAC address of all the network interfaces then you can use another useful ip link show command and check the MAC address from link/ether field as shown below.
Method 6: How to find an ethernet MAC Address in Linux using ip link show command
If you want to check the MAC address of some specific network interface then you need to use the interface name with ip link show command and check the MAC address from ether field as shown below. In this example we are checking MAC address of enp0s3 network interface.
Method 7: How to find MAC Address in Linux using ethtool command
You can also use another useful linux tool called ethtool to find MAC address in Linux as shown below. Here I am checking MAC address of my ethernet card enp0s3 using ethtool command hence you need to mention your Interface name before running below command.
Method 8: How to find MAC Address in Linux using Regex with ifconfig command
You can use a simple grep regular expression with ifconfig command to find the MAC Address of an ethernet card in Linux as shown below. Like above example, Here I am using regular expression on my System enp0s3 interface so you need to change and mention your interface name instead of enp0s3 before running below command.
Method 9: How to find MAC Address in Linux using SYS Files
If you want to check MAC address in Linux using SYS files you need to check network address file using below cat command. As mentioned below SYS file is a text file so its contents can always be seen through Linux cat command.
Method 10: How to find MAC Address in Linux using AWK Regex with ifconfig command
You can also use AWK regular expression with ifconfig command to find MAC Address in Linux as shown below. Here we are grepping ether keyword from ifconfig command and then piping to awk to get first and second column output separated by tab.
Method 11: How to find MAC Address in Linux using Sed Regex with ifconfig command
Like above example, you can also use Sed Regular expressions with ifconfig command to find MAC Address in Linux as shown below.
Popular Recommendations:-
Источник
How to find my MAC address on Linux?
The first way
For Linux, you can always use the universal way: the command line!
You can do so by executing one of these commands.
As you can see, there is a lot of output, but we are only interested in MAC addresses (They are underlined in red).
These screenshots show that my computer has three network interfaces: lo — Local loopback, enp2s0f0 — my ehternet adapter and wlp3s0 — my Wi-Fi adapter.
The second way
If you are using Ubuntu 16.04, you can find your MAC addresses via GUI.
Open All Settings application and click on Network .
Select Wireless and choose the connection you have plugged in and click on the blue arrow.
Now you can see your MAC address.
You may not have an active connection, so you can try to connect to any available one. Then you can click on the blue arrow , which opens the connection info. Since you aren’t connected yet, you need to click on the Settings button.
If you want to know the MAC address of your wired connection, click on Wired in step 2.
Find MAC address on different platforms
More questions
More questions
Domain Research Suite
Domain Research Suite (DRS) is a web-based enterprise-grade solution to search and monitor domain data.
500 free requests. No credit card required.
IP Geolocation API
IP Geolocation API service allows you to identify your web visitors and users’ geographical location. IP location helps customize web experiences, prevent fraud, ensure regulatory compliance, and more.
1,000 free requests. No credit card required.
Have questions?
We work hard to improve our services for you. As part of that process we welcome your feedback, questions and suggestions . Please let us know your thoughts and feelings, and any way in which you think we can improve our product.
Shoot us an email to support@macaddress.io or just fill in the contact form .
Made with by CodeLine Oy 2018 — 2021
Источник
How to Look Up MAC Addresses
- What is a MAC address?
- Finding the IP and MAC address using the command-line
- The IP command
- Finding the IP address in Linux systems
- Finding the MAC Address in Linux systems
Media Access Control (MAC) Address
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.
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.
Источник