Macos – Release/renew IP address via Terminal in OS X

command linedhcpmacosterminal

I am looking to release and renew my IP address in OS X 10.4 (Tiger) using Terminal. Essentially, I need the OS X equivalent of Windows':

C:\\> ipconfig /release  
C:\\> ipconfig /renew

However, I need the interface to remain active during this process, so using ifconfig down/up will not work.

I believe I can clear the IP address with ifconfig <interface> delete, but I'm not sure how to get the DHCP client to reassign the address. An article from 2002 suggests using set dhcp, but Apple's ifconfig man page does not include this information.

Best Answer

sudo ipconfig set en0 BOOTP
sudo ipconfig set en0 DHCP

Should do it.


Sources: