Re: Getting the IP addressing method
Re: Getting the IP addressing method
- Subject: Re: Getting the IP addressing method
- From: Quinn <email@hidden>
- Date: Wed, 22 May 2002 09:54:59 +0100
At 17:13 -0400 21/5/02, John C. Welch wrote:
>
Is there a way, preferably via a command line utility, to get the way an
>
active interface has it's IP address set?
You can do this from the command line using "scutil". Here's an
example session.
public.apple.com> scutil
>
open
>
list .*/IPv4
subKey [0] = Setup:/Network/Global/IPv4
subKey [1] = Setup:/Network/Service/1/IPv4
subKey [2] = State:/Network/Global/IPv4
subKey [3] = State:/Network/Interface/en0/IPv4
subKey [4] = State:/Network/Interface/lo0/IPv4
subKey [5] = State:/Network/Service/1/IPv4
>
get Setup:/Network/Service/1/IPv4
>
d.show
<dictionary> {
ConfigMethod : Manual <<<<<<<<<<<<<< look here!
Router : 17.203.16.1
Addresses : <array> {
0 : 17.203.18.100
}
SubnetMasks : <array> {
0 : 255.255.252.0
}
}
>
quit
You can do it programmatically using the System Configuration
framework dynamic store APIs.
S+E
--
Quinn "The Eskimo!" <
http://www.apple.com/developer/>
Apple Developer Technical Support * Networking, Communications, Hardware
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.