READDEMOGUIDED LABINDEPENDENT LABQUIZREVIEW
Module 6 of 7 · 20 min Networking basics
Beginner · 2/5Written 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 downStay 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 addr | find your address |
cat /etc/hosts | see local name mappings |
ping -c 2 web01.lab | test 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%
- Which file maps hostnames to IPs locally?
- An exit code of 0 means the command succeeded.
- What address does the loopback interface use?
- What does `ping -c 1 host && echo up` print if host does not answer?
- It is fine to scan any public IP for practice as long as you do not attack it.
- Show interface addresses with the ip tool.$
- Send exactly 3 pings to web01.lab.$
- Which curl option shows only response headers?