PDA

View Full Version : networksetup command query??




vikasu
Sep 4, 2008, 01:32 AM
i want to know through shell, which network service is currently used to connect to network, I mean my pc is connected through which service i.e. is there any way to get connected status of all the network services configured in Network Settings.

I tried the shell command networksetup -listallnetworkservices, which gave output as :
********
An asterisk (*) denotes that a network service is disabled.
Ethernet
FireWire
AirPort
********

Now I am connected to network through ethernet, and this command tells the enable-disable status only, so can I know through command that I am connected to network through Ethernet network service and not through Firewire or Airport???



Cromulent
Sep 4, 2008, 01:45 AM
I use netstat for information on network status. Type man netstat to see all the different options.

vikasu
Sep 4, 2008, 02:21 AM
no I am telling about the network services, like Ethernet, Firewire, or Airport.

Now i have configured IP, DNS etc. in ethernet i.e. I am connected to network through a DNS server through LAN (ethernet). hence in network settings, on clicking Ethernet, it shows Status as "Connected", and on clicking Firewire, it shows Status as "Not Connected" and same for Airport, although all three services are enabled.

Now i want to know through command line that I am connected through Ethernet Service.