Find default gateway in terminal

Discussion in 'Mac OS X System & Mac Software' started by macshaun, Dec 1, 2008.

  1. macshaun

    macshaun Registered

    Joined:
    Mar 14, 2007
    Messages:
    28
    Likes Received:
    0
    Trophy Points:
    0
    Hi All,

    Currently running OSX 10.5 and was wondering if anyone knows how to find your gateway address in Terminal? IFCONFIG only appears to show the IP address. I know you can find it via System Preferences > Network but would like to know if it is possible to find it via terminal.
     
  2. macbri

    macbri Mac (r)evolution

    Joined:
    Jun 7, 2005
    Messages:
    311
    Likes Received:
    1
    Trophy Points:
    0
    Location:
    One of these days, Alice....
    Try:

    Code:
    netstat -nr
    or
    Code:
    netstat -nr | grep '^default'
     
  3. macshaun

    macshaun Registered

    Joined:
    Mar 14, 2007
    Messages:
    28
    Likes Received:
    0
    Trophy Points:
    0
    Thanks for that.
     

Share This Page