Checking the Host System s Configuration First


Checking the Host System's Configuration First

Before 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 24. 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 28, "BOOTP and Dynamic Host Configuration Protocol (DHCP)."


Using hostname and Related Commands

The 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 29, "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] 


  • [-a] [--alias] Displays the alias name of the host if one is being used. The alias name should be found in your Domain Name System (DNS) server database.

  • [-d] [--domain] Displays the name of the DNS domain.

  • [-F] [--file filename] Reads the hostname from the specified file filename. Note that the hostname file is now considered a relic of the past, but it still serves a useful purpose for some specific situations, as discussed in Chapter 30.

  • [-f] [--fqdn] [--long] Displays the FQDN (fully qualified domain name). A FQDN consists of a short hostname and the DNS domain name found in the /etc/hosts file.

  • [-h] [--help] Prints a usage message and exits. This is all you have to remember if you don't carry this book around with you!

  • [-I] [--ip-address] Displays the IP address(es) of the host.

  • [-s] [--short] Displays the short hostname. That is, instead of the FQDN, only the first part of the hostname (before the first period character) is displayed.

  • [-V] [--version] Prints version information on standard output and exits.

  • [-v] [--verbose] Causes the command to produce additional output.

  • [-y] [--yp] [--nis] Displays the NIS (or the older YP) domain name. If a parameter is given (or --filename), then root also can set a new NIS domain.

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.

Note

NIS stands for Network Information System. Formerly known as Yellow Pages (YP), the name was changed due to a trademark dispute. For more information on managing users with YP and NIS, see Chapter 38, "Managing Unix and Linux Users."


Using ipconfig and ifconfig to Check Host Configurations

The 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 Windows

Simply 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:

  • IP address

  • Subnet mask

  • Default gateway

  • DNS server information

  • Windows domain

Here's an example of the output that ipconfig generates:

C:\Documents and Settings\Mark>ipconfig Windows IP Configuration Ethernet adapter Local Area Connection 3:         Connection-specific DNS Suffix  . :         IP Address. . . . . . . . . . . . : 192.16.0.100         Subnet Mask . . . . . . . . . . . : 255.255.255.0         Default Gateway . . . . . . . . . : 192.16.0.1 


If the adapter is not connected to a network cable, you will see the following information instead of DNS and other network information:

Media State . . . . . . . . . . . : Media disconnected 


If the adapter lists an IP address of 0.0.0.0, it does not have a valid IP address. If the network adapter receives an IP address from a DHCP server, make sure the network cable is properly connected to the adapter, and then use the ipconfig /release and ipconfig /renew commands in succession to obtain a new address. If the network adapter uses a fixed (user-assigned) IP address, open the network adapter's properties sheet (in Network Connections or Network Neighborhood) and manually configure the network adapter's IP address and other TCP/IP configuration information.

Each network adapter in a system (including wireless adapters) has a separate section listed in the output for ipconfig.

With the /all parameter, you also can obtain the hardware (MAC) address and DHCP information for each network adapter in a computer. You also can use this command to renew or release DHCP configuration information to attempt to reconfigure the computer with updated information.

Here's an example:

C:\Documents and Settings\Mark>ipconfig /all Windows IP Configuration         Host Name . . . . . . . . . . . . : tiger-athlon         Primary Dns Suffix  . . . . . . . :         Node Type . . . . . . . . . . . . : Mixed         IP Routing Enabled. . . . . . . . : No         WINS Proxy Enabled. . . . . . . . : No Ethernet adapter Local Area Connection 3:         Connection-specific DNS Suffix  . :         Description . . . . . . . . . . . : Linksys LNE100TX(v5) Fast Ethernet Adapter #2         Physical Address. . . . . . . . . : 00-20-78-0D-D5-BF         Dhcp Enabled. . . . . . . . . . . : Yes         Autoconfiguration Enabled . . . . : Yes         IP Address. . . . . . . . . . . . : 192.16.0.100         Subnet Mask . . . . . . . . . . . : 255.255.255.0         Default Gateway . . . . . . . . . : 192.16.0.1         DHCP Server . . . . . . . . . . . : 192.16.0.1         DNS Servers . . . . . . . . . . . : 63.64.9.11                                             63.64.9.19         Lease Obtained. . . . . . . . . . : Monday, September 26, 2005 11:08:02 PM         Lease Expires . . . . . . . . . . : Tuesday, September 27, 2005 11:08:02 PM 


The syntax for Windows is

