13,420
edits
Changes
no edit summary
=== Part 3: Network Connectivity & Network Service Troubleshooting Utilities===
Troubleshooting network problems is an extremely important and frequent task that for a Linux/Unix system administrator performs on a daily basis! . Since network services (such as file-server, print-servers, web-servers, and email-servers) depend on network connectivity, as Linux/Unix sysadmin must be able to quickly and effectively pin-point sources of network problems in order to resolve them.
Network service problems may not be entirely related to a "broken" network connection, but a service that is not running or not running correctly. The following table lists the most common listing of utilities to assist with detection of network connectivity or network service problems to help correct the problem.
:'''Perform the following steps:'''
#Switch to your '''c7host ''' machine.#Issue the '''ping''' command to test connectivity to your '''centos1''', '''centos2''', and '''centos3 ''' VMs.
#Examine the contents of the ARP cache by using the command: <b><code><span style="color:#3366CC;font-size:1.2em;">arp</span></code></b>arp What is the purpose of ARP?
#Check the contents of the cache again by using the command: <b><code><span style="color:#3366CC;font-size:1.2em;">arp -n</span></code></b> What was the difference in output?
#Issue the following command: <b><code><span style="color:#3366CC;font-size:1.2em;">netstat -at</span></code></b> This command will list all active TCP ports. Note the state of your ports.
'''TCP ''' is a connection oriented protocol that uses a handshaking mechanism to establish a connection. Those ports that show a state of LISTEN are waiting for connection requests to a particular service. For example you should see the ssh service in a LISTEN state as it is waiting for connections.
<ol><li value="6">From one of your VM's login to your host using the '''ssh''' command.</li><li>On your c7host VM rerun the <b><code><span style="color:#3366CC;font-size:1.2em;">netstat -at</span></code></b> command and in addition to the '''LISTEN ''' port it should list a 2nd entry with a state of ESTABLISHED. This shows that there is a current connection to your ssh server.</li><li>Exit your ssh connection from the VM and rerun the command on the CentOS host. Instead of '''ESTABLISHED ''' it should now show a state of '''CLOSE_WAIT'''. Indicating that the TCP connection is being closed.</li>
<li>On your c7host VM, try the command: <b><code><span style="color:#3366CC;font-size:1.2em;">netstat -atn</span></code></b> How is this output different?
Without the -n option netstat attempts to resolve IP addresses to host names (using /etc/hosts) and port numbers to service names (using /etc/services)</li>
<li>Examine the '''/etc/services ''' file and find which ports are used for the services: ssh, sftp, http</li>
<li>Now execute the command netstat -au What is the difference between the options: -at and -au? When examining UDP ports why is there no state?</li>
</ol>