Skip to main content

Troubleshooting network issues

Hands-On Lab

 

Photo of Michael Christian

Michael Christian

Course Development Director in Content

Length

01:30:00

Difficulty

Advanced

In this exercise, you will need to troubleshoot and resolve connectivity issues to a web server.

What are Hands-On Labs?

Hands-On Labs are scenario-based learning environments where learners can practice without consequences. Don't compromise a system or waste money on expensive downloads. Practice real-world skills without the real-world risk, no assembly required.

Troubleshooting network issues

Introduction

In this exercise, you will need to troubleshoot and resolve connectivity issues to a web server.

Server1 (10.0.1.10) is running Apache.

Server2 (10.0.1.11) must be able to view Server1's Apache content via http://ip-10.0.1.10.ec2.internal using elinks (not currently installed).

Solution

Start by logging in to the lab servers using the credentials provided on the hands-on lab page:

ssh cloud_user@PUBLIC_IP_ADDRESS

Become the root user:

sudo su -

Be sure to log in to both Server1 and Server2 in separate tabs or windows.

Verify Server1

  1. Verify Server1 is running Apache:

    systemctl status httpd
  2. Verify Apache is listening on port 80:

    ss -lntp | grep 80
  3. Verify the content can be accessed locally:

    curl localhost
  4. Verify the firewall is permitting port 80 traffic:

    firewall-cmd --list-all
  5. Permit inbound traffic to Apache:

    firewall-cmd --permanent --add-service=http
  6. Reload the firewall to pickup the change:

    firewall-cmd --reload

Verify Server2

On Server2 (10.0.1.11)

  1. Attempt to pull the web content from Server1 via hostname:

    curl ip-10-0-1-10.ec2.internal
  2. Attempt to pull the web content from Server1 via IP

    curl 10.0.1.10
  3. Check to see what DNS hosts are being used:

    cat /etc/resolv.conf
  4. Verify resolution via the specified host:

    dig @10.0.0.2 ip-10-0-1-10.ec2.internal
  5. Verify /etc/nsswitch.conf:

    vim /etc/nsswitch.conf
  6. Add dns to the hosts: line. It should look like this:

    hosts:  files dns myhostname
  7. Save and close the file:

    :wq
  8. Attempt to pull the web content from Server1 via hostname:

    curl ip-10-0-1-10.ec2.internal
  9. Ping ip-10-0-1-10.ec2.internal:

    ping ip-10-0-1-10.ec2.internal
  10. Review /etc/hosts:

    vim /etc/hosts
  11. Remove the following line:

    10.0.1.1    ip-10-0-1-10.ec2.internal
  12. Save and close the file:

    :wq
  13. Attempt to pull the web content from Server1 via hostname:

    curl ip-10-0-1-10.ec2.internal
  14. Install elinks:

    yum install -y elinks
  15. Use elinks to view the content:

    links -dump http://ip-10-0-1-10.ec2.internal

Conclusion

Congratulations, you've completed this hands-on lab!