LightAtom

How to Renew a DHCP Lease on Mac

Ask your router for a fresh IP address: useful after a self-assigned 169.254 address, an IP conflict or a router change.

sudo ipconfig set en0 DHCP

Renew the DHCP lease on en0 (Wi-Fi on most Macs).

beginner2 min

When to use it

Renew the lease when your Mac shows a self-assigned 169.254.x.x address, after an IP address conflict, after changing router settings, or when “connected but no internet” might be an address problem.

Steps

  1. In System Settings

    System Settings › Network › Wi-Fi › Details › TCP/IP › Renew DHCP Lease. The IP address may change.
  2. In Terminal

    Use the interface name (en0 for Wi-Fi on most Macs).
    sudo ipconfig set en0 DHCP
  3. Check the new lease

    getpacket prints the DHCP details your router sent.
    ipconfig getpacket en0

Output explained

Relevant lines from ipconfig getpacket en0:

yiaddr = 192.168.1.23
lease_time (uint32): 0xe10
subnet_mask (ip): 255.255.255.0
router (ip_mult): {192.168.1.1}
domain_name_server (ip_mult): {192.168.1.1}
  • yiaddr (“your IP address”) is the address assigned to your Mac.
  • lease_time is in hexadecimal seconds: 0xe10 = 3600, one hour. Your Mac renews automatically halfway through.
  • router and domain_name_server are the gateway and DNS server the router told your Mac to use.

Options and variations

FlagMeaningExample
ipconfig set IF DHCPRenew / switch to DHCP (sudo)sudo ipconfig set en0 DHCP
ipconfig getpacket IFShow the DHCP leaseipconfig getpacket en0
ipconfig getifaddr IFShow only the IPipconfig getifaddr en0

Common errors

ErrorCauseFix
Still 169.254.x.x after renewingThe router's DHCP isn't answeringRestart the router; check its DHCP pool and MAC filtering.
getpacket prints nothingNo DHCP lease on that interfaceCheck the interface name with route -n get default.

Do it in the app

After a renew, LightAtom's connections view shows your apps reconnecting.

Frequently asked questions

How do I renew my IP address on a Mac?

System Settings › Network › Wi-Fi › Details › TCP/IP › Renew DHCP Lease, or sudo ipconfig set en0 DHCP in Terminal.

Is there an ipconfig /release on Mac?

Not the Windows command. sudo ipconfig set en0 NONE releases the address and sudo ipconfig set en0 DHCP gets a new lease.

Will renewing the lease change my IP address?

Usually you get the same address back, since routers remember devices. With Private Wi-Fi Address set to Rotating, the router may see a new device and assign a new address.

LightAtom team

The people who build LightAtom, a network monitor for macOS.