Page 1 of 1

Obtaining ALL local IP addresses for machine

Posted: Thu Feb 03, 2011 1:21 pm
by andyh1234
Hi,

I have a script Mark shared that lets me grab the IP address for the local computer, it works well and grabs the first IP, usually the ethernet connection on the desktop macs, and the airport on the laptops.

However I have a few Macs that have both an ethernet and airport connection enabled and need to be able to get both IP addresses as im interested in communication over the airport/wifi network. Any ideas?

Thanks

Andy

Marks original script was...

function getLocalIPAddress
put "255.255.255.255:44444" into mySock
open datagram socket to mySock
put hostAddress(mySock) into myIP1
close socket mySock
return myIP1
end getLocalIPAddress

Re: Obtaining ALL local IP addresses for machine

Posted: Sun Feb 13, 2011 12:56 am
by Mark
Hi Andy,

Use shell("ifconfig -a") and write a script that finds all ip address in the output of this shell command.

Best,

Mark

Re: Obtaining ALL local IP addresses for machine

Posted: Sun Feb 13, 2011 2:34 pm
by mhoneywill
I think on windowsXP you need to use the command "ipconfig /all"

Cheers

Martin

Re: Obtaining ALL local IP addresses for machine

Posted: Sun Feb 13, 2011 3:07 pm
by andyh1234
Thanks!

Andy

Re: Obtaining ALL local IP addresses for machine

Posted: Mon May 07, 2012 2:00 pm
by Simon
Hi,
ipconfig /all returns a system language specific result;
English: "Physical Address"
French: "Adresse physique"
Is there a way to change my cmd line language so that I can test the different languages I need?

THX,
Simon