mac_addresses - dwilson2547/wiki_demo GitHub Wiki
-
Detailed Explanation of MAC Addresses
- 1. What Is a MAC Address?
- 2. MAC Address Format
- 3. How MAC Addresses Are Assigned
- 4. What Are MAC Addresses Used For?
- 5. MAC Addresses vs. IP Addresses
- 6. How MAC Addresses Work in Network Communication
- 7. MAC Address Spoofing
- 8. MAC Address Randomization
- 9. Common Uses of MAC Addresses
- 10. Security Implications of MAC Addresses
- 11. Tools to Find MAC Addresses
- 12. MAC Addresses in Virtualization
- 13. MAC Addresses in IoT Devices
- 14. Future of MAC Addresses
- 15. Summary Table: MAC Addresses
- 16. Conclusion
A Media Access Control (MAC) address is a unique identifier assigned to a Network Interface Card (NIC) or network interface of a device. It is a hardware address used to identify devices on a local network segment.
- Unique Identifier: Each NIC has a globally unique MAC address.
- Hardware Address: Assigned by the manufacturer during production.
-
48-Bit Address: Typically represented as a 12-digit hexadecimal number (e.g.,
00:1A:2B:3C:4D:5E
). - Permanent (Mostly): MAC addresses are usually burned into the hardware but can sometimes be spoofed or changed via software.
- A MAC address is 48 bits long.
- It is divided into 6 groups of 2 hexadecimal digits, separated by colons (
:
), hyphens (-
), or no separator.- Example:
00:1A:2B:3C:4D:5E
- Example:
00-1A-2B-3C-4D-5E
- Example:
001A.2B3C.4D5E
(Cisco format)
- Example:
-
OUI (Organizationally Unique Identifier):
- The first 24 bits (3 bytes) of the MAC address.
- Assigned by the IEEE (Institute of Electrical and Electronics Engineers) to manufacturers.
- Example:
00:1A:2B
(OUI for a specific manufacturer).
-
NIC-Specific Identifier:
- The last 24 bits (3 bytes) of the MAC address.
- Assigned by the manufacturer to uniquely identify each NIC.
- Example:
3C:4D:5E
.
- The IEEE assigns OUIs to manufacturers.
- Manufacturers assign the remaining 24 bits to each NIC they produce.
- Example: A NIC from Intel might have a MAC address starting with
00:1A:2B
, where00:1A:2B
is Intel’s OUI.
- Static MAC Addresses: Permanently assigned by the manufacturer.
- Dynamic MAC Addresses: Some devices allow MAC address spoofing or randomization (e.g., for privacy).
- MAC addresses uniquely identify devices on a local network (e.g., Ethernet or Wi-Fi).
- Used by switches and routers to forward data to the correct device.
- Ethernet Frames: MAC addresses are used in the source and destination fields of Ethernet frames.
- Wi-Fi Frames: MAC addresses identify devices in 802.11 (Wi-Fi) frames.
-
ARP maps IP addresses to MAC addresses on a local network.
- Example: When Device A wants to send data to Device B, it uses ARP to find Device B’s MAC address.
- MAC Filtering: Routers and access points can allow or block devices based on their MAC addresses.
- Authentication: Some networks use MAC addresses for device authentication.
- Identifying Devices: MAC addresses help network administrators identify and troubleshoot devices.
- Tracking Devices: Used in network logs to track device activity.
Feature | MAC Address | IP Address |
---|---|---|
Type | Hardware address (Layer 2). | Logical address (Layer 3). |
Assignment | Assigned by the manufacturer (static) or randomized (dynamic). | Assigned by a network (DHCP) or manually configured. |
Scope | Local network segment (LAN). | Global (Internet-wide). |
Format | 48-bit hexadecimal (e.g., 00:1A:2B:3C:4D:5E ). |
32-bit (IPv4) or 128-bit (IPv6) decimal/hexadecimal (e.g., 192.168.1.1 ). |
Purpose | Identifies devices on a local network. | Identifies devices on the internet. |
Protocol | Used in Ethernet, Wi-Fi, and other Layer 2 protocols. | Used in IP (Internet Protocol). |
Changeability | Usually permanent but can be spoofed. | Can change (e.g., DHCP lease renewal). |
Example | 00:1A:2B:3C:4D:5E |
192.168.1.100 |
- Device A wants to send data to Device B on the same local network.
- Device A knows Device B’s IP address but not its MAC address.
-
Device A sends an ARP request to the network:
ARP Request: "Who has IP 192.168.1.100? Tell 192.168.1.101."
-
Device B responds with its MAC address:
ARP Reply: "192.168.1.100 is at MAC 00:1A:2B:3C:4D:5E."
- Device A now knows Device B’s MAC address and can send the Ethernet frame.
- In Wi-Fi networks, MAC addresses identify devices in 802.11 frames.
- Access points use MAC addresses to manage connections and filter devices.
- MAC spoofing is the practice of changing a device’s MAC address to impersonate another device or bypass security measures.
- Bypass MAC Filtering: Some networks only allow devices with specific MAC addresses.
- Privacy: Randomizing MAC addresses can prevent tracking.
- Testing: Network administrators may spoof MAC addresses for testing.
-
Windows:
# Disable the network interface netsh interface set interface "Ethernet" admin=disable # Set a new MAC address netsh interface set interface "Ethernet" newmac=00:1A:2B:3C:4D:5E # Re-enable the interface netsh interface set interface "Ethernet" admin=enable
-
Linux:
# Disable the network interface sudo ifconfig eth0 down # Set a new MAC address sudo ifconfig eth0 hw ether 00:1A:2B:3C:4D:5E # Re-enable the interface sudo ifconfig eth0 up
-
macOS:
# Disable the network interface sudo ifconfig en0 ether 00:1A:2B:3C:4D:5E # Re-enable the interface sudo ifconfig en0 up
- MAC randomization is a technique where a device changes its MAC address periodically to enhance privacy.
- Commonly used in Wi-Fi networks to prevent tracking.
- Privacy: Prevents advertisers or malicious actors from tracking devices.
- Security: Makes it harder for attackers to target specific devices.
- Smartphones: iOS and Android randomize MAC addresses when scanning for Wi-Fi networks.
- Laptops: Windows, macOS, and Linux support MAC randomization.
- IoT Devices: Some IoT devices use MAC randomization for privacy.
Use Case | Description |
---|---|
Device Identification | Uniquely identifies devices on a local network. |
Ethernet Framing | Used in Ethernet frames to specify source and destination devices. |
Wi-Fi Communication | Identifies devices in Wi-Fi networks. |
ARP (Address Resolution) | Maps IP addresses to MAC addresses for local communication. |
Network Security | Used in MAC filtering to allow or block specific devices. |
Network Troubleshooting | Helps administrators identify and diagnose network issues. |
DHCP Leases | MAC addresses are used by DHCP servers to assign IP addresses to devices. |
Wake-on-LAN | MAC addresses are used to send "magic packets" to wake up devices remotely. |
Device Tracking | Used in network logs to track device activity and usage. |
- Pros: Can restrict network access to specific devices.
- Cons: Easily bypassed via MAC spoofing.
- Attack: An attacker floods a switch with fake MAC addresses to overflow its MAC address table.
- Result: The switch enters fail-open mode and broadcasts traffic to all ports, enabling sniffing attacks.
- Tracking: MAC addresses can be used to track devices across networks.
- Mitigation: Use MAC randomization to enhance privacy.
-
Windows:
ipconfig /all
- Look for the Physical Address under your network adapter.
-
Linux/macOS:
ifconfig
- Look for the ether or HWaddr field.
-
Linux (ip command):
ip link show
- Look for the link/ether field.
-
arp
Command:arp -a
- Lists MAC addresses of devices on the local network.
-
nmap
:nmap -sn 192.168.1.0/24
- Scans the local network for devices and their MAC addresses.
- VMs have virtual NICs with their own MAC addresses.
- Example: A VM in VirtualBox or VMware will have a MAC address assigned by the hypervisor.
- Docker containers can have virtual MAC addresses assigned to their virtual network interfaces.
- IoT devices (e.g., smart home devices, sensors) use MAC addresses for local network communication.
- Security Risks: Many IoT devices have default or predictable MAC addresses, making them vulnerable to attacks.
-
IPv6 uses EUI-64 to generate interface IDs from MAC addresses.
- Example: A MAC address
00:1A:2B:3C:4D:5E
can be converted to an IPv6 interface ID:021A:2BFF:FE3C:4D5E
- Example: A MAC address
- Randomized Interface IDs (RFC 4941): IPv6 supports randomized interface IDs to enhance privacy.
- MAC Randomization: Increasingly used in Wi-Fi and Bluetooth to prevent tracking.
- SDN may reduce reliance on MAC addresses by using virtual networks and software-defined identifiers.
Aspect | Details |
---|---|
Definition | Unique identifier for network interfaces. |
Format | 48-bit hexadecimal (e.g., 00:1A:2B:3C:4D:5E ). |
OUI | First 24 bits assigned by IEEE to manufacturers. |
NIC-Specific | Last 24 bits assigned by the manufacturer. |
Usage | Device identification, Ethernet/Wi-Fi communication, ARP, network security. |
vs. IP Addresses | MAC: Layer 2 (local), IP: Layer 3 (global). |
Spoofing | Changing a device’s MAC address to impersonate another device. |
Randomization | Changing MAC addresses periodically for privacy. |
Tools |
ipconfig /all , ifconfig , arp -a , nmap . |
Security Risks | MAC flooding, spoofing, tracking. |
Future Trends | IPv6 EUI-64, privacy extensions, SDN. |
MAC addresses are fundamental to network communication, enabling devices to identify and communicate with each other on local networks. They play a critical role in Ethernet, Wi-Fi, ARP, and network security.
While MAC addresses are essential, they also pose security and privacy risks. Techniques like MAC spoofing, randomization, and filtering are used to mitigate these risks.
With the rise of IPv6, SDN, and privacy-enhancing technologies, the role of MAC addresses may evolve, but they will remain a core component of network communication.
MAC addresses are a cornerstone of networking, enabling devices to communicate efficiently and securely. Understanding how they work, their uses, and their limitations is essential for network administrators, developers, and security professionals.
Would you like to explore how to troubleshoot MAC address conflicts, how MAC addresses are used in cybersecurity, or how to implement MAC filtering on a router?