• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How do you display the IP Address?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How do you display the IP Address?


  • Subject: Re: How do you display the IP Address?
  • From: Axel Luttgens <email@hidden>
  • Date: Thu, 27 Aug 2009 10:22:54 +0200


Le 26 août 09 à 22:27, Emmanuel LEVY a écrit :


On Aug 26, 2009, at 5:37 PM, Mark J. Reed wrote:

Then probably your primary IP address isn't the one on the en0
interface. OMM en0 is wired Ethernet and en1 is wireless and I'm using
wireless, so (IPv4 address of (system info)) returns the same result
as `ipconfig getifaddr en1`.


I could be using both; a system can have more than one IP address.
Not sure what system info returns in that case.

I checked on a machine with 3 Ethernet addresses: 2 public addresses and one local address.


- IPv4 address of (system info) prudently returns... missing value,
- ipconfig getifaddr en0 returns one of the public addresses,
- ipconfig getifaddr en1 returns the local address.

Not that I would need to, but I don't know how to grab the second public address.

Hello Emmanuel,

To get all IP addresses currently used by interface en0 may be done by some parsing of the output of:
ifconfig en0
One may also search for all "services" bound to some interface by looking at the output of:
networksetup -listnetworkserviceorder
then by fetching the IP info for each of these services:
networksetup -getinfo <servicename>
There's the System Profiler way too:
system_profiler SPNetworkDataType


Now, wrt (system info); here, on 10.5.8, it returns the default IP address bound to en0 (very likely because I'm currently connected to the network thru ethernet; should I be connected thru Airport, I guess it would return the corresponding IP address - but I'm too lazy to check now).
It would be interesting to know why the command returns a missing value in your case.


Axel



_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden
References: 
 >Re: How do you display the IP Address? (From: "Ripka, Herb" <email@hidden>)
 >Fwd: How do you display the IP Address? (From: "Mark J. Reed" <email@hidden>)
 >Re: How do you display the IP Address? (From: Emmanuel LEVY <email@hidden>)

  • Prev by Date: Re: How do you display the IP Address?
  • Next by Date: Detect if Excel 2008 document contains hidden rows
  • Previous by thread: Re: How do you display the IP Address?
  • Next by thread: Re: How do you display the IP Address?
  • Index(es):
    • Date
    • Thread