Skip navigation
This discussion is archived

How do I find my Default Gateway from the Terminal?

8785 Views 2 Replies Latest reply: May 6, 2008 8:36 PM by edclange RSS
Lucas Clemente Level 1 Level 1 (50 points)
Currently Being Moderated
May 6, 2008 11:55 AM
I'm SSH'ed into my mac, and I want to find out what the Default Gateway address is. How do I determine this?
Powermac G5 Quad, Mac OS X (10.5.2), PPC Is useless. OH THE HUMANITY.....
  • Antonio Rocco Level 6 Level 6 (10,100 points)
    Hi

    One thing you can do quickly and easily is to issue:

    system_profiler

    There is a slight delay but then the output can be quite long. You will definitely see the default Gateway in the output. There may be a quicker and simpler way of doing this? Possibly ifconfig or even ipconfig? You could consult the manual pages to see if there is anything available? You could also use the apropos command to see if anything gets thrown up. Something like:

    apropos gateway

    Should list any shell commands/scripts that may give you the information you want.

    Tony
  • edclange Level 3 Level 3 (895 points)
    Try:

    netstat -f inet -rn
    mini/macbook/imac/iphone, Mac OS X (10.5.2)

Actions

More Like This

  • Retrieving data ...

Bookmarked By (0)

Legend

  • This solved my question - 10 points
  • This helped me - 5 points
This site contains user submitted content, comments and opinions and is for informational purposes only. Apple disclaims any and all liability for the acts, omissions and conduct of any third parties in connection with or related to your use of the site. All postings and use of the content on this site are subject to the Apple Support Communities Terms of Use.