Checking the Host System's Configuration FirstBefore you start to check the cables, network adapters, hubs, and other physical components of the network, you should check to see whether there is a problem with a computer's TCP/IP configuration. You can do this by using the tools provided with the operating system. Information about Windows configurations can be found in Chapter 25. Linux or Unix users should check their specific documentation and man (manual) pages for information on how to configure networking on a system. This configuration information can usually be entered during the installation of the operating system, but you may find it necessary to change it. For example, if you move the computer to a different subnet, you will have to make changes. Check to be sure that the system has an IP address that uses the same network number as the other computers on the local subnet. Also check to be sure that the correct subnet mask and default gateway are used. If you are using DHCP to assign configuration information, check to see that there is a DHCP server on the subnet, or a DHCP relay agent operating on the subnet. If everything checks out okay, it is time to start using the basic troubleshooting tools that are available with most versions of TCP/IP. The Dynamic Host Configuration Protocol (DHCP) is covered in Chapter 29, "BOOTP and Dynamic Host Configuration Protocol (DHCP)." Using hostname and Related CommandsThe hostname command is perhaps the simplest command you can use to begin checking the configuration of a host computer. On Windows systems, this command prints the name of the host computer on which it is executed. Just enter the command in the Command Prompt window. Why would you want to use the hostname command? Because the hostname is translated into an IP address, you can use the system's hostname to ensure that the correct IP address is associated with that name. If a Domain Name System (DNS) server shows a different IP address, you will know that you cannot reach this particular host by using its hostname. If this is the case, check to see whether the IP address is in use by another system. If not, you can change the DNS record so that the hostname and IP address are related. Other methods can also be used to translate hostnames to IP addresses. See Chapter 30, "Network Name Resolution," for more information about this topic. The hostname command can be used on Unix and Linux. Depending on the operating system, and how your network is configured, and the command-line parameters used, you may get just the name assigned to your computer, or the fully qualified DNS name, as well as other Unix/Linux-specific information. You will find several other related commands discussed here that can be used to return information about the name of the system, as well as network information. Whereas this command on Windows NT/2000/XP systems outputs the name of the host to the command line, the Linux version offers you many options for viewing the hostname for the system. Following is the syntax for using hostname (and a few variants that return similar information) for Linux Version 8.0: hostname [-v] [-a] [-- alias ] [-d] [-- domain ] [-f] [-- fqdn ] [-i] [-- ip-address ] [--long] [-s] [--short] [-y] [--yp] [--nis] [-n] [-- node ] hostname [-v] [-F filename ] [--file filename ] [ hostname ] domainname [-v] [-F filename ] [--file filename ] [ name ] nodename [-v] [-F filename ] [-file filename ] [ name ] dnsdomainname [?-v] nisdomainname [?-v] ypdomainname [?-v]
As you can see, the Linux command is a little more complex than the Windows version. The following related commands can also be used: domainname , nisdomainname , and ypdomainname . Each will give you the hostname that is stored in the NIS (Network Information System) database.
Using ipconfig and ifconfig to Check Host ConfigurationsThe ipconfig command is useful for checking the TCP/IP configuration of Windows workstations or servers. A similar command on Unix and Linux workstations is ifconfig . On Windows 95/98 or Windows Me systems, you can use the winipcfg command. ipconfig for WindowsSimply enter the ipconfig command at the command prompt. Using the ipconfig command with no parameters displays network configuration information about each adapter on the system, as well as for PPP (dialup or VPN) connections. The basic information includes the following:
With the /all parameter, you also can obtain the hardware (MAC) address and DHCP information. You also can use this command to renew or release DHCP configuration information to attempt to reconfigure the computer with updated information. The syntax for Windows is ipconfig [/? /all /release [ adapter ] /renew [ adapter ] /flushdns displaydns /registerdns /showclassid adapter /setclassid adapter [ classidtoset ] ]
Obviously, this command is extremely useful when you are trying to solve problems related to DNS and DHCP functions. For example, you can use /release and /renew to see whether you are having problems obtaining configuration information from a DHCP server. You can use the DNS qualifiers when you've made configuration changes and want to keep the local cache updated or register the new configuration information with a DNS server. The /all qualifier shows all the output to which the command has access and is frequently used to scan for problems. To see all the output without having it scroll off the screen, use the command in the form of ipconfig /all more . You can also use the command ipconfig /all > filename to send the information to a file so that you can print it, or save the information for use in the future. The quantity of information you can show is useful when constructing a spreadsheet or other document for help-desk use. One method that will help you keep up with current configuration information is placing the following command in a login script or startup file: ipconfig /all > network drive %computername%.config The %computername% environment variable is replaced with the computer name that is assigned to the system and a text file is created. By placing the output file on a network drive, you can have it available for use by administrative or help-desk staff. The server that provides the file share network drive can use a script file appropriate for that operating system to parse the information and store it in a database.
ifconfig for Unix and LinuxOn Unix and Linux systems, ifconfig is a very powerful command . You can use it to display IP configuration information, and also to make changes to the configuration. This command is used in startup files to enable network adapters or provide addressing information, among other items. Online you can use this command to make changes to the configuration. Some versions of Unix allow you to use this command to view statistics or configuration information for each network adapter. Others simply print a short list of the same, and are mainly used to configure the adapters. Although the ifconfig command is used during the boot sequence to perform the initial configuration for network adapters, after the system is up and running, only the root account can use this command to change the configuration. For troubleshooting, it is a quick way to get the information you need in order to determine whether the system was properly configured. For those unfamiliar with Unix, the superuser is just another term for the user account that has full system privileges and can perform all tasks . For Unix/Linux this account is named root.
To simply display the current configuration information, you can execute the command followed by the network interface name. For example: ifconfig le0 This command will show less information than the Windows ipconfig command, but other commands described later in this chapter (such as netstat ) will enable you to obtain additional configuration information. The output from this command will typically show you the following:
To display information about all network adapters in a computer that uses multiple adapters, use this command: ifconfig a You do not need to specify the adapter names using this form of the command.
As always, check the documentation for your Unix/Linux system (the man pages) to ensure that you have the correct syntax, because it may vary from that shown previously. The capability to set routing metrics and mark an adapter as either up or down can be useful when the Unix or Linux box is being used for routing functions or is part of a proxy firewall solution. |