networksetup command query??

Discussion in 'Mac Programming' started by vikasu, Sep 3, 2008.

  1. vikasu macrumors newbie

    Nov 6, 2007
    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.

    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???
  2. Cromulent macrumors 603


    Oct 2, 2006
    The Land of Hope and Glory
    I use netstat for information on network status. Type man netstat to see all the different options.
  3. vikasu thread starter macrumors newbie

    Nov 6, 2007
    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.

Share This Page