Locating Network Configuration Information from the Command Line

Hands-On Lab

 

Photo of Michael Christian

Michael Christian

Course Development Director in Content

Length

00:45:00

Difficulty

Beginner

Being able to find and understand network configuration information is fundamental to using Linux on a network. In this hands-on lab, we will determine the network configuration for the eth0 interface of the lab host.

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.

Locating Network Configuration Information from the Command Line

Introduction

Being able to find and understand network configuration information is fundamental to using Linux on a network. In this hands-on lab, we will determine the network configuration for the eth0 interface of the lab host.

Connecting to the Lab

  1. Open your terminal application, and run the following command (remember to replace PUBLIC_IP with the public IP you were provided on the lab instructions page):
    ssh cloud_user@PUBLIC_IP
  2. Enter yes at the prompt.
  3. Enter your cloud_user password at the prompt.

Determine the IP Address

  1. List the current working directory.
    pwd
  2. Run the following command:
    sudo ip addr show
  3. Enter your cloud_user password at the prompt.
  4. Locate the line that begins with inet (for the IPv4 address), or the line that begins with inet6 (for the IPv6 address).
  5. Note the address.

Determine the MAC Address

  1. In the output of the sudo ip addr show command, locate the line that begins with link/ether.
  2. Note the address.

Determine the Gateway

  1. Show the routing table.
    sudo ip route show
  2. Locate the line that begins with default via, and note the address.

Determine the DNS Server

  1. Show the DNS nameserver.
    cat /etc/resolv.conf | grep nameserver
  2. Note the DNS server in the output.

Conclusion

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