Mac OS X ipconfig

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


Hate these ads?

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 getpacket en0
op = BOOTREPLY
htype = 1
flags = 0
hlen = 6
hops = 0
xid = 1045997387
secs = 0
ciaddr = 0.0.0.0
yiaddr = 192.168.9.30
siaddr = 0.0.0.0
giaddr = 0.0.0.0
chaddr = 0:16:cb:8d:38:f7
sname =
file =
options:
Options count is 7
dhcp_message_type (uint8): ACK 0x5
subnet_mask (ip): 255.255.255.0
lease_time (uint32): 0x93a80
router (ip_mult): {192.168.9.254}
domain_name_server (ip_mult): {192.168.9.254}
server_identifier (ip): 192.168.9.254
end (none):

There are shortcuts to the items listed under "options":

$ ipconfig getoption en0 router
192.168.9.254
$ ipconfig getoption en0 domain_name_server
192.168.9.254

"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 a Mac.

Technorati tags:

Comments /MacOSX/ipconfig.html


Add your comments

Enter your email address for automatic notification of new posts here
(be sure to whitelist 'feedburner.com' if you use spam filtering)

Or use any RSS reader

Delivered by FeedBurner


ad

Views for this page
Today This Week This Month This Year  Overall
4726736110,814 25,270

Have you tried Searching this site?

Unix/Linux/Mac OS X support by phone, email or on-site: Support Rates

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more. We appreciate comments and article submissions.

Publishing your articles here

pavatar.jpg
More:
       - MacOSX




Unix/Linux Consultants

Your ad here - $24.00 yearly!

SCO, OpenServer, UnixWare, software, servers, security, networks, installation, administration, troubleshooting, maintenance, Watchguard, firewalls, VPNs, e-mail. Visit us at http://opensystemscomputing.com and www.go2unix.com.


http://www.cleverminds.net Need expert advice? Want a second opinion? CleverMinds is a one-stop-shop for a wide range of technology solutions. We support Unix, Linux, SCO as well as CMS, ecom, blogs, podcasts, search engines consulting and more. Contact us at web2.0@cleverminds.net 0r (617) 894-1282


http://www.loch-raven.com/ Over 18 years of experience Unix and Linux servers. Linux and Unix consulting, system administration, remote administration, custom scripting, web desing and hosting.









Change Congress


Related Posts