Macaddress

11 min read2,052 words

MAC Address

A MAC address is a hardware/link-layer address used to identify a network interface on a local network.

Simple definition

A MAC address is a link-layer identifier associated with a network interface, mainly used for communication within a local network.

MAC stands for:

Media Access Control

Example:

A4:5E:60:12:AB:91

1. Why Do We Need a MAC Address?

Suppose you have a local network:

Laptop │ ↓ Switch │ ├── PC ├── Printer └── Server

The devices need a way to identify network interfaces on the local link.

MAC addresses provide that link-layer identification.

For example:

Laptop → AA:BB:CC:11:22:33 PC → AA:BB:CC:44:55:66 Printer → AA:BB:CC:77:88:99

A switch can use these MAC addresses to decide where to forward Ethernet frames.

2. What Does a MAC Address Look Like?

A traditional MAC address is 48 bits (6 bytes) long.

It is usually written as six hexadecimal groups:

A4:5E:60:12:AB:91

Each group contains two hexadecimal digits.

A4 : 5E : 60 : 12 : AB : 91 │ │ │ │ │ │ 2 2 2 2 2 2 hexadecimal digits

Total:

6 × 8 bits = 48 bits

3. What Is Hexadecimal?

MAC addresses use hexadecimal because it makes binary values easier to read.

Hexadecimal uses:

0 1 2 3 4 5 6 7 8 9 A B C D E F

For example:

FF = 255 AA = 170 01 = 1

A 48-bit MAC address can therefore be represented compactly as 12 hexadecimal digits:

A45E6012AB91

Usually it is displayed as:

A4:5E:60:12:AB:91

4. Structure of a Traditional MAC Address

A commonly encountered globally administered MAC address can be conceptually divided into:

A4:5E:60 : 12:AB:91 ↑ ↑ OUI Interface-specific part

The first 24 bits are commonly associated with the OUI (Organizationally Unique Identifier).

The remaining 24 bits identify the interface within that allocation.

However, not every MAC address follows this simple manufacturer-based interpretation. Locally administered and virtual/randomized addresses are also common.

5. OUI

OUI stands for:

Organizationally Unique Identifier

It is a 24-bit identifier allocated by the IEEE.

For example:

A4:5E:60

may identify an organization that has been allocated that prefix.

The remaining portion can then distinguish individual interfaces within that allocation.

Important

You should not assume that the first three bytes always reveal the physical manufacturer, because modern systems can use locally administered or randomized MAC addresses.

6. Unicast and Multicast MAC Addresses

MAC addresses also contain special bits that indicate how the address is used.

The least significant bit of the first octet indicates:

0 → Individual / unicast 1 → Group / multicast

For example, a normal unicast address might look like:

A4:5E:60:12:AB:91

A multicast address represents a group of devices/interfaces rather than one individual interface.

7. Universally vs Locally Administered

Another important bit in the first octet indicates whether the address is:

Universally administered

or

Locally administered

A locally administered address may be assigned by software or an administrator rather than being permanently tied to the hardware vendor allocation.

This is common with:

  • Virtual machines
  • Containers
  • Some Wi-Fi privacy mechanisms
  • Network virtualization
  • Manually configured interfaces

8. MAC Address vs IP Address

This is extremely important.

MAC AddressIP Address
Link-layer addressNetwork-layer address
Used primarily on local networksUsed for logical addressing/routing
Usually 48 bits for Ethernet/Wi-FiIPv4 = 32 bits
Example: AA:BB:CC:DD:EE:FFExample: 192.168.1.10
Associated with a network interfaceAssigned/configured for network communication
Switches use MAC addressesRouters use IP addresses

Simple idea:

MAC → Who is this interface on this local link? IP → Where is this device/network logically?

This is simplified, but useful for learning.

9. MAC Address and IP Address Together

Suppose:

Laptop IP: 192.168.1.10 MAC: AA:AA:AA:AA:AA:AA

and:

Router IP: 192.168.1.1 MAC: BB:BB:BB:BB:BB:BB

The laptop wants to communicate outside its local network.

It sends the Ethernet frame to the router's MAC address, while the IP packet has the final destination IP.

Conceptually:

Ethernet Frame ┌─────────────────────────────┐ │ Destination MAC: Router │ │ Source MAC: Laptop │ ├─────────────────────────────┤ │ Destination IP: Server │ │ Source IP: Laptop │ │ │ │ Data │ └─────────────────────────────┘

This distinction is fundamental.

10. MAC Address and Switches

A network switch learns which MAC addresses are reachable through which ports.

Example:

Switch ┌────┼────┐ │ │ │ PC1 PC2 Printer

Suppose:

PC1 MAC → AA:AA:AA:AA:AA:01 PC2 MAC → AA:AA:AA:AA:AA:02 Printer → AA:AA:AA:AA:AA:03

The switch can maintain a MAC address table such as:

MAC AddressSwitch Port
AA:AA:AA:AA:AA:01Port 1
AA:AA:AA:AA:AA:02Port 2
AA:AA:AA:AA:AA:03Port 3

If PC1 sends a frame to PC2:

PC1 ↓ Switch ↓ Port 2 ↓ PC2

The switch can forward the frame toward the appropriate port.

11. How Does a Switch Learn MAC Addresses?

Initially, a switch may not know where a source MAC address is located.

Suppose PC1 sends a frame:

PC1 → Switch

The switch examines the source MAC address and learns:

AA:AA:AA:AA:AA:01 → Port 1

Later, if it receives a frame destined for that MAC, it knows which port to use.

This is called MAC address learning.

12. MAC Address Table

A switch maintains a forwarding database/MAC address table.

Example:

MAC Address Port -------------------------------- AA:AA:AA:AA:AA:01 1 BB:BB:BB:BB:BB:02 2 CC:CC:CC:CC:CC:03 3

Entries can age out if they are not seen for a period of time.

13. Broadcast MAC Address

A special Ethernet destination MAC address is:

FF:FF:FF:FF:FF:FF

This means:

Broadcast to all devices on the local Ethernet broadcast domain.

For example, an ARP request can be sent as an Ethernet broadcast.

PC │ │ FF:FF:FF:FF:FF:FF ↓ Switch ├── PC1 ├── PC2 ├── PC3 └── Printer

Devices in the broadcast domain receive/process the broadcast according to the relevant protocol.

Routers normally do not forward ordinary Layer-2 broadcasts between IP subnets.

14. MAC Address in ARP

Suppose your computer wants to communicate with:

192.168.1.20

but does not know its MAC address.

For IPv4, it can use ARP.

Who has 192.168.1.20?

The target replies:

192.168.1.20 is at AA:BB:CC:DD:EE:FF

The sender can then build the Ethernet frame.

IP Address ↓ ARP ↓ MAC Address

This is one of the most important practical uses of MAC addresses.

15. Checking Your MAC Address

Linux

Use:

ip link

or:

ip addr

Example:

2: eth0: link/ether aa:bb:cc:dd:ee:ff

Here:

aa:bb:cc:dd:ee:ff

is the link-layer address of the interface.

You can also use:

ip link show eth0

Windows

Use:

ipconfig /all

Look for:

Physical Address

Example:

Physical Address. . . . . . . . . : AA-BB-CC-DD-EE-FF

PowerShell can also show interface information.

16. MAC Address on Wi-Fi

Wi-Fi interfaces also have MAC addresses.

Example:

Laptop Wi-Fi MAC: A4:5E:60:12:AB:91

The Wi-Fi access point uses MAC addresses in wireless communication.

Laptop MAC: AA:AA:AA:AA:AA:01 ))) ))) ))) Access Point MAC: BB:BB:BB:BB:BB:02

17. MAC Randomization

Modern devices may use MAC address randomization, especially for Wi-Fi privacy.

Instead of always presenting the same hardware-associated address to every network, a device may use a different locally administered MAC address.

For example:

Network A → MAC X Network B → MAC Y

This can make passive tracking across different Wi-Fi networks more difficult.

Therefore:

A MAC address should not always be treated as a permanent, globally unique identity of a person or physical device.

18. MAC Address in Virtual Machines

Virtual machines usually have virtual network interfaces.

Example:

Host Computer │ ├── VM 1 │ MAC: 00:50:56:AA:AA:01 │ └── VM 2 MAC: 00:50:56:AA:AA:02

The hypervisor provides virtual networking, including virtual MAC addresses.

19. MAC Address in Containers

Containers can also have virtual network interfaces.

For example:

