How to find the MAC address using the command line in Linux

How to find the MAC address using the command line in Linux


Today, Quantrimang.com will mention an important command in Linux, ip. This command works on all Linux distributions, including Ubuntu, Arch Linux, Debian, Fedora, etc.

Ip command

Comeinand ip is a very powerful command that replaces the command ifconfig and is part of a network tool pack. The general syntax of the command is as follows:

ip xx

Inside xx must be replaced with one of the following to get the desired output.

  • -V to show ip utility version
  • -S to display more information about the command
Ip command in Linux
Ip command in Linux

Find the MAC address of the Linux system

The MAC address is an important parameter of network equipment, including PC hardware or servers. Every PC’s network device needs a unique MAC address.

Launch Terminal and enter the command ip link:

ip link show

Example results:

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: enp1s0:  mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
 
 link/ether XXXXXXXXXXXX brd ff:ff:ff:ff:ff:ff
 
 3: wlp2s0:  mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
 
 link/ether YYYYYYYYYYYY brd ff:ff:ff:ff:ff:ff

Utilities ip Will list a few parameters of the device. For each device, there are two lines summarizing the link state and characteristics. The first line summarizes the device’s current name, the flags set on the device, MTU (Maximum Transmission Unit), etc.

The second line indicates the type of link layer in use and the current hardware address (MAC address). In the example above, XXXXXXXXXXXX and YYYYYYYYYYY is the MAC address of the two LAN connections you are using.

.

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *