Other Useful Commands


The TCP/IP suite consists of several protocols and utilities that have been developed over the years. Other commands can be useful for troubleshooting. For example, the telnet command is used to establish a remote terminal session on another computer. If you are having trouble with a workstation, you can always telnet to it and perform diagnostic functions directly. This is convenient when the network is dispersed geographically. It is also possible to telnet to many networked devices, from printers to routers. This feature can enable you to resolve many remote problems without having to leave your office. Just telnet into a system and use the commands provided by that system.

Telnet also can be useful when you're trying to resolve connectivity problems with a particular server. If you can't ping or otherwise connect to a system, try using telnet to get to another system and try your diagnostic commands from that location in the network. Using this method to attempt to connect to a remote system by using other remote systems can help you locate the spot in the network where potential trouble lies.

Advanced users can use telnet to connect directly to ports used by specific services to enable troubleshooting for the service. For example, by using telnet to connect to a Web server on port 80, you can manually enter commands that would be sent by an Internet browser and examine the responses sent by the server. To see how this works from a Windows 2000/XP client, issue this command:

telnet www.google.com 80 


This connects you to Google. After you have connected, there will be no response until you type a command. To request the index page, use the following command:

GET /index.html HTTP/1.0 


Note that you must complete the command before the Web server drops your connection. This time varies on each server, but it can be rather quick. If you beat the timeout, the first part of the response will be the header. The first line is the HTTP Response code. Two common responses are 200, which means you were successful, and 404, which means the page was not found. The rest of the header information is fairly self-explanatory.

Following is an example of this:

HTTP/1.0 200 OK Content-Length: 2532 Connection: Close Server: GWS/2.0 Date: Mon, 06 Jan 2003 23:09:11 GMT Content-Type: text/html Cache-control: private Set-Cookie: PREF=ID=67734bf5226e142a:TM=1041894551:LM=1041894551:S=E_cwh20x6SQGp kqD; expires=Sun, 17-Jan-2038 19:14:07 GMT; path=/; domain=.google.com 


Response codes for Telnet are covered in detail in Chapter 25, "Basic TCP/IP Services and Applications."


Next, the HTML contentthe bits that would normally be rendered by the browserof the page that you requested are displayed. I've trimmed the content of this section because the details are not important.

<html><head><meta http-equiv="content-type" content="text/html; charset=ISO-8859 -1"><title>Google</title> .. .. .. &copy;2003 Google</font><font size=-2> - Searching 3,083,32 4,652 web pages</font></center></body></html> 


And then you will be disconnected:

Connection to host lost. 


The ftp command can be used to move files to and from a remote system. This can be useful to retrieve the output of a diagnostic command, a log file, or perhaps a configuration file so that you can examine or edit it locally.

Depending on the importance of the server, you should consider the capabilities of both Unix/Linux and Windows operating systems to audit activities on the system. The syslog daemon on Unix/Linux computers can be configured to capture a lot of data from many sources. If troubleshooting becomes nonproductive, consider increasing the events logged by the operating system so that you might find important data that can help assist in solving the problem.




Upgrading and Repairing Networks
Upgrading and Repairing Networks (5th Edition)
ISBN: 078973530X
EAN: 2147483647
Year: 2006
Pages: 411

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net