Ipconfig For Mac Terminal

When Terminal has launched, type the following command: ipconfig getifaddr en0 (to find your IP address if you are connected to a wireless network) or ipconfig getifaddr en1 (if you are connected to an Ethernet). If you are using Mac OS X, the command ipconfig grep inet displays detailed information about your computer signification in the. In windows I can use ipconfig /all and this displays all the info about my connection. In terminal using ifconfig does not and only supplies limited info. I can use network manager, but it would be useful to know the command line alternative. So my question is: what is the command line to supply ip address, gateway, subnet mask, DNS the same way ipconfig /all supplies in Windows. View All Network Setting. The “ifconfig” command with no arguments will display all the active.

Ipconfig For Mac TerminalIpconfig For Mac TerminalIpconfig For Mac Terminal

Mac OS X ipconfig

Ipconfig In Windows 10

© May 2019 Anthony Lawrence

Ipconfig For Mac Terminal

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

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:


Linux Ipconfig

$ ipconfig getpacket en0
htype = 1
flags = 0
hlen = 6
hops = 0
xid = 1045997387
secs = 0
ciaddr =
yiaddr =
siaddr =
giaddr =
chaddr = 0:16:cb:8d:38:f7
sname =
file =
Options count is 7
dhcp_message_type (uint8): ACK 0x5
subnet_mask (ip):
lease_time (uint32): 0x93a80
router (ip_mult): {}
domain_name_server (ip_mult): {}
server_identifier (ip):
end (none):

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

$ ipconfig getoption en0 router
$ ipconfig getoption en0 domain_name_server

'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.

Ipconfig For Mac Terminal

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

Mac Terminal Commands

Ipconfig For Mac Terminal Adapter

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