Mac Address | Cyber Security Tutorial - Learn with VOKS
Advance AI Bootstrap C C++ Computer Vision Content Writing CSS Cyber Security Data Analysis Deep Learning Email Marketing Excel Figma HTML Java Script Machine Learning MySQLi Node JS PHP Power Bi Python Python for AI Python for Analysis React React Native SEO SMM SQL
Back Next

Mac Address

Learn this topic step-by-step with VOKS Tutorials.

What Is a MAC Address?

A MAC Address (Media Access Control Address) is a unique identifier assigned to a device’s network interface. This includes devices like:

  • Laptop network cards
  • Desktop Ethernet cards
  • Wi-Fi adapters
  • Smartphones
  • Routers

It is used for communication within a local network (like your home or office network).

Think of a MAC address like a physical serial number for your network card. While an IP address can change, a MAC address is usually fixed to the hardware.

Where Does a MAC Address Work?

A MAC address works at Layer 2 (Data Link Layer) of the OSI model.

It is used when devices communicate inside the same local network (LAN). For example:

  • Your computer sends data to your router.
  • Your router sends data to another device inside your home network.

Before sending data, the device must know the MAC address of the destination device.

MAC Address vs IP Address (Simple Comparison)

+----------------------------+----------------------------------+
| MAC Address                | IP Address                       |
+----------------------------+----------------------------------+
| Permanent (usually)        | Can change                       |
| Hardware-based             | Software/network-based           |
| Works inside local network | Works across networks (internet) |
| 48-bit value               | 32-bit (IPv4) or 128-bit (IPv6)  |
+----------------------------+----------------------------------+


In simple words:

  • MAC address = Who exactly are you? (physical identity)
  • IP address = Where are you located in the network?

MAC Address Format

A MAC address is:

  • 48 bits long
  • Written as 6 pairs of hexadecimal numbers
  • Each pair is separated by a colon or dash

Example:

00:1A:2B:3C:4D:5E

Or

00-1A-2B-3C-4D-5E

Each pair represents 8 bits (1 byte).

Hexadecimal uses numbers 0–9 and letters A–F.

Structure of a MAC Address

Example:

00:1A:2B:3C:4D:5E

It is divided into two parts:

  1. First 3 bytes (00:1A:2B)
  • Called OUI (Organizationally Unique Identifier)
  • Identifies the manufacturer
  • Assigned by IEEE
  1. Last 3 bytes (3C:4D:5E)
  • Unique number given by the manufacturer

This ensures no two devices in the world should have the same MAC address.

How MAC Address Is Used (Step-by-Step Example)

Suppose:

  • Your computer wants to send data to your router.
  • It knows the router’s IP address.
  • But it needs the router’s MAC address to send data inside the local network.

It uses ARP (Address Resolution Protocol):

  1. Computer broadcasts:
  2. "Who has IP 192.168.1.1?"
  3. Router replies:
  4. "I am 192.168.1.1, my MAC is 00:1A:2B:3C:4D:5E"
  5. Computer stores this in ARP table.
  6. Data is sent using the MAC address.

How to Find Your MAC Address

On Windows

Open Command Prompt and type:

ipconfig /all

Look for:

Physical Address . . . . . . . . : 00-1A-2B-3C-4D-5E

On Linux

ip addr

or

ifconfig

On macOS

ifconfig

Can a MAC Address Be Changed?

Yes.

Although it is burned into hardware, most operating systems allow MAC spoofing, which means temporarily changing the MAC address in software.

Example (Linux):

sudo ip link set dev eth0 down
sudo ip link set dev eth0 address 00:11:22:33:44:55
sudo ip link set dev eth0 up

This changes the MAC address of interface eth0.

Why MAC Addresses Are Important

  1. Device identification inside a LAN
  2. Network security filtering (MAC filtering in routers)
  3. ARP communication
  4. Switch forwarding decisions

Network switches use MAC addresses to know where to send data.

How Switches Use MAC Addresses

When a switch receives a frame:

  1. It checks the source MAC address.
  2. It stores it in a MAC address table.
  3. When sending data, it checks the destination MAC.
  4. It forwards data only to the correct port.

This prevents unnecessary traffic.

Broadcast MAC Address

There is a special MAC address:

FF:FF:FF:FF:FF:FF

This means:

Send to everyone in the network.

ARP requests use broadcast MAC addresses.

Types of MAC Addresses

  1. Unicast – One device to one device
  2. Broadcast – One device to all devices
  3. Multicast – One device to a group of devices

Important Notes for Beginners

  • MAC address works only inside local network.
  • It does not travel across the internet.
  • Routers remove Layer 2 headers when forwarding traffic.
  • Your ISP does not use your MAC address to route internet traffic globally.


# Windows - View MAC Address
ipconfig /all

# Linux - View MAC Address
ip addr
ifconfig

# macOS - View MAC Address
ifconfig

# Linux - Change MAC Address (MAC Spoofing)
sudo ip link set dev eth0 down
sudo ip link set dev eth0 address 00:11:22:33:44:55
sudo ip link set dev eth0 up
QUICK KNOWLEDGE CHECK

Test Your Understanding

Answer 5 questions generated from this lesson. Your result is calculated instantly and is not saved.

0 / 5 answered
All Courses
Advance AI Bootstrap C C++ Computer Vision Content Writing CSS Cyber Security Data Analysis Deep Learning Email Marketing Excel Figma HTML Java Script Machine Learning MySQLi Node JS PHP Power Bi Python Python for AI Python for Analysis React React Native SEO SMM SQL
Course contents
Cyber Security
01 Introduction 02 Types of Cyber Threats 03 Cyber Security Domains 04 CIA Triad (Confidentiality Integrity Availability) 05 Career paths in Cyber Security 06 Certifications 07 Ethics and Responsible Disclosure 08 Laws and Regulation (e.g. GDPR, NDPR) 09 What is an OS? 10 Types: Window, Linus, macOS 11 Command-line vs GUI 12 OS Internals Overview (filesystems, processes, permissions) 13 Windows command prompt basics 14 Linux Bash Basics 15 File System Navigation 16 Basic Scripting 17 IP Addressing 18 DNS, DHCP 19 Mac Address 20 OSI VS TCP/IP Models 21 Ports and Protocols (TCP, UDP) 22 Common Protocols (HTTPS, FTP, SSH, etc.) 23 Packet structure 24 Firewalls, IDS/IPS, VPNs 25 Common attacks: MITM, Sniffing 26 Secure Network Practices 27 How the Web works 28 HTTP vs HTTPS 29 URLs, Headers, Cookies 30 Client-Server Architecture 31 Introduction To Web Security 32 OWASP Top 10 Overview 33 Common Threats (XSS, SQLi, CSRF) 34 Inpute validation and authentication flow 35 Basic Exploitation demo (e.g. XSS) 36 Burp Suite Introduction 37 Using a Browser For Testing 38 Password security 39 MFA-Antivirus 40 Cyber Hygeine Practice 41 Intro To Tools: Nmap, Wireshark, Netstat