For 2 devices to communicate on an Ethernet or Wi-Fi network, an IP address alone is not enough. Layer 2 addressing is needed so that the frames sent over a cable or a radio signal can be delivered from one interface to another in the same network segment. The address used in this addressing is the MAC address. The MAC address, which is short for Media Access Control, is usually written to the Network Interface Card (NIC) during manufacturing on physical Ethernet and Wi-Fi adapters, and it is treated as the hardware identity of the interface. On virtual adapters, the virtualisation platform assigns the address. In both cases, the address that the interface uses can be changed in software.
The MAC address operates at the Data Link Layer of the OSI Reference Model and is the common addressing format of the technologies in the IEEE 802 family, mainly Ethernet (IEEE 802.3) and Wi-Fi (IEEE 802.11). The header of an Ethernet frame contains the Source MAC Address field (the interface that sends the frame) and the Destination MAC Address field (the interface that will receive the frame). In IEEE 802.11, the number and the meaning of the address fields in the header change according to the frame type. A switch looks at the source MAC address of an incoming frame to learn which device is on which port, and it looks at the destination MAC address to decide which port to send the frame out of.

MAC Address Structure
A MAC address is 48 bits long and is written in the base-16 number system, that is, hexadecimal. Each hexadecimal character carries 4 bits, so 2 characters form an 8-bit octet. The address consists of 6 octets, which gives 6 × 8 = 48 bits. Mathematically, a 48-bit field produces 248, that is, 281,474,976,710,656 different values.
Not all of these values can be assigned to devices. The 2 least significant bits of the first octet are reserved to define the type of the address. When these 2 bits are excluded, the space from which globally unique unicast addresses can be produced is 246, that is, 70,368,744,177,664 addresses.
|
Part |
Position |
Meaning |
|
OUI (Organizationally Unique Identifier) |
First 24 bits (first 3 octets) |
The identifier assigned to the manufacturer by the IEEE Registration Authority. |
|
Part assigned by the manufacturer |
Last 24 bits (last 3 octets) |
The value that the manufacturer makes different for each interface. 224 = 16,777,216 addresses can be produced under 1 OUI. |
|
I/G bit (Individual/Group) |
The least significant bit of the first octet |
If it is 0, the address belongs to a single interface (unicast). If it is 1, the address belongs to a group (multicast or broadcast). |
|
U/L bit (Universal/Local) |
The second least significant bit of the first octet |
If it is 0, the address is in universally administered form and is based on a prefix assigned by IEEE. If it is 1, the address is in locally administered form. |
I take the address 00:1A:2B:3C:4D:5E as an example. The 00:1A:2B part of this address is the OUI, and the 3C:4D:5E part is the value that the manufacturer gave to that interface. The last 3 octets are not the serial number of the device. They only distinguish the interfaces under the same OUI from each other. Because the first octet is 00, both the I/G bit and the U/L bit are 0, so the address is in the universally administered unicast format.
These 2 bits show the format of the address. They do not show who gave the address to that interface or by which method. An address in the universally administered format may also have been assigned to a virtual adapter in software by a virtualisation platform.
The IEEE Registration Authority makes the OUI assignments. Today IEEE issues this assignment under the name MA-L (MAC Address Block Large), while the name OUI remains valid in the standards and in everyday use. Smaller blocks also exist for manufacturers that need fewer addresses. In an MA-M block the first 28 bits are fixed and 1,048,576 addresses can be produced, and in an MA-S block the first 36 bits are fixed and 4,096 addresses can be produced. For this reason, the rule "the first 24 bits identify the manufacturer" applies to MA-L blocks.
The same address is written in different formats on different systems. Windows separates the octets with hyphens (00-1A-2B-3C-4D-5E), Linux and macOS use colons (00:1A:2B:3C:4D:5E), and Cisco devices show the address in groups of 4 separated by dots (001a.2b3c.4d5e). All 3 are the same 48-bit value.
On physical adapters, the address written to the NIC during manufacturing is called the Burned-In Address (BIA). If the driver supports it, operating systems can be configured to use another address instead of the BIA when they send frames. This is called MAC address spoofing. In Windows, the value entered in the Network Address field (Locally Administered Address in some drivers) on the Advanced tab of the adapter is written to the registry and remains in effect after the computer restarts. The adapter works with this address until the value is deleted, and the BIA on the NIC remains in place.
Current operating systems also use this mechanism themselves for privacy. The Random hardware addresses feature in Windows 10 and Windows 11, and the similar features in iOS and Android, use a randomly generated address instead of the BIA on Wi-Fi connections. An address whose second hexadecimal character is 2, 6, A or E is in the locally administered unicast format, and randomly generated addresses use this format.
A device with MAC randomisation enabled can appear with a different MAC address on each Wi-Fi network. For DHCP reservations and filtering rules based on the MAC address to work, the address that the device uses on that network must stay the same.
MAC Address Conflict
The OUI assignment, together with the manufacturer giving a different value to the last 24 bits for each interface, aims to make the MAC address unique worldwide. In practice, however, there are cases where 2 interfaces appear with the same address in the same network segment. Because Layer 2 forwarding depends entirely on this address, the effect of the conflict appears directly on the switch.
A switch fills its MAC address table by looking at the source MAC address of incoming frames. When the same address arrives from 2 different ports, the entry in the table moves to the port of whichever device sent a frame most recently. The entry keeps moving between the 2 ports, and this is called MAC flapping. Frames meant for one device are delivered to the other, and both devices lose connectivity intermittently.
|
Cause |
How It Occurs |
|
Virtual machine environments |
A conflict occurs if the source and the copy run together on the same Layer 2 network after a copy or import operation that keeps the static MAC address of the virtual NIC. With dynamic assignment, each host assigns addresses from its own MAC address pool, and if the pools of 2 hosts fall in the same range, the same address can be given to different virtual machines. |
|
Manual MAC address change (spoofing) |
A user or a piece of software assigns an address to the adapter manually. If the assigned address is the same as an address in use in the same segment, a conflict occurs. |
|
Manufacturing errors and uncontrolled manufacturing |
Manufacturers that use an OUI not assigned to them, or that do not manage their address pool properly, can write the same address to more than 1 card. |
On the virtualisation side, the behaviour depends on the platform. Proxmox VE generates new MAC addresses for the virtual NICs when a virtual machine is cloned. In scenarios where the static address is kept, for example when a copy of a machine with a static MAC address on Microsoft Hyper-V is run on the same network, the address must be changed manually. In Hyper-V, the dynamic MAC address range of each host is shown in the MAC Address Range setting under Virtual Switch Manager. Checking that these ranges do not overlap on hosts connected to the same network prevents the problem from the start.
A conflict causes a problem only in the same Layer 2 segment. Using the same MAC address in 2 different networks with a router between them does not affect communication, because the MAC address is not carried beyond the router.
IP & MAC Address Relationship
An IP address and a MAC address do not do the same job. They complement each other. An IP address is a logical address, and it enables the packet to travel from the source to the destination, passing through many networks if necessary. A MAC address enables the frame to be delivered from one interface to another in the network segment where the frame currently is. In normal IP routing without NAT, the packet carries the same source and destination IP addresses along the whole path, while the MAC addresses are rewritten at every router hop. At a point where NAT is applied, the source or destination IP address is also translated.
If a device is going to send data to another device in the same subnet, it has to know the MAC address of the destination. ARP (Address Resolution Protocol) provides this information. For example, when a device wants to communicate with the device that has the IP address 192.168.1.150, it sends an ARP Request that contains the question "Which MAC address does the IP address 192.168.1.150 belong to?". The destination MAC address of this frame is FF-FF-FF-FF-FF-FF, which is the broadcast address, and the frame reaches all devices in the same segment. The device that has the relevant IP address responds with an ARP Reply that contains its own MAC address. In this example, the ARP Reply is sent as unicast to the device that asked the question. In cases such as address conflict detection in IPv4 link-local addressing, the ARP Reply can also be sent as broadcast. The learned mapping is written to the ARP cache, and the same question is not asked again for a period of time. In Windows, I can view this table with the arp -a command.
If the destination is in a different subnet, the flow changes. The device does not look for the MAC address of the destination. It uses the MAC address of the next-hop router that the routing table selects for that destination. If the mapping is not in the ARP cache, the device resolves this address with ARP. If no more specific route is defined for the destination, the selected next hop is the default gateway, and this is the case on most clients. The destination IP address inside the packet belongs to the remote device, while the destination MAC address of the frame belongs to the router. When the router forwards the packet to the next segment, it builds a new frame and writes its own MAC address and the MAC address of the next hop into the header. For this reason, the sending device never sees the MAC address of a device on a remote network.
ARP works for IPv4. In IPv6, the Neighbor Discovery Protocol (NDP), which runs over ICMPv6, performs the same task, and the query is made with multicast instead of broadcast.
The broadcast mechanism that messages such as ARP Request and DHCP Discover rely on is the way to reach a device whose address is not yet known. Its cost is that every device in the segment receives and processes this frame. As the number of devices increases, broadcast traffic also increases, and so does the number of unnecessary frames that each device has to process. Because a broadcast does not pass through a router, the way to limit this traffic is to divide the network into smaller broadcast domains with VLANs.
A broadcast storm is a different problem. When a Layer 2 loop forms between switches and Spanning Tree Protocol (STP) does not break this loop, broadcast frames circulate between the switches and multiply without stopping. Because an Ethernet frame has no TTL field to end the packet, this traffic does not stop by itself, and the network becomes unusable in a short time. The same loop also corrupts the MAC address tables, because the same source MAC address is constantly seen on different ports.
Together with the subnet mask, an IP address shows which network the device is on. A MAC address does not carry this kind of location information. When a laptop connects to a different network, its IP address can change, depending on its configuration and on the lease it receives from the new network. As long as the interface keeps using the same MAC address, the Layer 2 address stays the same.
MAC Address or IP Address?
Which one I work with depends on the point in the network where I perform the task. If I need to identify a device in the same Layer 2 segment, I use the MAC address. If I need to manage traffic between different networks, I work with the IP address, because the MAC address is not carried past the first router.
|
Property |
MAC Address |
IP Address |
|
Layer |
Data Link Layer (Layer 2) |
Network Layer (Layer 3) |
|
Length |
48 bits |
32 bits in IPv4, 128 bits in IPv6 |
|
Assignment |
On physical adapters it is usually written during manufacturing, and on virtual adapters the virtualisation platform assigns it. It can be changed in software. |
It is configured manually or with DHCP. It can also be generated automatically with SLAAC in IPv6 and in the link-local scope in IPv4. |
|
Scope of validity |
The same Layer 2 segment |
The whole path from the source to the destination. The address is translated at a point where NAT is applied. |
|
Location information |
Does not carry it |
Shows the network together with the subnet mask. |
A DHCP reservation is defined by client identity.
When I want a device to receive the same IP address from the DHCP server every time, I have to give the DHCP server a piece of information that identifies that device. Because the device has not received an IP address yet, this information cannot be the IP address. A DHCPv4 server identifies the client by the Client Identifier (Option 61) value if it is sent, and by the hardware address in the chaddr field if it is not sent. Windows clients use the MAC address as the Client Identifier, so in practice a reservation on a Windows DHCP server is defined by entering the MAC address of the device. A client that sends a different Client Identifier may not match a reservation that was prepared according to the MAC address.
MAC filtering works only in the local segment.
Wireless access points, switches and firewall devices can be configured to allow or block specific MAC addresses. This rule is meaningful for the addresses in the segment that the device is directly connected to. The source MAC address of traffic that arrives from behind a router belongs to that router, and the address of the original sending device is not visible.
Rules between networks are written with IP addresses.
Firewall rules, access control lists and routing decisions are defined by IP address. For this reason, the servers and network devices that rules are written for are given a static IP address or a DHCP reservation.
MAC filtering is not a security control by itself. An allowed MAC address can be learned by capturing network traffic and then used through spoofing. For access control, authentication-based methods such as IEEE 802.1X should be preferred.
How to Find the MAC Address in Windows
When I define a DHCP reservation, verify which device is connected to a switch port or write an access rule, the first piece of information I need is the MAC address of the device. In Windows, I get this information with several different commands in CMD (Command Prompt) or Windows PowerShell.
None of the commands below changes the system, and none of them requires administrator rights. ipconfig, getmac and wmic work in both CMD and PowerShell. Get-NetAdapter and Get-CimInstance are PowerShell commands. Get-NetAdapter is part of the NetAdapter module that was introduced with Windows 8 and Windows Server 2012.
1- ipconfig /all
In the first method, I use the ipconfig command with the /all parameter.
When ipconfig runs without parameters, it shows only the IP address, subnet mask and default gateway, and the MAC address is not in the output. When the /all parameter is added, the adapter description, DHCP status, DNS server addresses, IPv6 configuration and MAC address are also listed for all physical and virtual adapters.
Checkpoint
In each adapter block, the Physical Address line shows the MAC address. I identify which adapter it belongs to from the Description line in the same block.

