Common Network troubleshooting Utilities


1. HOSTNAME : Displays the host name of the current computer.

hostnm

2. GETMAC : Discovers the Media Access Control (MAC) address and lists associated network protocols for all network cards in a computer, either locally or across a network.

SYNTAX :

GETMAC [/S system [/U username [/P [password]]]] [/FO format] [/NH] [/V]

OPTIONS :

/s system Specifies the remote system to connect to.
/u [domain\]user Specifies the user context under which the command should execute.
/p [password] Specifies the password for the given user context. Prompts for input if omitted.
/fo format Specifies the format in which the output is to be displayed. Valid values: “TABLE”, “LIST”, “CSV”.
/nh Specifies that the “Column Header” should not be displayed in the output. Valid only for TABLE and CSV formats.
/v Specifies that verbose output is displayed.
/? Displays this help message.

EXAMPLE : To check MAC address locally you could run command getmac.

getmac

3. PING : The ping command sends ICMP echo request packets to a destination, this utility is helpful in troubleshooting netowork connectivity of machines.

EXAMPLE – you could run ping google.com or ping 173.194.33.174 to ping a domain name or IP address.

~ Detailed explanation in my previous blog.

4.  TRACERT : The tracert, or traceroute command is similar to ping, but provides information about the path a packet takes. traceroute sends packets to a destination, asking each Internet router along the way to reply when it passes on the packet. This will show you the path packets take when you send them between your location and a destination.

SYNTAX :

tracert [-d] [-h maximum_hops] [-j host-list] [-w timeout] [-R] [-S srcaddr] [-4] [-6] target_name

OPTIONS :

-d Do not resolve addresses to hostnames.
-h maximum_hops Maximum number of hops to search for target.
-j host-list Loose source route along host-list (IPv4-only).
-w timeout Wait timeout milliseconds for each reply.
-R Trace round-trip path (IPv6-only).
-S srcaddr Source address to use (IPv6-only).
-4 Force using IPv4.
-6 Force using IPv6.

EXAMPLE :  To check path of packets from your machine to destination ip address you could run Tracert 74.125.68.139 or Tracert Google.com

TRACERT

5. PATH PING : Combines the functions of Traceroute and Ping to identify problems at a router or network link and is the most underrated command line utility popular among system administrators, but quite useful in troubleshooting router failures.

SYNTAX :

pathping [-g host-list] [-h maximum_hops] [-i address] [-n] [-p period] [-q num_queries] [-w timeout] [-4] [-6] target_name

OPTIONS :

-g host-list Loose source route along host-list.
-h maximum_hops Maximum number of hops to search for target.
-i address Use the specified source address.
-n Do not resolve addresses to hostnames.
-p period Wait period milliseconds between pings.
-q num_queries Number of queries per hop.
-w timeout Wait timeout milliseconds for each reply.
-4 Force using IPv4.
-6 Force using IPv6.

EXAMPLE : To troubleshoot any network failures you could run Pathping <Target> i.e, pathping http://www.google.com

p

6. IPCONFIG : Displays all current Transmission Control Protocol/Internet Protocol (TCP/IP) network configuration values, and refreshes Dynamic Host Configuration Protocol (DHCP) and DNS settings.

SYNTAX:

ipconfig [/allcompartments] [/? | /all | /renew [adapter] | /release [adapter] | /renew6 [adapter] | /release6 [adapter] |
/flushdns | /displaydns | /registerdns | /showclassid adapter | /setclassid adapter [classid] | /showclassid6 adapter |
/setclassid6 adapter [classid] ]

OPTIONS :

/? Display this help message
/all Display full configuration information.
/release Release the IPv4 address for the specified adapter.
/release6 Release the IPv6 address for the specified adapter.
/renew Renew the IPv4 address for the specified adapter.
/renew6 Renew the IPv6 address for the specified adapter.
/flushdns Purges the DNS Resolver cache.
/registerdns Refreshes all DHCP leases and re-registers DNS names
/displaydns Display the contents of the DNS Resolver Cache.
/showclassid Displays all the dhcp class IDs allowed for adapter.
/setclassid Modifies the dhcp class id.
/showclassid6 Displays all the IPv6 DHCP class IDs allowed for adapter.
/setclassid6 Modifies the IPv6 DHCP class id.

EXAPMPLE : To check IP configuration of native machine you could run ipconfig or ipconfig/all

ipconfig

6. NSLOOKUP :  Displays information about Domain Name System records for specific IP addresses and/or host names so that you can troubleshoot DNS problems.

SYNTAX :

nslookup <Hostname> or <nslookup ipaddress>

EXAMPLE : To retrieve information about a specific ipaddress, you could run command nslookup google.com

nsl

7. NETSTAT : Displays protocol statistics and current TCP/IP network connections.

SYNTAX :

netstat [-a] [-b] [-e] [-f] [-n] [-o] [-p proto] [-r] [-s] [-t] [interval]

-a Displays all connections and listening ports.
-b Displays the executable involved in creating each connection orlistening port.
In some cases well-known executables host multiple independent components, and in these cases the sequence of components involved in creating the connection. or listening port is displayed. In this case the executable name is in [] at the bottom, on top is the component it called, and so forth until TCP/IP was reached. Note that this option can be time-consuming and will fail unless you have sufficient permissions.
-e Displays Ethernet statistics. This may be combined with the -s option.
-f Displays Fully Qualified Domain Names (FQDN) for foreign addresses.
-n Displays addresses and port numbers in numerical form.
-o Displays the owning process ID associated with each connection.
-p proto Shows connections for the protocol specified by proto; proto may be any of: TCP, UDP, TCPv6, or UDPv6. If used with the -s option to display per-protocol statistics, proto may be any of: IP, IPv6, ICMP, ICMPv6, TCP, TCPv6, UDP, or UDPv6.
-r Displays the routing table.
-s Displays per-protocol statistics. By default, statistics are shown for IP, IPv6, ICMP, ICMPv6, TCP, TCPv6, UDP, and UDPv6; the -p option may be used to specify a subset of the default.
-t Displays the current connection offload state. interval Redisplays selected statistics, pausing interval seconds between each display. Press CTRL+C to stop redisplaying statistics. If omitted, netstat will print the current configuration information once.

netstat

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s