Results 1 to 8 of 8
  1. #1
    If you are in a DHCP situation and find your IP address frequently changing, here is an easy way to determine it:
    ipconfig getifaddr en0
    and an alternate (albeit more convoluted method):
    ifconfig en0 inet | grep 'inet ' | awk ' { print $2 } '

    If you are behind a router and need your external IP address, issue this command:
    wget -q -O /dev/stdout | grep 'Current IP Address: ' | awk ' { print $4 } '
    (Of course, you would have to have wget installed in order for this to work.)

    Here is a shell script for checking your IP address and logging the results to a file:
    #initialize variable
    IP=`wget -q -O /dev/stdout <a href='http&#58;//' target='_blank'>http&#58;//</a> | grep &#39;Current IP Address&#58; &#39; | awk &#39; { print &#036;4 } &#39;`
    # prints current IP to shell
    echo &#036;IP
    #log it
    date &#62;&#62; /private/var/log/ip.log
    echo &#036;IP &#62;&#62; /private/var/log/ip.log
    This script could be added to your crontab in order to check your IP address periodically and log the results to a file.

  2. #2
    the wget on doesn't seem to work anymore ... did the format change or something?

  3. #3

    Graphite's Avatar
    Member Since
    Feb 25, 2003
    Tropical Island, Jealous?
    MacPro 3.0Ghz 16GB RAM, 4x256 Vid, 30''cinema display
    this thread is over a year old... i almost forgot gatorparrots existed.. theres a few otherways, if you need to find it, PM and ill show u a lil thing i came across, ide post it but it may scare a few people.

  4. #4
    thanks Graphite... i'm behind a router so the wget method would suit me best.

  5. #5

  6. #6
    Quote Originally Posted by StarManta
    weird this site is giving me a different IP address...

  7. #7
    Lately, I've been using this code to obtain my external IP address:
    curl -s | awk '{print $1}'
    However, if you have a Linksys BEFSR-series router, the following code is better for scripting purposes, as it obtains results in about half the time:
    /usr/bin/curl --connect-timeout 5  -s \
               http://:$PASSWORD@$ROUTERIP/Status.htm  | \
               sed -e 's/^.*IP Address://'              | \
               sed -e 's/=2>/\\
    /'                                                  | \
               sed -e '1 d'                             | \
               sed -e 's/<.*//'

  8. #8

    witeshark's Avatar
    Member Since
    Mar 09, 2004
    Miami FL
    G4 1Ghz OS X 10.4.7
    You can also get it by running sheilds up to compare...

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Self-assigned IP address/no IP address, internet connection issue
    By leechalmers in forum Internet, Networking, and Wireless
    Replies: 7
    Last Post: 06-07-2013, 11:33 PM
  2. MAC address/Hardware address/Physical address HELP
    By CogitoEAS in forum macOS - Operating System
    Replies: 5
    Last Post: 05-28-2013, 11:06 PM
  3. e-mail address deleted from Address Book
    By Alwyn in forum macOS - Apps and Games
    Replies: 3
    Last Post: 07-25-2012, 11:02 AM
  4. Underlining an email address in address book
    By Sepikboi in forum macOS - Operating System
    Replies: 1
    Last Post: 09-23-2011, 05:02 AM
  5. Urgent help...Synchronizing my phone/PDA address to the macbook address book!!!
    By Digitalsoul in forum Other Hardware and Peripherals
    Replies: 4
    Last Post: 08-14-2007, 10:42 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts