
Scroll through the output to find the interface you want to set and renew DHCP for, let’s assume you’re looking for “Wi-Fi” which may look like this:Īlongside ‘Device’ you’ll find the interface, in this case it’s “en0”, which is what gets plugged into the aforementioned ipconfig command. You can easily determine what the device interface is by running networksetup -listallhardwareports like so: For most modern Macs, we’re looking for wi-fi which is typically on en0, but many Mac users use ethernet, an iPhone personal hotspot, a tethered Android phone, or an external NIC card as well, each of which may have a different device interface depending on the hardware. If you don’t know the interface, then the first step is to determine the computers hardware device interface used for the particular networking port you’re using.

It’s best to set DHCP for the specific interface, however. Sudo ipconfig set en0 DHCP & sudo ipconfig set en1 DHCP
#Ip config for mac mac os x#
If you momentarily forget where you are at a Mac OS X terminal session, you might type 'ipconfig /all' or something equally Windowish. If the DHCP info returns blank, then either the interface queried was wrong, or the DHCP lease did not renew or distribute properly.Īnother crude option would be to run ipconfig for all available device interfaces on the Mac by stringing the syntax together like so: ipconfig on Mac is not like the Windows command of the same name, but is still very useful.

Assuming the prior ‘set’ command was successful, getpacket will return the DHCP assigned IP, DNS server, subnet mask, router / gateway, and the lease time.