Host │ ├── Container 1 → Virtual interface/MAC └── Container 2 → Virtual interface/MAC

So MAC addresses are not necessarily limited to physical network cards.

20. MAC Spoofing

MAC spoofing means changing the MAC address presented by a network interface.

For example, on Linux, tools/configuration can change the address of an interface.

Legitimate uses can include:

  • Testing
  • Privacy
  • Network administration
  • Lab environments
  • Troubleshooting

However, changing a MAC address does not give you the identity or permissions of another system automatically. Network authentication and access controls may use additional mechanisms.

21. MAC Filtering

Some Wi-Fi/network systems can use MAC addresses as part of access-control rules.

For example:

Allowed: AA:BB:CC:11:22:33 AA:BB:CC:44:55:66

But MAC filtering alone is weak as a security mechanism because MAC addresses can often be changed/spoofed.

Modern networks should rely on stronger authentication and encryption mechanisms.

22. MAC Address vs Port vs IP

These three are often confused.

MAC ↓ Local network interface IP ↓ Logical network destination Port ↓ Application/service endpoint

Example:

MAC: AA:BB:CC:DD:EE:FF IP: 192.168.1.10 Port: 443

Communication can be visualized as:

Device Interface │ │ MAC ↓ Local Network │ │ IP ↓ Destination Host │ │ Port ↓ Application

23. MAC Address and OSI Model

MAC addresses belong primarily to:

OSI Layer 2 — Data Link

The relationship is:

OSI Layer 4 → Port OSI Layer 3 → IP OSI Layer 2 → MAC

So:

Port → TCP/UDP IP → Routing MAC → Local link delivery

24. MAC Address and TCP/IP Model

In the TCP/IP model, MAC addressing belongs primarily to the:

Network Access / Link layer

Remember:

TCP/IP Application ↓ Transport ↓ Internet ↓ Network Access ↑ MAC address

25. MAC Address Example

Imagine:

Laptop IP: 192.168.1.10 MAC: AA:AA:AA:AA:AA:10 Router IP: 192.168.1.1 MAC: BB:BB:BB:BB:BB:01

You open:

https://example.com

The destination server is not on your local Ethernet network.

Your laptop therefore sends the local Ethernet frame toward the router:

Ethernet: Source MAC: AA:AA:AA:AA:AA:10 Destination MAC: BB:BB:BB:BB:BB:01

But inside that frame, the IP packet can contain:

Source IP: 192.168.1.10 Destination IP: Remote Server IP

This is an extremely important networking concept:

The Layer-2 MAC destination can change at each network hop, while the IP packet is routed toward its destination.

26. Common MAC Address Types

TypeExamplePurpose
UnicastA4:5E:60:12:AB:91One interface
MulticastGroup-specific MACOne-to-many/group communication
BroadcastFF:FF:FF:FF:FF:FFAll devices on local Ethernet broadcast domain
Locally administeredSoftware-assigned/randomized addressLocal/virtual/privacy use

27. Important Points to Remember

1. MAC is Layer 2

MAC → Data Link / Network Access

2. Traditional Ethernet MAC is 48 bits

48 bits = 6 bytes

3. Written in hexadecimal

AA:BB:CC:DD:EE:FF

4. Switches use MAC addresses

Switch → MAC-based forwarding

5. Routers primarily use IP addresses

Router → IP-based routing

6. ARP maps IPv4 addresses to MAC addresses on the local network

IPv4 → ARP → MAC

7. IPv6 does not use ARP

It uses:

IPv6 → ICMPv6 Neighbor Discovery

8. MAC addresses are not always permanent hardware identities

Virtual interfaces, local administration, and Wi-Fi randomization can change what address is presented.

MAC Address — Quick Revision

MAC ADDRESS │ Media Access Control │ 48-bit │ AA:BB:CC:DD:EE:FF │ Layer 2 / Link │ ┌───────┴───────┐ ↓ ↓ Switch ARP ↓ ↓ Local forwarding IPv4 → MAC

The easiest way to remember:

MAC = local/link-layer identity
IP = logical network address
Port = application endpoint

Example:

MAC → AA:BB:CC:DD:EE:FF IP → 192.168.1.10 Port → 443

Together, these concepts help explain how data gets from a network interface → across networks → to the correct application.

Keep learning. Keep building. Keep growing.

© 2026 Ugenz Academy