Fix the “Wi-Fi Does Not Have an IP Address” Error on MacBook

Updated

macbook wifi no ip address

Run ipconfig getifaddr en0. Silence with exit status 1 means no IPv4 address at all; an answer starting 169.254. means DHCP failed and macOS assigned a link-local address itself. Fix it with sudo ipconfig set en0 DHCP, which forces a fresh DHCP transaction without touching any of your saved networks. See ipconfig and ifconfig in Mac Terminal for what these commands do.

$ ipconfig getifaddr en0
192.168.x.90
$ echo $?
0

That is a healthy machine. On a broken one ipconfig getifaddr en0 prints nothing and exits 1, and this is the whole diagnosis — everything below is about which of the four causes you have. (The address it prints is the local one — a different number from the public address a website sees, worth having straight before you conclude anything is broken.)

First, confirm en0 is really your Wi-Fi

It usually is on a MacBook, but not on every Mac, and picking the wrong interface wastes an hour:

$ networksetup -listallhardwareports
Hardware Port: Wi-Fi
Device: en0
Ethernet Address: 60:3e:5f:[redacted]

$ networksetup -listallnetworkservices
An asterisk (*) denotes that a network service is disabled.
USB 10/100/1000 LAN
Thunderbolt Bridge
Wi-Fi

The symptom, in one command

macOS assigns a 169.254.x.x address when DHCP times out. Apple’s own ipconfig(8) man page describes it: “It may also allocate and assign a link-local IP address if DHCP fails to acquire an IP address.” So:

$ ifconfig | grep "inet 169.254"
$ echo $?
1

No output is the good result. Any output there is your answer, and it means the router never completed a DHCP handshake with this Mac.

The other shape of the failure is a service with no IPv4 line at all. Compare a working Wi-Fi service with a physically disconnected one on the same machine:

$ networksetup -getinfo "Wi-Fi"
DHCP Configuration
IP address: 192.168.x.90
Subnet mask: 255.255.2xx.0
Router: 192.168.x.1

$ networksetup -getinfo "Thunderbolt Bridge"
DHCP Configuration
Client ID:
IPv6: Automatic
IPv6 IP address: none

That second block — “DHCP Configuration” with no IP address, no subnet mask, no router — is exactly what your Wi-Fi service prints when it says “Wi-Fi does not have an IP address.”

Read the actual DHCP lease

If you do have an address, this tells you where it came from and how long it’s good for, which settles arguments about whether the router or the Mac is at fault:

$ ipconfig getpacket en0
dhcp_message_type (uint8): ACK 0x5
server_identifier (ip): 192.168.x.1
lease_time (uint32): 0x1c20
subnet_mask (ip): 255.255.2xx.0
router (ip_mult): {192.168.x.1}
domain_name_server (ip_mult): {8.8.8.8, 8.8.4.4}

0x1c20 is 7200 seconds. Individual options come out cleaner one at a time:

$ ipconfig getoption en0 router
192.168.x.1
$ ipconfig getoption en0 lease_time
7200

And ipconfig getsummary en0 prints the lease window in plain text — LeaseStartTime : 08/10/2026 00:02:28 / LeaseExpirationTime : 08/10/2026 02:02:28 here. A lease that expired and never renewed is the classic overnight “it worked yesterday” failure.

The fix

$ ipconfig set en0 DHCP
ipconfig_set en0 DHCP failed: permission denied
$ echo $?
1

$ sudo ipconfig set en0 DHCP

It prints nothing on success. Give it a couple of seconds and re-run ipconfig getifaddr en0. This is the command-line equivalent of the “Renew DHCP Lease” button in System Preferences. Note that Apple’s man page calls ipconfig a test and debug tool and says “using it for any other purpose is strongly discouraged.” It’s fine for this; it isn’t something to put in a login script.

Four causes, in the order they’re worth checking

1. A stale lease or a stuck DHCP client. The renew above fixes this. If it doesn’t, the client’s cached lease files are under /var/db/dhcpclient/leases/ (root only — ls as yourself returns “Permission denied”). Deleting the file for your interface and renewing forces a full DISCOVER instead of a REQUEST for the old address.

2. Private Wi-Fi Address versus a router MAC allow-list. This is the cause that has grown since 2015 and that no older guide mentions. macOS presents a per-network random MAC by default, and it is not your hardware address:

hardware (networksetup): 60:3e:5f:[redacted]
in-use   (ifconfig en0):  fa:ce:6f:[redacted]

(Only the last three octets of each address are redacted above; the point of the block is that the two differ, and they do. Your own hardware address is a permanent, globally unique identifier for that Wi-Fi chip — worth not pasting into a forum post when you ask for help.)

If your router only hands out addresses to known MACs, or your workplace binds a reservation to your real one, DHCP gets ignored and you land at 169.254. Turn it off for that network only: System Settings > Wi-Fi > Details next to the network > Private Wi-Fi Address > Off. (GUI-only; there is no supported command-line switch for a single network.)

3. The router’s DHCP pool is full. Nothing on the Mac will fix this. Reboot the router or widen the pool.

4. VPN or filtering software holding the interface. Check what’s actually claiming the routing table before you start deleting network locations:

$ netstat -rn -f inet | head -4
Destination        Gateway            Flags               Netif Expire
default            192.168.x.1       UGScg                 en0

$ scutil --nwi
   en0 : flags      : 0x5 (IPv4,DNS)
         address    : 192.168.x.90
         reach      : 0x00000002 (Reachable)

A default route pointing at a utun interface while en0 has no address is a VPN problem, not a Wi-Fi problem.

Two things that stopped working, so you don’t waste time

The airport command-line tool that every older troubleshooting guide uses was removed — /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport does not exist on macOS 26. And SSID reads now require Location Services authorization, so a Mac that is definitely connected will still tell you it isn’t:

$ networksetup -getairportnetwork en0
You are not associated with an AirPort network.

$ system_profiler SPAirPortDataType | grep -A3 "Current Network"
          Current Network Information:
            <redacted>:
              PHY Mode: 802.11ax
              Channel: 48 (5GHz, 160MHz)

Neither is a connection problem — the same machine has a working DHCP lease and a default route. The literal string <redacted> is macOS withholding the SSID from a process that hasn’t been granted Location Services access; give your terminal app Location access under System Settings > Privacy & Security > Location Services if you need the network name in a script. Don’t read either of these outputs as evidence your Wi-Fi is down.

Photo of author
Sudhir P. founded HeatWare.com in 1999 and has built and operated it full-stack ever since; it is now used by more than 88,000 people. He writes here about the PostgreSQL, MySQL, Linux and DevOps work that keeps it running. Articles are rewritten only after the commands in them have actually been run, and the verification scripts are published alongside them so anyone can check the claims. Reach him at blog@heatware.net.