ipconfig [/? | /all | /release [adapter] | /renew [adapter]          | /flushdns | displaydns | /registerdns          | /showclassid adapter          | /setclassid adapter [classidtoset] ] 


  • /all Causes a verbose display of all the configuration information that the ipconfig utility has access to, including multiple adapters.

  • /release [adapter] Releases an IP address that was configured using DHCP. If you use just the /release qualifier by itself, the system will attempt to release IP configuration for all adapters on the computer. Otherwise, you can use the syntax of /release name to release the IP configuration for a specific adapter with the specified name. Note that you can use wildcards, such as /release "wireless*" to release all wireless addresses.

    Note

    You can see the adapter names with the unqualified ipconfig command. For example, if an adapter is listed as "Ethernet adapter Local Area Connection," you could use ipconfig /release "Local*". Note that under Windows 2000 and newer, you can also view the adapter names by right-clicking Network Neighborhood and selecting Properties from the pop-up menu. The adapter names are the names of the icons. If you use the Details view, the name is conveniently listed under the Name column.


  • /renew [adapter] Renews an IP address that was configured using DHCP. If you use just the /renew qualifier by itself, the system will attempt to renew IP configuration for all adapters on the computer. Otherwise, you can use the syntax of /renew name to renew the IP configuration for an adapter with the specified name. As with /release, you can use wildcards, such as /renew "wireless*" to renew all wireless addresses.

  • /flushdns Purges the DNS resolver cache.

  • /registerdns Refreshes all leases granted by DHCP for the adapter and reregisters DNS names.

  • /displaydns Shows the contents of the DNS resolver cache.

  • /showclassid [adapter] Displays all the DHCP class IDs allowed for adapter.

  • /setclassid [adapter] [classidtoset] Modifies the DHCP class ID. DHCP class IDs are covered in more detail in Chapter 28.

Tip

When a Windows system obtains a translation (hostname to IP address) from a DNS server, it stores the record in a cache for a short period. When the name is used again, the TCP/IP stack will first consult the cache to see whether the record exists, thus providing a quicker response than if a DNS server is queried. To keep the cache set to a reasonable size, each record is flushed from the cache after a Time to Live (TTL) value for the record expires. If you have made a change to a DNS record, you can use the ipconfig /flushdns command to remove all records from the cache so that the DNS server will again be consulted, and the cache will begin to store new records. The ipconfig /displaydns command will show you the contents of the cache, which can be helpful when you are not sure whether the cache or DNS server is being consulted for the name translation.


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. If you are unable to renew the IP address with the /renew switch, there's a problem with your connection to the DHCP server and you should check the functionality of the network adapter, cable, and any intermediary network devices up to and including the 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.

Tip

A common method for importing information into a spreadsheet is to create a comma-delimited file. If you use Windows, Unix, Linux, or some other operating system, it is easy to take the information provided by the ipconfig command and parse it, and separate the important information by inserting commas. Your script file can then be used to load the information into a spreadsheet on a periodic basis.


ifconfig for Unix and Linux

On 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. To determine the options available in your version of Unix or Linux, enter man ifconfig at a Unix or Linux shell prompt to view the man (manual) page for the ifconfig command.

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.

Tip

The root account on Unix/Linux machines is a powerful account. Consider it to be the same thing as the Administrator account on Windows computers. It is a good idea to use this account only when absolutely necessary, because it's possible to make a mistake if you use the account as your everyday login. Instead, for Unix/Linux systems, an ordinary user account should be used. When you need to gain the privileges that the root account provides, use the su command. This command will prompt you for the password to the root account and allow you to make changes on an as-needed basis. To exit back to your normal account, use Control-D (for Solaris Unix). Check the documentation for your Unix/Linux system to see whether another character combination is used to exit the root environment. You can also specify other commandline options for the su command, such as another user account to use, and the shell to use, but these are beyond the scope of this book and will vary from one version of Unix/Linux to another.


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:

  • The IP address assigned to the interface

  • Whether the interface is up and running

  • The mtumaximum transmission unit (usually 1,500 bytes because this is the maximum for Ethernet transmissions)

  • The network subnet mask (in hexadecimal format)

  • The broadcast address

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.

Note

Keep in mind that Unix and Linux are case-sensitive. Enter all commands discussed in this chapter in lowercase. If you use uppercase for a command you will get an error. You can, however, use upper- or lowercase commands for such things as filenames. When you use a command that uses the filename, though, you must specify the filename exactly as you created it.


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 (running) or down (not running) can be useful when the Unix or Linux box is being used for routing functions or is part of a proxy firewall solution.




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