Lab Objective:
The purpose of this lab is to learn how to manage networking on Linux computers.
Lab Purpose:
In this lab, you will learn how to query important network configuration and gather information for connecting a Linux computer to a Local Area Network.
Lab Tool:
Ubuntu 18.04 (or another distro of your choice).
Lab Topology:
A single Linux machine, or virtual machine.
Lab Walkthough:
Task 1:
Open your Terminal and run the following commands to gather information on your current network configuration:
- ip addr show
- ip route show
- ss -ap
- cat /etc/hosts
- cat /etc/resolv.conf
Does your local network support IPv4, IPv6, or both?
Task 2:
Now, turn off your Wi-Fi, disconnect your Ethernet cable, or disable the network connection to your VM. Then run the first three of those commands again.
What changes occurred, and why?
Task 3:
Reconnect your network and gather some information on 101labs:
host -v 101labs.net
Can you ping 101labs.net? If not, how might you diagnose the problem?
Task 4:
Run ip route show | grep default and copy the output. You’ll use it later!
Now, make sure to stop anything important you might be doing… then run: sudo ip route del default
Congratulations, you’ve just broken your internet connection by deleting the default route. You may confirm this by attempting to browse the internet with Firefox. In a real-world scenario, you could diagnose this problem by running ip route show and noting the lack of a default route.
To fix your connection, run: sudo ip route add <extra>, where <extra> is the output you copied earlier.
Notes:
The net-tools package, containing netstat, ifconfig, and route, among other tools, is considered deprecated. Nevertheless, you may run into systems that only have these tools, and so you should have a passing familiarity with them.