The ipconfig utility, with the /all switch, is often used to find the MAC address (the 6-byte 'burned-in' physical/hardware address) of network adapters. While this does the job, the output shows a plethora of information as mentioned above. IPCONFIG COMMAND LINE SWITCHES Reporting Displays no switch IP, subnet mask & default gateway addresses /all the above + hostname, MAC address, DNS server addresses, etc. /displaydns contents of.
Mac OS X ipconfig
© May 2019 Anthony Lawrence
Ipconfig All Find Mac Address
July 2006
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
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:
What Does Ipconfig Release Do
$ 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):
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
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.
Got something to add? Send me email.
(OLDER) <- More Stuff -> (NEWER) (NEWEST)
Printer Friendly Version
-> -> Mac OS X ipconfig
Inexpensive and informative Apple related e-books:
Digital Sharing Crash Course
Are Your Bits Flipped?
Take Control of Automating Your Mac
Take Control of High Sierra
Take Control of Apple Mail, Third Edition
How to get your local IP address with Ipconfig equivalent for Mac OS X
Ipconfig Mac – Just like you you can open command prompt in Windows and hit “ipconfig” to get your local LAN/WLAN IP address, you have the same option on a Mac in OS X with the command “ifconfig”.
Simply open up the terminal, eg. by pressing cmd+space and typing “terminal”.
Then type “ifconfig” and hit enter.
Then type “ifconfig” and hit enter.
How to get your local IP address from System Preferences
Another option to get your local IP address on a Mac is to click the Apple logo in the taskbar, then click “System Preferences”, type “Network” and hit enter. This will open up a graphical view, which shows you your local IP address as illustrated: