Results 1 to 5 of 5
  1. #1

    * Command Line To Check Status of Network Connection?

    Does anyone know of a command for Windows 2008 Server R2 that can check if a network connection is active?

    I'm trying to make a batch file that checks if a VPN connection is active, and if it isint to start it.

    Thanks in advance.

  2. #2
    netsh is your friend here

    To get a list of network interfaces
    >netsh interface show interface

    you should see something like
    Admin State State Type Interface Name
    Enabled Disconnected Dedicated Local Area Connection
    Disabled Disconnected Dedicated Cisco AnyConnect Secure Mobility Client Connection
    Enabled Connected Dedicated Wireless Network Connection
    Enabled Connected Dedicated Local Area Connection 2
    Enabled Disconnected Dedicated Wireless Network Connection 2
    Enabled Disconnected Dedicated Wireless Network Connection 3

    If you know the name of the interface you want to check, you can do similar command but add name="Name of Interface" to the command
    >netsh interface show interface name="Name of Interface"

    and you'll get an output similar to
    Cisco AnyConnect Secure Mobility Client Connection
    Type: Dedicated
    Administrative state: Disabled
    Connect state: Disconnected

  3. #3
    On Windows you have this same commands like on *nix OS

    ## active TCP connection
    netstat -p tcp

    ## active UDP connection
    netstat -p udp

    You can also use currports very good application to check which application use network connection

  4. #4
    command 1) USing netsh trace commands

    Following is an example of the results that are rendered by running

    the Netsh trace show scenarios command:

    netsh trace>show scenarios

    Available scenarios (13):
    AddressAcquisition : Troubleshoot address acquisition-related

    DirectAccess : Troubleshoot DirectAccess related issues
    FileSharing : Troubleshoot common file and printer

    sharing problems
    InternetClient : Diagnose web connectivity issues
    InternetServer : Troubleshoot server-side web

    connectivity issues
    L2SEC : Troubleshoot layer 2 authentication

    related issues
    LAN : Troubleshoot wired LAN related issues
    Layer2 : Troubleshoot layer 2 connectivity

    related issues
    NDIS : Troubleshoot network adapter related

    NetConnection : Troubleshoot issues with network

    RPC : Troubleshoot issues related to RPC

    WFP-IPsec : Troubleshoot Windows Filtering Platform

    and IPsec related issues
    WLAN : Troubleshoot wireless LAN related issues

    netsh trace>

    command 2) "netstat -a" in command prompt

    You'll see something like this:

    Active Connections

    Proto Local Address Foreign Address State PID

  5. #5
    You could ping the server and see if it responds. Or connect using telnet to whatever port the VPN software is running and check for specific string output.
    Want to sell domain names? Sign up today for an reseller account from a trusted eNom ETP provider.
    * We provide support and service to over 3245 happy eNom domain name and SSL certificate resellers!

Similar Threads

  1. Replies: 4
    Last Post: 05-16-2013, 05:21 AM
  2. MySQL status command
    By osphere in forum Hosting Security and Technology
    Replies: 0
    Last Post: 07-25-2010, 02:45 AM
  3. Command Line
    By John Moran in forum VPS Hosting
    Replies: 5
    Last Post: 05-10-2008, 10:32 PM
  4. Chaning services status from command line
    By Rorax in forum Hosting Security and Technology
    Replies: 1
    Last Post: 01-01-2006, 07:52 AM
  5. Perl: how to run a command line command from inside perl
    By fozzy in forum Programming Discussion
    Replies: 3
    Last Post: 10-28-2005, 11:34 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts