READDEMOGUIDED LABINDEPENDENT LABQUIZREVIEW
Module 6 of 7 · 20 min

Networking basics

Beginner · 2/5

Written by CoreQ Academy (drafted with AI assistance). Awaiting review by Sean Ofodile.

You will be able to
  • Find interface addresses
  • Test reachability with ping and HTTP with curl
  • Use exit codes to automate checks

Interfaces and addresses

ip addr lists interfaces and their IP addresses. lo is the loopback interface (127.0.0.1); eth0 is usually the real network.

Name resolution

/etc/hosts maps names to addresses locally before DNS is consulted. That is why lab names like web01.lab work here.

Reachability

ping -c N host sends N probes. curl URL fetches a web page. Both return exit code 0 on success, so scripts can test them.

$ ping -c 1 web01.lab && echo up || echo down

Stay in scope

Only probe systems you are authorised to test. This simulator only reaches fictional lab hosts, and real labs should be just as clearly scoped.

Demo: try these in the terminal

ip addrfind your address
cat /etc/hostssee local name mappings
ping -c 2 web01.labtest a host
curl http://web01.lab/fetch a page
ping -c 1 offline.lab; echo $?see a failing exit code

Quiz

Knowledge quiz · pass mark 80%
  1. Which file maps hostnames to IPs locally?
  2. An exit code of 0 means the command succeeded.
  3. What address does the loopback interface use?
  4. What does `ping -c 1 host && echo up` print if host does not answer?
  5. It is fine to scan any public IP for practice as long as you do not attack it.
  6. Show interface addresses with the ip tool.
    $
  7. Send exactly 3 pings to web01.lab.
    $
  8. Which curl option shows only response headers?