2- ipconfig /all and findstr
The ipconfig /all output becomes longer as the number of adapters increases. In the second method, I filter the output of the same command with findstr and display only the adapter description and MAC address lines.
ipconfig /all | findstr "Description Physical"
findstr returns the lines that contain any of the words separated by spaces inside the quotation marks. In this command, the lines that contain the word Description or Physical are listed, so the name and the MAC address of each adapter appear one below the other.
Checkpoint
The output shows 1 Description line for each adapter and 1 Physical Address line directly below it.

This filter works on Windows installations where the display language is English. In a different display language, the ipconfig labels are written in that language, so the search words must be changed accordingly.
3- Get-NetAdapter
In the third method, I use the PowerShell Get-NetAdapter command. So that the output fits the screen properly, I convert the result to a table with FT (the alias of the Format-Table command) and add the -AutoSize and -Wrap parameters.
Get-NetAdapter | FT -AutoSize -Wrap
Get-NetAdapter returns the adapters in a single table with their name, description, connection status, MAC address and link speed. -AutoSize adjusts the column widths to the content, and -Wrap moves values that do not fit the column to the next line instead of truncating them. By default, the command also lists virtual adapters such as Hyper-V Virtual Switch adapters. When I want to see only the physical adapters, I add the -Physical parameter to the command.
Checkpoint
The MacAddress column in the table shows the address of each adapter, and the Status column shows whether the adapter is connected.

