Network Troubleshooting using Command-line

To troubleshoot a TCP/IP networking problem, utilize the following command step be step.


1. ipconfig

ipconfig /all : view TCP/IP configuration of the computer.

ipconfig /renew : force network adapter to contact a DHCP server and renew the existing configuration or obtain a new configuration.

Also, ipconfig command can be used to deal with DNS. (might be useful) /displaydns : displays the contents of the DNS Resolver Cache; /flushdns : purges the DNS cache; /registerdns : refreshes all DHCP leases and re-registers DNS names.

2. ping

The ping command helps to verify IP-level connectivity by sending an ICMP echo request to a target host name or IP address.

Perform the following steps when using ping:

1). Ping the loopback address to verify that TCP/IP is installed and configured correctly on the local computer.

ping 127.0.0.1

2). Ping the IP address of the local computer to verify that it was added to the network correctly.

ping IP_address_of_local_host

3). Ping the IP address of the default gateway to verify that default gateway is functioning and you can communicate with a local host on the local network.

ping IP_address_of_default_gateway

4). Ping the IP address of a remote host to verify that you can communicate through a router.

ping IP_address_of_remote_host

The ping command uses Windows Sockets - style name resolution to resolve a computer name to an IP address, so if pinging by address succeeds, but pinging by name failes, then the problem lies in address or name resolution, not network connectivity.

3. arp

The arp command is used to view and modify the ARP table entires on the local computer so as to resolve address resolution problems.

4. nbtstat

The nbtstat command is used for troubleshooting NetBIOS name resolution problems (basically for netBIOS services in local area networks).

NetBIOS (Network Basic Input/Output System) provides services related to the session layer of the OSI model allowing applications on seperate computers to commnicate over a local area network. NetBIOS over TCP/IP is a network protocol that allows legacy computer applications relying on NetBIOS API to be used on modern TCP/IP networks. NetBIOS provides three distinct services: name service, session service and datagram distribution service.

5. netstat

The netstat command can be used to display protocol stastics and current TCP/IP connections.

netstat -a : displays all connections.

netstat -r : displays the route table plus active connections.

netstat -e : displays Ethernet statistics.

netstat -s : displays per-protocol statistics.

netstat -n : addresses and port numbers are not converted to names.

6. tracert

Trace Route is a route-tracing utility that is used to determine the path that an IP datagram takes to reach a destination. The tracert command uses the IP time-to-live field and ICMP error messages to determine the route.

tracert [-d](specifies that IP address are not resolved to host name) [-h maximum_hops] [-j host-list] [-w timeout] target_name

7. pathping

The pathping command is a route tracing tool that combines features of the ping and tracert commands with additional information that neither of those tools provides.

The pathping command sends packets to each router on the way to a final destination over a period of time, and then computes results based on the packets returned from each hop. Since the command shows the degree of packet loss at any given router or link, it is easy to determine which routers or links might be causing network problems.

没有评论: