What is an IP Address?
An IP address (Internet Protocol address) is a logical address assigned to a device to identify it on a network and enable routing across networks, like the internet. Think of it as your device's “home address” that helps data find its way across cities (networks).
Key Features:
- Layer: Operates at the Network Layer (Layer 3) of the OSI model.
- Format: IPv4 (e.g., 192.168.1.1) or IPv6 (e.g., 2001:db8::1).
- Assignment: Can be static (manually set) or dynamic (assigned via DHCP).
- Scope: Used for routing between networks, like sending data from your laptop to a website.
Router(config)# interface GigabitEthernet0/0
Router(config-if)# ip address 192.168.1.1 255.255.255.0
Router(config-if)# no shutdown
Tip: Check a device’s IP address with ipconfig (Windows) or ifconfig (Linux) to see its network identity.
What is a MAC Address?
A MAC address (Media Access Control address) is a physical address embedded in a device’s network interface card (NIC). It’s like a device’s “fingerprint,” used to identify it within a local network.
Key Features:
- Layer: Operates at the Data Link Layer (Layer 2) of the OSI model.
- Format: 48-bit address, usually written as six pairs of hexadecimal digits (e.g., 00:1A:2B:3C:4D:5E).
- Assignment: Hard-coded by the manufacturer, though it can be spoofed.
- Scope: Used within a single network (e.g., a LAN) for device-to-device communication.
Switch# show mac address-table
Mac Address Table
-------------------------------------------
Vlan Mac Address Type Ports
---- ----------- -------- -----
10 00:1A:2B:3C:4D:5E DYNAMIC Gi0/1
Tip: Tip: Use show mac address-table on a Cisco switch to map MAC addresses to ports.
How They Work Together
IP and MAC addresses team up to get data from one device to another. When you send data (e.g., visiting a website), the IP address guides the packet across networks, while the MAC address handles delivery within the local network. This process relies on the Address Resolution Protocol (ARP), which maps IP addresses to MAC addresses.
The PC uses ARP to find the server’s MAC address:
Router# show arp
Protocol Address Age (min) Hardware Addr Type Interface
Internet 192.168.1.10 0 00:1A:2B:3C:4D:5E ARPA GigabitEthernet0/0
Internet 192.168.1.100 5 00:2B:3C:4D:5E:6F ARPA GigabitEthernet0/0
Tip: Use show arp to troubleshoot connectivity issues when devices can’t communicate locally.
Real-World Example: Small Office Network
Imagine you're setting up a small office network with a Cisco router and switch. You assign IP addresses to devices (e.g., 192.168.1.0/24) for routing, and the switch uses MAC addresses to forward frames between PCs. If a PC can't reach the server, you'd check the IP configuration with show ip interface brief and the MAC address table to ensure correct port assignments.
Tip: Simulate this in Packet Tracer to see how IP and MAC addresses interact in a LAN.
Frequently Asked Questions
Can a device have multiple IP or MAC addresses?
Yes! A device with multiple interfaces (e.g., a router) can have multiple IP addresses, and each NIC has its own MAC address.
Why do IP addresses change but MAC addresses don't?
IP addresses are logical and can be reassigned (e.g., by DHCP), while MAC addresses are physically tied to the hardware.
How do I find my device's addresses?
Use ipconfig or ifconfig for IP addresses, and check the MAC address via the device's network settings or Cisco's show mac address-table.