Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I come from the land of windows, where the ipconfig command shows four important pieces of information: IP address, netmask, gateway address, and MAC address.

However, on a Mac, ifconfig only shows IP address and MAC address.

Where can I find the gateway address (e.g. and the netmask (e.g.

share|improve this question
up vote 9 down vote accepted

With ifconfig on OS X you can find netmask :

inet netmask 0xffffff00 broadcast

netmask 0xffffff00 means

And for finding gateway address use arp -a or as geekosaur said use netstat -nr | grep '^default'.

share|improve this answer

On most Unix-like systems, including OSX, that information comes from netstat -r (r for "route").

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.