How to "refresh" DHCP Address via the Terminal?
Hey everyone!
When using Windows, one can release/refresh a machine's DHCP address by opening up a cmd-shell and entering "ipconfig /release" and "ipconfig /renew".
Is there any way to accomplish this via the MacOS X Terminal?
Greetings to everyone!
durandal
When using Windows, one can release/refresh a machine's DHCP address by opening up a cmd-shell and entering "ipconfig /release" and "ipconfig /renew".
Is there any way to accomplish this via the MacOS X Terminal?
Greetings to everyone!
durandal
Comments
sudo ipconfig set en0 DHCP
If you are wireless:
sudo ipconfig set en1 DHCP
Now this assume you've set up the root user. If so, sudo will ask for your password.
You can alias this command to whatever you like.
Ask if you have further questions about the above.
Originally posted by johnq
If physically plugged into a network:
sudo ipconfig set en0 DHCP
nope, that's it - thanks a bunch
durandal
Is there a way to reset an AirPort Base Station from the command line? Mine craps out far too often.
Originally posted by bunge
johnq,
Is there a way to reset an AirPort Base Station from the command line? Mine craps out far too often.
Good question. My comcast is always blinking out on me and requires a refresh. With a base station it would be even more of a pain in the ass.
The point is, you can then get to the router via a web interface and configure/reset/manage it all you want. Airport (I believe; from my experience) can configure itself based on what it is sent via the router.
Airport for me has never needed manipulation aside from initial setup and occasional user blocking (when roomates don't pay their share
Not a guru, but I know what I have works great
For example: network.jpg
Originally posted by fatmac84
A fast and easy way to do this is to use the control panel. Change the TCP/IP setting to configue Manually. Hit apply. Then change back to configure Using DHCP and hit Apply again.
Jap, I know. But I wanted to automate this via AppleScript - and using some shell command for it results in a simple one-liner:
do shell script "sudo ipconfig set en0 DHCP" with administrator previliges password "[your password here]"
thanks anyway
durandal