- How can I see my mac address on Ubuntu?
- You must log in to answer this question.
- Related
- Hot Network Questions
- Subscribe to RSS
- Как узнать MAC-адрес в Linux
- Как узнать MAC-адрес с помощью ifconfig
- Как посмотреть MAC-адрес с помощью ip
- Выводы
- How to Find Your MAC Address in Ubuntu 20.04 / Ubuntu 22.04
- Find MAC Address in Ubuntu or Other Linux with GNOME Desktop:
- Find MAC Address via single command (Universal way):
- ip command:
- ifconfig command:
- How to Find Your MAC address in Ubuntu and Other Linux Distros
- Method 1: Find MAC address using command line
- Get the MAC address of Bluetooth
- Method 2: Get MAC address using GUI
- Final Words
How can I see my mac address on Ubuntu?
As described in the newer answer below, the modern solution is to run:
The MAC address is shown in the link/ether field.
Original Answer
Open a terminal and run ifconfig:
This answer needs to be deprecated given that the system doesn’t even come with ifconfig anymore. Someone like me looking for how to find the ip address without internet working can’t just intstall the obsolete utllity.
Use ip command instead of the outdated ifconfig
link/ether field of the output is the MAC address (Both for Wi-fi and ethernet connections, MAC address is represented by link/ether ). Mostly this will be present in the second line.
$ ip addr show 1: enp2s0: mtu 1500 qdisc mq state UP group default qlen 1000 link/ether a0:54:9f:53:b2:6e brd ff:ff:ff:ff:ff:ff
In my case a0:54:9f:53:b2:6e is the MAC address.
On Ubuntu 20.04.02 LTS, there is no HWaddr in the output from ifconfig . Instead, look at ether :
Try ifconfig, and look at the «HWaddr».
okay, this is a very easy solution. 1/ Open a terminal 2/ ifconfig A list of network capable devices will be displayed. If you are using wireless, it usually is called wlan0, but can also be named pan0 wifi0 etc. A physical conection is most likely eth0. on the first line you will see your mac address. here is a sample of what you might see eth0 Link encap:Ethernet HWaddr 00:00:00:00:00:00
You can spoof your mac address too with macchanger (sudo aptitude install macchanger) just type man macchanger to learn more
You can also right-click on the GNOME Network Manager. There you choose connection information and the following window shows you the hardware address. See also NetworkManager at Ubuntus Wiki.
You must log in to answer this question.
Related
Hot Network Questions
Subscribe to RSS
To subscribe to this RSS feed, copy and paste this URL into your RSS reader.
Site design / logo © 2023 Stack Exchange Inc; user contributions licensed under CC BY-SA . rev 2023.7.12.43529
By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy.
Как узнать MAC-адрес в Linux
В те времена, когда только проектировался Ethernet, предусматривалось применение уникального номера каждой сетевой карте, подключённой к нему. Назначался он при изготовлении платы. MAC-адрес используется для определения получателя и отправителя информации в Сети. И в этой статье речь пойдёт о том, как узнать MAC адрес в Linux.
Практически во всех операционных системах на основе ядра Linux используется две консольные утилиты, с помощью которых можно узнать аппаратный адрес карты: ifconfig и ip. Различные графические приложения этого типа используют их данные.
Как узнать MAC-адрес с помощью ifconfig
Одной из первых сетевых программ в истории Linux является ifconfig. В некоторых дистрибутивах она запускается только от имени администратора, а где-то вообще не установлена. Рассмотрим её инсталляцию и использование в Manjaro Linux.
Пакет, содержащий в себе некоторые сетевые утилиты (в том числе и ifconfig), в Manjaro- и Arch-подобных системах называется net-tools. Установим его.
А в Ubuntu- и Debian-подобных системах:
sudo apt install net-tools
Чтобы узнать MAC-адрес Linux, сначала смотрим список интерфейсов:
Доступных интерфейсов два: enp0s7 (в вашем случае он может называться по другому) и lo (он же локальный хост, который одинаков практически для всех компьютеров). Нам нужен enp0s7.
MAC-адрес устройства виден уже сейчас в поле ether, но чтобы отобразить только его, воспользуемся такой командой:
ifconfig -a | grep ether | gawk »
Здесь grep принимает на вход то, что вывела команда ifconfig -a, находит строку, где есть ether, и передаёт на вход команде gawk, которая выбирает второе слово в принятой строке.
Как посмотреть MAC-адрес с помощью ip
Более новой в системах GNU/Linux (относительно ifconfig) является программа ip. Её принцип работы практически такой же. Отличается синтаксисом и выводимой информацией. И она установлена по умолчанию для всех систем. Для отображения сетевых интерфейсов нужно ввести команду:
Здесь lo и enp0s7 расположены в обратном порядке.
Чтобы узнать MAC адрес сетевой карты Linux, вводим ту же самую конструкцию, только для этой команды:
Выводы
За то, как узнать MAC адрес в Linux, отвечают две консольные утилиты — ifconfig и ip. Первая может запускаться от имени администратора в некоторых дистрибутивах (например в Debian), а где-то вообще не быть установленной (Manjaro). Это связано с её отходом на второй план, поскольку ip является более новой программой и устанавливается по умолчанию во всех системах.
Обнаружили ошибку в тексте? Сообщите мне об этом. Выделите текст с ошибкой и нажмите Ctrl+Enter.
How to Find Your MAC Address in Ubuntu 20.04 / Ubuntu 22.04
Sometimes you need to know the physical hardware address (aka MAC Address) of your network cards on Ubuntu or Debian Linux. Here are how to find it either in graphical way or by running command.
MAC Address, stands for media access control address, is a unique identifier assigned to a network interface controller for use as a network address in communications. Each network device has its own hardware address. Usually, desktop PC has only one MAC address for the wired network. While a notebook will have two: one for wireless card and another for the wired.
Find MAC Address in Ubuntu or Other Linux with GNOME Desktop:
For the Linux with GNOME Desktop, e.g., Ubuntu 18.04 +, Debian 11, Fedora Workstation, and CentOS 8, it’s easy to find it.
Firstly, go to upper-right corner system tray menu and click the option to open “Settings”.
If Wi-Fi connected, in the first tab click on the “gear” icon after the connected network will open the information page.
Or, go to the “Network” in the left pane and click on the “gear” button for the wired network. You can find the Mac address even the cable is not plugged.
Finally, you’ll see the “Hardware Address” (aka Mac address) in the pop-up dialog for either WiFi or Wired network, depends on which button you clicked. In my case, the address is “AC:E2:D3:6D:7A:AC”.
Find MAC Address via single command (Universal way):
For other Desktop or all Linux server, there are a few commands to tell the hardware address.
ip command:
Without installing anything, the built-in ip command line tool can tell the info via:
It will output something look like:
[email protected]:~$ ip link 1: lo: mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 2: eno1: mtu 1500 qdisc fq_codel state DOWN mode DEFAULT group default qlen 1000 link/ether ac:e2:d3:6d:7a:ac brd ff:ff:ff:ff:ff:ff altname enp2s0 3: wlo1: mtu 1500 qdisc noqueue state UP mode DORMANT group default qlen 1000 link/ether 40:9f:38:ee:52:7d brd ff:ff:ff:ff:ff:ff altname wlp3s0
Usually, the wireless device is one of “wlan0, wlan1, wlan2, wlo0, wlo1, wlo2” while the wired device name is “eth0“, “eth1“, “eno0“, or “eno1” depends on your machine.
And the addresses behind “link/ether” in the output are what you want to find:
ifconfig command:
Similar to Microsoft Windows “ipconfig“, Linux also has “ifconfig” command to do the similar job. However, it is not pre-installed out-of-the-box in some Linux. So, you may first install the tool via command:
sudo apt install net-tools
And then run it to tell the info:
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:
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.
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.
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.
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.
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.