4- Get-NetAdapter and Format-List
In the fourth method, I use the Get-NetAdapter command again. The difference from the previous method is that I limit the output to only the properties I need.
Get-NetAdapter | Format-List -Property "Name", "InterfaceDescription", "MacAddress"
Format-List shows each adapter as a separate block, with only the properties that I specify in the -Property parameter. Name gives the connection name of the adapter in Windows, InterfaceDescription gives the adapter model reported by the driver, and MacAddress gives the address that the adapter is currently using. If an address has been assigned to the adapter manually, that address appears here. When PermanentAddress is added to the property list, the permanent address reported by the adapter is also listed. On adapters that have no permanent address, for example some virtual adapters, this field can be empty.
Checkpoint
The output shows a separate block for each adapter, made up of the Name, InterfaceDescription and MacAddress lines.

5- wmic and Get-CimInstance
In the fifth method, I use the wmic command. This command queries the Windows Management Instrumentation (WMI) infrastructure and has a very wide range of uses. Typing /? after the command lists the values that can be queried. I used the nic (Network Interface Card) value to retrieve the MAC address and the name of the adapters that are marked as physical.
wmic nic where PhysicalAdapter=True get MACAddress,Name
The where PhysicalAdapter=True condition returns the adapters that are marked as physical in WMI, and the output lists the MAC address and the adapter name side by side. This flag is based on the value that the adapter reports to WMI, so I evaluate the output together with the adapter name.


The wmic tool is deprecated and is not included in current versions of Windows 11. The WMI infrastructure has not been removed, and the same query can be run with PowerShell.
On systems that do not have wmic, I query the same WMI class with the PowerShell Get-CimInstance command. The command applies the same filter and returns the same 2 fields.
Get-CimInstance Win32_NetworkAdapter -Filter "PhysicalAdapter=True" | Select-Object Name, MACAddress
On the CMD side, another command that gives the same information is the getmac command. The /v parameter adds the connection name and the adapter model to the output, and /fo list returns the result as a separate list for each adapter.
This article covered the 48-bit structure of the MAC address, the meaning of the OUI and of the I/G and U/L bits, the situations in which the address conflicts, and the effect of a conflict on the switch. It then covered how the IP address and the MAC address work together through ARP, which one is used for which task, and which commands find the MAC address in Windows.
I hope you find it useful...
Feel free to share your thoughts and questions about this article in the comments below. Every contribution helps the content reach more people and makes for a more useful discussion.