On this pageWindows: Command Prompt
A MAC address is the 48-bit hardware address of a network interface. Switches and access points use it to deliver frames on the local network segment; it never travels across the internet, because every router rewrites that layer on the way. You need it for DHCP reservations, for software licenses tied to a machine, for matching interfaces in network configuration files, and for working out which device holds an IP on a LAN. Here is how to read it on Windows and Linux, how to decode it, and what to watch for on a virtual server.
Windows: Command Prompt
Two built-in commands cover nearly every case:
getmac /v /fo list
ipconfig /all
getmac /v /fo list prints each adapter's connection name, model and physical address, one block per adapter, including adapters that are currently disconnected. ipconfig /all lists the Physical Address next to the IP addresses, gateway and DNS servers of each adapter, which makes it the quickest way to match a MAC to an IP. getmac can also query another Windows machine you have rights on: getmac /s server01 /u admin asks for the password, then lists that machine's adapters.
Windows: PowerShell
PowerShell returns objects you can filter and export:
Get-NetAdapter | Select-Object Name, InterfaceDescription, MacAddress, Status, LinkSpeed
Get-NetAdapter -Physical
Get-NetIPConfiguration | Select-Object InterfaceAlias, IPv4Address, @{n='MAC'; e={$_.NetAdapter.MacAddress}}
The first line is the everyday command. -Physical hides virtual adapters such as VPN and Hyper-V switches, although on a virtual machine the "physical" adapter is itself virtual. The last line pairs each IPv4 address with its MAC.
Old guides use wmic nic get. Microsoft has removed WMIC from current Windows 11 releases and deprecated it everywhere else, so use the CIM equivalent instead:
Get-CimInstance Win32_NetworkAdapterConfiguration -Filter "IPEnabled = TRUE" |
Select-Object Description, MACAddress, IPAddress
Windows: Settings
If you prefer the GUI, open Settings > Network & internet, select Ethernet or Wi-Fi, then the adapter. The Physical address (MAC) line is in the properties list. On older builds the same information sits under the adapter's hardware properties or in Control Panel > Network Connections, by double-clicking the adapter and choosing Details.
Linux
ip link show
ip -br link
cat /sys/class/net/eth0/address
ip link show lists each interface with its address on the link/ether line. ip -br link prints one line per interface: name, state, MAC. Reading /sys/class/net/NAME/address is handy in scripts; replace eth0 with your interface name, which on modern systems is often ens3, enp1s0 or similar. Where the driver reports it, ethtool -P eth0 shows the permanent hardware address, which can differ from the current one if software changed it.
How to read a MAC address
A MAC address is six bytes. Windows writes it with hyphens and capitals (00-15-5D-0A-1B-2C), Linux with colons and lower case (00:15:5d:0a:1b:2c); both mean the same thing. The first three bytes are the OUI, a prefix the IEEE assigns to a manufacturer, which you can look up in the IEEE's public registry.
Two bits in the first byte carry meaning:
- Locally administered. If the second hex digit is 2, 6, A or E, the address was set by software rather than burned in by the manufacturer. Randomized Wi-Fi addresses and many virtual adapters look like this.
- Multicast. If the first byte is odd, the address names a group, not one interface. A network card's own address always has an even first byte.
Virtual platforms have recognizable defaults, which help when you are not sure what you are logged in to:
| Prefix | Usual source |
|---|---|
52:54:00 |
QEMU and KVM default |
00:15:5D |
Microsoft Hyper-V |
00:50:56 or 00:0C:29 |
VMware |
08:00:27 |
Oracle VirtualBox |
00:16:3E |
Xen |
Treat these as hints: a platform can assign any address it likes.
The MAC can also surface inside IPv6 addresses. Older setups built the interface half of an IPv6 address from it (the EUI-64 format, recognizable by ff:fe in the middle), which leaked the hardware address to every site you visited. That is why current systems default to randomized or stable-privacy IPv6 addresses instead.
Why the MAC matters on a server
On a virtual server, the hypervisor assigns the MAC to the virtual network card, and it normally stays the same for as long as that card exists. Depending on the platform, it can change when the card is recreated, for example after cloning a server. That has side effects worth knowing:
- Network configuration that matches by MAC. Netplan files generated by cloud-init on Ubuntu often contain a
match: macaddress:rule withset-name:. A clone with a new MAC no longer matches, and comes up without network. - Windows adapter settings. Static IP settings belong to the adapter instance. A replaced card shows up as a new adapter, often named
Ethernet 2, with default settings. - Licenses. Some license servers bind to a MAC as the host ID. Check before moving such software to a new machine.
To see which device on a LAN holds an IP, read the neighbor table: arp -a or Get-NetNeighbor -AddressFamily IPv4 on Windows, ip neigh on Linux. On a virtual server this table usually holds little more than the gateway.
Changing a MAC address, and why not to on a VPS
You can override the address in software. On Windows, Set-NetAdapter -Name "Ethernet" -MacAddress "02-11-22-33-44-55" does it from PowerShell, and the adapter's Advanced tab in Device Manager offers a Network Address field on most drivers. On Linux:
sudo ip link set dev eth0 down
sudo ip link set dev eth0 address 02:11:22:33:44:55
sudo ip link set dev eth0 up
Use a locally administered address (starting with 02) so it cannot clash with a manufacturer's range. On a cloud server, do not do this at all. Provider networks commonly drop traffic from addresses they did not assign, so the server goes offline until you revert the change from a console. If that happens on CloudSat, the rescue or VNC console, available on request, gets you back in (recovery tools).
On laptops the reverse problem appears: Windows 10 and 11 can use random hardware addresses for Wi-Fi, set under Settings > Network & internet > Wi-Fi. That protects privacy on public networks but breaks DHCP reservations at home or in the office, so turn it off for networks where a fixed address matters.
FAQ
Can websites see my MAC address?
Not from the network frames. The MAC is only used between your device and the next hop, and every router replaces it, so a web server sees the address of the last router in front of it. The one leak was the old EUI-64 style of IPv6 address described above, which current systems no longer use by default.
Can two devices have the same MAC address?
They should not, but it happens, most often with cloned virtual machines or reused images. On the same network segment, duplicates cause intermittent connectivity as switches keep relearning where the address lives. Give one of them a new address.
Why does getmac show no address for an adapter?
The adapter is disabled, unplugged or not bound to TCP/IP. Check its status with Get-NetAdapter, and enable it with Enable-NetAdapter -Name "Ethernet" if it was turned off.
Run it on CloudSat. Cloud VPS on AMD EPYC and NVMe from $1.98/mo in 13 regions, delivered in under 5 minutes and paid in crypto. See plans or deploy a server.




