A MAC (Media Access Control) address is a unique identifier assigned to network interfaces for communication on a network. It is used to identify devices on a network and to distinguish them from one another.
How MAC addresses are formatted:
A MAC address is a string of six groups of two hexadecimal digits, separated by colons (:) or hyphens (-). For example: 01:23:45:67:89:ab
.
How MAC addresses are used in networking:
- MAC addresses are used by network interfaces to identify themselves and to communicate with other devices on a network.
- In local area networks (LANs), MAC addresses are used in the Media Access Control protocol to identify devices and to determine which device should receive transmitted data.
- MAC addresses are also used in the Address Resolution Protocol (ARP) to map IP addresses to physical devices.
MAC addresses in OSI Model
The MAC (Media Access Control) address is used in the data link layer (layer 2) of the OSI (Open Systems Interconnection) model.
The OSI model is a framework for understanding how communication occurs between devices on a network. It consists of seven layers, each with a specific role in the communication process. The data link layer is responsible for providing reliable communication between devices on a local network, using techniques such as error checking and flow control.
The MAC address is used in the data link layer to uniquely identify devices on the network and to facilitate communication between them. It is used in the Media Access Control protocol, which controls the way that devices access the network media (such as a cable or wireless channel) to transmit data.
How to find the MAC address of a device:
On a Windows computer, you can use the ipconfig
command in the Command Prompt to find the MAC address of your network interfaces. For example:
C:\\> ipconfig /all
Ethernet adapter Ethernet:
Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Realtek PCIe GbE Family Controller
Physical Address. . . . . . . . . : 01-23-45-67-89-AB
DHCP Enabled. . . . . . . . . . . : Yes
Autoconfiguration Enabled . . . . : Yes
On a Mac, you can use the ifconfig
command in the Terminal to find the MAC address of your network interfaces. For example:
$ ifconfig
en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
ether 01:23:45:67:89:ab
inet6 fe80::123:45ff:fe67:89ab%en0 prefixlen 64 secured scopeid 0x4
inet 192.168.1.100 netmask 0xffffff00 broadcast 192.168.1.255
nd6 options=201<PERFORMNUD,DAD>
media: autoselect
status: active
On Linux, you can use the ifconfig
or ip
command in the Terminal to find the MAC address of your network interfaces. For example:
$ ifconfig
eth0 Link encap:Ethernet HWaddr 01:23:45:67:89:ab
inet addr:192.168.1.100 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::123:45ff:fe67:89ab/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:10524 errors:0 dropped:0 overruns:0 frame:0
TX packets:8092 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
How to change the MAC address of a device:
In some cases, it may be necessary to change the MAC address of a device, for example to work around MAC address filtering or to change the device’s identity on a network.
To change the MAC address of a device, you can use the ifconfig
command on Linux.
$ ifconfig eth0 down
$ ifconfig eth0 hw ether 01:23:45:67:89:ab
$ ifconfig eth0 up
On Windows, you can use the network adapter properties to change the MAC address:

Note: Changing the MAC address of a device may be against the terms of use for some networks, and it may also cause issues with network communication. Use caution when changing the MAC address of a device.
In Windows 11, there is a feature called MAC randomization
that allows the system to randomly generate a new MAC address for the device’s wireless network adapter each time the device connects to a new wireless network. This is designed to help protect the privacy of the device’s user by making it more difficult to track the device’s location and activity through its MAC address.
To enable MAC randomization on a Windows 11 device, you can go to the Settings app and navigate to the “Privacy” section. Under “Location and network privacy,” you can toggle the “Randomize MAC addresses when connecting to networks” setting to “On”.
Advanced use cases for MAC addresses:
- MAC address spoofing: In some cases, it may be necessary to “spoof” the MAC address of a device, or to use a different MAC address than the one assigned to the device. This could be done to bypass MAC address filtering on a network, or to change the device’s identity on the network.
- MAC address filtering: Some networks may use MAC address filtering to allow only certain devices to connect to the network. In this case, the MAC address of the device must be added to the list of allowed MAC addresses in order to connect to the network.
- Network security: MAC addresses can be used as a factor in network security, for example to identify and block malicious devices on a network.