If you momentarily forget where you are at a Mac OS X terminal
session, you might type "ipconfig /all" or something equally
Windowish. You will get a response:
usage: ipconfig <command> <args>>
where <command> is one of waitall, getifaddr, ifcount, getoption, getpacket, set, setverbose
What's this? You already know you mistyped: on Mac OS X you
probably meant to run "ifconfig -a" just as you would on Linux. But
"ipconfig" is different, and is actually something good
to have in your bag of tricks.
The first thing ipconfig can do for you is quickly give you all
your dhcp info:
"ipconfig getifaddr en0" is a quick way to just get the ip address.
You can also use ipconfig with its "set" options to change an interface
from DHCP to manual or vice-versa. That's temporary; it doesn't
write any start up files.
If you are having difficulty with DHCP, ipconfig has one more use: you can (as root) set verbose
logging with "ipconfig setverbose 1". With that set, you get
minor debugging info written to syslog (/var/log/system.log on my system)
, but you also get a separate
BOOTP/DHCP log in /var/log/com.apple.IPConfiguration.bootp that
shows the full BOOTREQUEST/BOOTREPLY packet negotiation.
Think of ipconfig the next time you are looking for DHCP info on