<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>Networking 101, part 2: hands on · Network Doodles</title><link>https://networkdoodles.com/labs/networking-101-lab/</link><description>Log in to real computers, a switch and two routers, and run the commands network engineers use every day: ip addr, ip route, ping, traceroute, ip neigh, dig, ss and curl, and the switch's and routers' show commands. Each task ties what they print back to an idea from the lessons. In your browser, nothing to install.</description><language>en-us</language><managingEditor>David Henderson</managingEditor><lastBuildDate>Thu, 12 Nov 2026 09:00:00 -0500</lastBuildDate><atom:link href="https://networkdoodles.com/labs/networking-101-lab/index.xml" rel="self" type="application/rss+xml"/><item><title>Which door?</title><link>https://networkdoodles.com/labs/networking-101-lab/task-3-3/</link><pubDate>Thu, 12 Nov 2026 09:00:00 -0500</pubDate><dc:creator>David Henderson</dc:creator><guid>https://networkdoodles.com/labs/networking-101-lab/task-3-3/</guid><description> new to this? step by stepbeginner Click web on the Topology tab. In the web tab: ss -tln. Click dns. In the dns tab: ss -uln and ss -tln. Click laptop. In the laptop tab: curl -s -w '\n%{local_ip}:%{local_port} -&gt; %{remote_ip}:%{remote_port}\n' web.lab and curl -v web.lab:22. Fill in Your answers, under the guide. Challenge: make curl web.lab:8080 work from the laptop. Check task 3.3, under the guide. more in meet the lab</description><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[
<details class="lab-basics">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="8" r="4"/><path d="M4 21c0-4 4-6 8-6s8 2 8 6"/></svg>
 <span>new to this? step by step</span><em>beginner</em></summary>
  <div class="lab-basics-body">
    <ol>
<li>Click <strong>web</strong> on the <strong>Topology</strong> tab. In the <strong>web</strong> tab: <code>ss -tln</code>. Click <strong>dns</strong>. In the <strong>dns</strong> tab: <code>ss -uln</code> and <code>ss -tln</code>.</li>
<li>Click <strong>laptop</strong>. In the <strong>laptop</strong> tab: <code>curl -s -w '\n%{local_ip}:%{local_port} -&gt; %{remote_ip}:%{remote_port}\n' web.lab</code> and <code>curl -v web.lab:22</code>.</li>
<li>Fill in <strong>Your answers</strong>, under the guide.</li>
<li>Challenge: make <code>curl web.lab:8080</code> work from the laptop.</li>
<li><strong>Check task 3.3</strong>, under the guide.</li>
</ol>

    <p class="lab-basics-more mono">more in <a href="/labs/basics/">meet the lab</a></p>
  </div>
</details>


<section class="lab-stage lab-stage-explain" id="explain">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">1</span>
    <span class="lab-stage-kind mono">explain</span><h2>Listening on a port</h2>
  </header>
  <div class="lab-stage-body">
    <h3 id="one-computer-many-doors">One computer, many doors</h3>
<p>In <a href="/lessons/networking-101/task-5-1/">lesson 5.1</a> the IP address was the street address, and the <strong>port</strong> was
the flat number: which program on the computer a message is for. A program that offers a service tells the
computer <em>anything that arrives on this port is mine</em>. That&rsquo;s called <strong>listening</strong>.</p>
<p>In this lab:</p>
<table>
  <thead>
      <tr>
          <th>Host</th>
          <th>Program</th>
          <th>Listens on</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>web</td>
          <td>a small web server, <code>httpd</code></td>
          <td>?</td>
      </tr>
      <tr>
          <td>dns</td>
          <td>a DNS server, <code>dnsmasq</code></td>
          <td>?</td>
      </tr>
  </tbody>
</table>
<p>You&rsquo;ll fill in the question marks yourself, by asking each host.</p>
<h3 id="ss-whos-listening"><code>ss</code>: who&rsquo;s listening?</h3>
<p><strong><code>ss</code></strong> (short for <em>socket statistics</em>) lists a computer&rsquo;s sockets: its open doors and its conversations.
The letters after it pick what to show:</p>
<table>
  <thead>
      <tr>
          <th>Letter</th>
          <th>Means</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td><code>t</code></td>
          <td>TCP sockets</td>
      </tr>
      <tr>
          <td><code>u</code></td>
          <td>UDP sockets</td>
      </tr>
      <tr>
          <td><code>l</code></td>
          <td>only the ones <strong>listening</strong> (waiting for someone to connect)</td>
      </tr>
      <tr>
          <td><code>n</code></td>
          <td>show port <strong>numbers</strong>, not names: <code>80</code>, not <code>http</code></td>
      </tr>
  </tbody>
</table>
<p>So <code>ss -tln</code> means <em>TCP, listening, numbers</em>, and <code>ss -uln</code> the same for UDP.</p>
<p class="lab-recap"><span class="mono">in one sentence</span> <code>ss -tln</code> lists the TCP ports a computer is listening on; <code>ss -uln</code> the UDP ones.</p>
<h3 id="two-ends-of-every-conversation">Two ends of every conversation</h3>
<p>When the laptop opens web&rsquo;s page, the conversation has two sockets: web&rsquo;s, on its well-known port, and the
laptop&rsquo;s, on a <strong>temporary</strong> port the laptop picks for this one conversation. Linux picks it from a range it
keeps in a file, <code>32768</code> to <code>60999</code> unless someone changes it. Ask twice and you get two different numbers.</p>
<h3 id="open-or-closed">Open, or closed?</h3>
<p>Try to connect to a port nobody&rsquo;s listening on, and web&rsquo;s own system answers straight away: <em>nobody here</em>. On
the laptop, that&rsquo;s <strong>connection refused</strong>. It&rsquo;s a useful answer: the computer is there and reachable, there just
isn&rsquo;t a program behind that door. (A firewall that silently drops the message looks different: no answer at
all, until you give up waiting.)</p>
<p class="lab-recap"><span class="mono">in one sentence</span> <em>Connection refused</em> means the computer answered, but nothing listens on that port.</p>

  </div>
</section>


<section class="lab-stage lab-stage-show" id="show">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">2</span>
    <span class="lab-stage-kind mono">show</span><h2>Reading ss and curl</h2>
  </header>
  <div class="lab-stage-body">
    <p>On web:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">web:~# ss -tln
</span></span><span class="line"><span class="cl">State  Recv-Q Send-Q Local Address:Port Peer Address:Port
</span></span><span class="line"><span class="cl">LISTEN 0      9                  *:80              *:*
</span></span></code></pre></div><table>
  <thead>
      <tr>
          <th>Part</th>
          <th>What it means</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td><code>LISTEN</code></td>
          <td>waiting for someone to connect</td>
      </tr>
      <tr>
          <td><code>*:80</code></td>
          <td><strong>Local Address:Port</strong>: on any of web&rsquo;s addresses (<code>*</code>), port <code>80</code></td>
      </tr>
      <tr>
          <td><code>*:*</code></td>
          <td>the other end: anyone, from any port. Nobody&rsquo;s connected yet</td>
      </tr>
  </tbody>
</table>
<p>(<code>Recv-Q</code> and <code>Send-Q</code> are how much is waiting to be read or sent: skip them.)</p>
<p>On the laptop, <code>curl</code> can print the two sockets of the conversation it just had. <code>-w</code> means <em>write out these
details when you&rsquo;re done</em>:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">laptop:~# curl -s -w &#39;\n%{local_ip}:%{local_port} -&gt; %{remote_ip}:%{remote_port}\n&#39; web.lab
</span></span><span class="line"><span class="cl">Hello from web.lab, 192.168.2.10
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">192.168.1.100:54366 -&gt; 192.168.2.10:80
</span></span></code></pre></div><p>The first line is the page. The last line is the conversation: the laptop&rsquo;s socket, then web&rsquo;s. <code>54366</code> is the
laptop&rsquo;s temporary port; yours will be different.</p>

  </div>
</section>


<section class="lab-stage lab-stage-follow" id="follow">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">3</span>
    <span class="lab-stage-kind mono">follow along</span><h2>Knock on the doors</h2>
  </header>
  <div class="lab-stage-body">
    <ol>
<li>
<p>Log in to web: click <strong>web</strong> on the <strong>Topology</strong> tab. In the <strong>web</strong> tab, see what it&rsquo;s listening on:</p>
<div class="lab-file lab-file-run mono">
  <span class="lab-file-kind">run in the web tab</span>
</div>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">ss -tln
</span></span><span class="line"><span class="cl">ss -uln
</span></span></code></pre></div><p>One TCP line, <code>LISTEN ... *:80</code>: that&rsquo;s the web server. <code>ss -uln</code> prints only its heading: web has no UDP
doors at all.</p>
</li>
<li>
<p>Now dns: click <strong>dns</strong> on the Topology tab. In the <strong>dns</strong> tab:</p>
<div class="lab-file lab-file-run mono">
  <span class="lab-file-kind">run in the dns tab</span>
</div>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">ss -uln
</span></span><span class="line"><span class="cl">ss -tln
</span></span></code></pre></div><p>Port <code>53</code> in both. UDP lines say <code>UNCONN</code> (<em>unconnected</em>: UDP has no connections, so nothing to listen
for); TCP lines say <code>LISTEN</code>. DNS answers questions over UDP, and over TCP when an answer is too big, just
as lesson 5.1 said. The <code>[::]</code> lines are the same door for IPv6 addresses.</p>
</li>
<li>
<p>Click <strong>laptop</strong> on the Topology tab. In the <strong>laptop</strong> tab, open web&rsquo;s page and print both sockets. Run
it twice:</p>
<div class="lab-file lab-file-run mono">
  <span class="lab-file-kind">run in the laptop tab</span>
</div>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">curl -s -w <span class="s1">&#39;\n%{local_ip}:%{local_port} -&gt; %{remote_ip}:%{remote_port}\n&#39;</span> web.lab
</span></span><span class="line"><span class="cl">curl -s -w <span class="s1">&#39;\n%{local_ip}:%{local_port} -&gt; %{remote_ip}:%{remote_port}\n&#39;</span> web.lab
</span></span></code></pre></div><p>web&rsquo;s side is <code>:80</code> both times; the laptop&rsquo;s port changes. Two conversations, two temporary ports.</p>
</li>
<li>
<p>See the range the laptop picks from:</p>
<div class="lab-file lab-file-run mono">
  <span class="lab-file-kind">run in the laptop tab</span>
</div>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">cat /proc/sys/net/ipv4/ip_local_port_range
</span></span></code></pre></div><p><code>32768	60999</code>. Both your ports are in it.</p>
</li>
<li>
<p>Ask DNS over TCP, to see the other door on dns working:</p>
<div class="lab-file lab-file-run mono">
  <span class="lab-file-kind">run in the laptop tab</span>
</div>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">dig +tcp web.lab
</span></span></code></pre></div><p>Same answer as in task 3.2, but the last lines say <code>SERVER: 192.168.2.53#53(192.168.2.53) (TCP)</code>.</p>
</li>
<li>
<p>Knock on a door nobody&rsquo;s behind: port 22, where SSH would listen. <code>-v</code> (<em>verbose</em>) makes curl say what
happened:</p>
<div class="lab-file lab-file-run mono">
  <span class="lab-file-kind">run in the laptop tab</span>
</div>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">curl -v web.lab:22
</span></span></code></pre></div><p>Look for the line with <code>failed:</code> in it:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">* connect to 192.168.2.10 port 22 from 192.168.1.100 port 45462 failed: Connection refused
</span></span></code></pre></div><p>web answered at once: nothing listens on 22. That line also shows the laptop&rsquo;s temporary port for this try.</p>
</li>
<li>
<p>Fill in <strong>Your answers</strong>, under the guide, with one of your own ports from step 3:</p>
<div class="lab-file lab-file-edit mono">
  <span class="lab-file-kind">edit</span><code>Your answers</code><span class="lab-file-how">under the guide</span>
</div>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">The TCP port web&#39;s web server listens on: 80
</span></span><span class="line"><span class="cl">The port dns&#39;s DNS server listens on: 53
</span></span><span class="line"><span class="cl">The laptop&#39;s own port, from curl&#39;s last line: 54366
</span></span><span class="line"><span class="cl">One word: what curl says when you try web.lab:22: refused
</span></span></code></pre></div></li>
</ol>
<p class="lab-recap"><span class="mono">in one sentence</span> <code>ss</code> shows a computer&rsquo;s doors from the inside; <code>curl</code> shows a conversation from the outside, both sockets of it.</p>

  </div>
</section>


<section class="lab-stage lab-stage-challenge" id="challenge">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">4</span>
    <span class="lab-stage-kind mono">challenge</span><h2>A second door</h2>
  </header>
  <div class="lab-stage-body">
    <p>Right now <code>curl web.lab:8080</code> from the laptop is refused. Make it work: web should serve the same page on TCP
port <strong>8080</strong> as well as on 80. Then click <strong>Check task 3.3</strong>, under the guide.</p>
<details class="lab-hint">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="11" cy="11" r="7"/><path d="m20 20-4-4"/></svg>
 <span>hint</span></summary>
  <div class="lab-hint-body"><p>A port only opens when a program listens on it. web&rsquo;s web server is <code>httpd</code>, and one <code>httpd</code> listens on one
port. You can start a second one. (You&rsquo;ll do it in the <strong>web</strong> tab, not the laptop&rsquo;s.)</p>
</div>
</details>
<details class="lab-hint">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="11" cy="11" r="7"/><path d="m20 20-4-4"/></svg>
 <span>hint</span></summary>
  <div class="lab-hint-body"><p><code>httpd --help</code> lists its options. Two of them matter: which port to listen on, and which folder its pages are
in. web&rsquo;s page is in <code>/srv/www</code>.</p>
</div>
</details>
<details class="lab-solution">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M14 4h6v6M20 4l-9 9M18 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h5"/></svg>
 <span>show the solution</span></summary>
  <div class="lab-solution-body">
    <p>In the <strong>web</strong> tab:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">web:~# httpd -p 8080 -h /srv/www
</span></span><span class="line"><span class="cl">web:~# ss -tln
</span></span><span class="line"><span class="cl">State  Recv-Q Send-Q Local Address:Port Peer Address:Port
</span></span><span class="line"><span class="cl">LISTEN 0      9                  *:80              *:*
</span></span><span class="line"><span class="cl">LISTEN 0      9                  *:8080            *:*
</span></span></code></pre></div><p><code>-p 8080</code> is the port, <code>-h /srv/www</code> the folder. Now two doors, the same page behind each. In the <strong>laptop</strong> tab:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">laptop:~# curl web.lab:8080
</span></span><span class="line"><span class="cl">Hello from web.lab, 192.168.2.10
</span></span></code></pre></div><p>Port 8080 isn&rsquo;t special: it&rsquo;s simply a number people often pick for a second web server. Nothing about the
page changed, only the door it comes through. That&rsquo;s why a firewall that allows port 80 and nothing else
would still block 8080.</p>
<p><strong>Reset network</strong>, in the top bar, closes the new door again: the lab starts from how it was.</p>
<p>That&rsquo;s the whole of Networking 101. You&rsquo;ve read a host&rsquo;s MAC address, IP address and prefix, watched DHCP lend
an address, seen ARP and a switch&rsquo;s MAC table, fixed a wrong prefix and a missing route, given a host a name,
and found the port behind a service. Those are the first things an engineer checks when something won&rsquo;t
connect, in that order.</p>
  </div>
</details>

  </div>
</section>

]]></content:encoded></item><item><title>Names for addresses</title><link>https://networkdoodles.com/labs/networking-101-lab/task-3-2/</link><pubDate>Thu, 12 Nov 2026 09:00:00 -0500</pubDate><dc:creator>David Henderson</dc:creator><guid>https://networkdoodles.com/labs/networking-101-lab/task-3-2/</guid><description> new to this? step by stepbeginner Click laptop on the Topology tab. In the laptop tab: cat /etc/resolv.conf, dig web.lab, nslookup web.lab and curl web.lab. Write the DNS server and web’s address in Your answers, under the guide. Challenge: dig printer.lab finds nothing. Add a line to lab/dns/lab.hosts (the switcher above the box) so it does. Check task 3.2, under the guide. more in meet the lab</description><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[
<details class="lab-basics">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="8" r="4"/><path d="M4 21c0-4 4-6 8-6s8 2 8 6"/></svg>
 <span>new to this? step by step</span><em>beginner</em></summary>
  <div class="lab-basics-body">
    <ol>
<li>Click <strong>laptop</strong> on the <strong>Topology</strong> tab. In the <strong>laptop</strong> tab: <code>cat /etc/resolv.conf</code>, <code>dig web.lab</code>, <code>nslookup web.lab</code> and <code>curl web.lab</code>.</li>
<li>Write the DNS server and web&rsquo;s address in <strong>Your answers</strong>, under the guide.</li>
<li>Challenge: <code>dig printer.lab</code> finds nothing. Add a line to <strong>lab/dns/lab.hosts</strong> (the switcher above the box) so it does.</li>
<li><strong>Check task 3.2</strong>, under the guide.</li>
</ol>

    <p class="lab-basics-more mono">more in <a href="/labs/basics/">meet the lab</a></p>
  </div>
</details>


<section class="lab-stage lab-stage-explain" id="explain">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">1</span>
    <span class="lab-stage-kind mono">explain</span><h2>The internet&rsquo;s phone book</h2>
  </header>
  <div class="lab-stage-body">
    <h3 id="names-are-for-people">Names are for people</h3>
<p>You don&rsquo;t remember your friends&rsquo; phone numbers; you remember their names, and your phone looks the number up.
Computers are the other way round: to send anything, they need the <strong>IP address</strong>. But people would much
rather type <code>networkdoodles.com</code> than a string of numbers.</p>
<p><strong>DNS</strong>, the <strong>Domain Name System</strong>, joins the two. A <strong>DNS server</strong> is a computer that answers one question,
over and over: <em>what&rsquo;s the IP address for this name?</em> Your computer asks before it sends anything to a name.</p>
<p class="lab-recap"><span class="mono">in one sentence</span> DNS turns a name into an IP address, so people can use names and computers can use numbers.</p>
<h3 id="where-the-laptop-gets-its-dns-server">Where the laptop gets its DNS server</h3>
<p>You&rsquo;ve already seen it. In task 1.2, DHCP lent the laptop four things, and one was a DNS server:
<code>192.168.2.53</code>. The laptop wrote it in <code>/etc/resolv.conf</code>. Every program on the laptop that needs a name
looked up reads that file to know who to ask.</p>
<p>The same file has <code>search lab</code>. It means: <em>if someone types a short name with no dot in it, like <code>web</code>, try
<code>web.lab</code> too</em>. That&rsquo;s why you can type the short name inside a network.</p>
<p class="lab-recap"><span class="mono">in one sentence</span> The DNS server&rsquo;s address comes from DHCP and lives in <code>/etc/resolv.conf</code>.</p>
<h3 id="records">Records</h3>
<p>A DNS server keeps a list of names and what goes with them. Each entry is a <strong>record</strong>. The kind that holds an
IPv4 address is an <strong>A record</strong> (<em>A</em> for <em>address</em>). This lab&rsquo;s DNS server, <code>dns</code>, reads its A records from one
plain file: <strong>lab/dns/lab.hosts</strong>. In this task you can open it in the box under the guide.</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">192.168.2.10  web.lab
</span></span><span class="line"><span class="cl">192.168.2.53  dns.lab
</span></span><span class="line"><span class="cl">192.168.1.1   r1.lab
</span></span></code></pre></div><p>On the internet, DNS servers have millions of names, and they ask each other when they don&rsquo;t know one. This
one only knows the names in that file, and it never asks anyone else: the lab has no internet.</p>
<h3 id="two-tools-that-ask">Two tools that ask</h3>
<table>
  <thead>
      <tr>
          <th>Command</th>
          <th>What it&rsquo;s good for</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td><code>dig</code></td>
          <td>shows the whole question and answer, every part labelled. Engineers use it to see exactly what a DNS server said</td>
      </tr>
      <tr>
          <td><code>nslookup</code></td>
          <td>a shorter answer. It&rsquo;s also on Windows and Mac, so it&rsquo;s the one you can try on any computer</td>
      </tr>
  </tbody>
</table>
<p>Both ask the DNS server directly. Other programs, like <code>ping</code> and <code>curl</code>, look the name up quietly first and
then use the address.</p>

  </div>
</section>


<section class="lab-stage lab-stage-show" id="show">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">2</span>
    <span class="lab-stage-kind mono">show</span><h2>Reading dig</h2>
  </header>
  <div class="lab-stage-body">
    <div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">laptop:~# dig web.lab
</span></span><span class="line"><span class="cl">...
</span></span><span class="line"><span class="cl">;; -&gt;&gt;HEADER&lt;&lt;- opcode: QUERY, status: NOERROR, id: 46697
</span></span><span class="line"><span class="cl">...
</span></span><span class="line"><span class="cl">;; QUESTION SECTION:
</span></span><span class="line"><span class="cl">;web.lab.			IN	A
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">;; ANSWER SECTION:
</span></span><span class="line"><span class="cl">web.lab.		60	IN	A	192.168.2.10
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">;; Query time: 3 msec
</span></span><span class="line"><span class="cl">;; SERVER: 192.168.2.53#53(192.168.2.53) (UDP)
</span></span></code></pre></div><table>
  <thead>
      <tr>
          <th>Part</th>
          <th>What it means</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td><code>status: NOERROR</code></td>
          <td>it found the name. <code>NXDOMAIN</code> means <em>no such name</em> (<em>non-existent domain</em>)</td>
      </tr>
      <tr>
          <td><code>QUESTION SECTION</code></td>
          <td>what the laptop asked: the A record for <code>web.lab</code></td>
      </tr>
      <tr>
          <td><code>ANSWER SECTION</code></td>
          <td>the answer: <code>web.lab</code> is <code>192.168.2.10</code></td>
      </tr>
      <tr>
          <td><code>60</code></td>
          <td>how many seconds the laptop may remember the answer before asking again (the <em>time to live</em>, like a lease)</td>
      </tr>
      <tr>
          <td><code>SERVER: 192.168.2.53#53</code></td>
          <td>who answered: the DNS server, on <strong>port 53</strong>, the DNS port</td>
      </tr>
      <tr>
          <td><code>(UDP)</code></td>
          <td>the question went in a UDP message: a single postcard, no conversation first</td>
      </tr>
  </tbody>
</table>
<p>The port and UDP are layer 4, from <a href="/lessons/networking-101/task-1-2/">lesson 1.2</a> and
<a href="/lessons/networking-101/task-5-1/">lesson 5.1</a>: the address gets the question to the dns host, and port 53
gets it to the DNS program on it.</p>

  </div>
</section>


<section class="lab-stage lab-stage-follow" id="follow">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">3</span>
    <span class="lab-stage-kind mono">follow along</span><h2>Ask for a name</h2>
  </header>
  <div class="lab-stage-body">
    <ol>
<li>
<p>Log in to the laptop: click <strong>laptop</strong> on the <strong>Topology</strong> tab. In the <strong>laptop</strong> tab, see who it asks:</p>
<div class="lab-file lab-file-run mono">
  <span class="lab-file-kind">run in the laptop tab</span>
</div>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">cat /etc/resolv.conf
</span></span></code></pre></div><p><code>nameserver 192.168.2.53</code> and <code>search lab</code>.</p>
</li>
<li>
<p>Ask for web&rsquo;s address, both ways:</p>
<div class="lab-file lab-file-run mono">
  <span class="lab-file-kind">run in the laptop tab</span>
</div>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">dig web.lab
</span></span><span class="line"><span class="cl">nslookup web.lab
</span></span></code></pre></div><p>Find the answer in each. <code>nslookup</code> prints the server it asked (<code>Server: 192.168.2.53</code>), then the name and
its address.</p>
</li>
<li>
<p>Use the name. <code>curl</code> fetches a web page and prints what&rsquo;s in it:</p>
<div class="lab-file lab-file-run mono">
  <span class="lab-file-kind">run in the laptop tab</span>
</div>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">curl web.lab
</span></span><span class="line"><span class="cl">ping -c <span class="m">2</span> web
</span></span></code></pre></div><p><code>curl</code> prints <code>Hello from web.lab, 192.168.2.10</code>: the laptop looked up the name, then opened the page at that
address. <code>ping web</code> works with the short name because of <code>search lab</code>, and ping prints the full name it
found.</p>
</li>
<li>
<p>Ask for a name that doesn&rsquo;t exist:</p>
<div class="lab-file lab-file-run mono">
  <span class="lab-file-kind">run in the laptop tab</span>
</div>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">dig printer.lab
</span></span></code></pre></div><p><code>status: NXDOMAIN</code>, and no answer section. The DNS server has never heard of it.</p>
</li>
<li>
<p>Fill in <strong>Your answers</strong>, under the guide:</p>
<div class="lab-file lab-file-edit mono">
  <span class="lab-file-kind">edit</span><code>Your answers</code><span class="lab-file-how">under the guide</span>
</div>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">The laptop&#39;s DNS server: 192.168.2.53
</span></span><span class="line"><span class="cl">web.lab&#39;s address, from dig: 192.168.2.10
</span></span></code></pre></div></li>
</ol>
<p class="lab-recap"><span class="mono">in one sentence</span> <code>dig</code> and <code>nslookup</code> ask the DNS server directly; <code>curl</code> and <code>ping</code> look the name up and then use the address.</p>

  </div>
</section>


<section class="lab-stage lab-stage-challenge" id="challenge">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">4</span>
    <span class="lab-stage-kind mono">challenge</span><h2>Name the printer</h2>
  </header>
  <div class="lab-stage-body">
    <p>Make <code>dig printer.lab</code> on the laptop answer with the printer&rsquo;s address, so that <code>ping -c 2 printer.lab</code> works.
Then click <strong>Check task 3.2</strong>, under the guide.</p>
<details class="lab-hint">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="11" cy="11" r="7"/><path d="m20 20-4-4"/></svg>
 <span>hint</span></summary>
  <div class="lab-hint-body"><p>The names live in <strong>lab/dns/lab.hosts</strong>. Pick it with the small switcher above the box under the guide. You
don&rsquo;t log in to the dns host at all.</p>
</div>
</details>
<details class="lab-hint">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="11" cy="11" r="7"/><path d="m20 20-4-4"/></svg>
 <span>hint</span></summary>
  <div class="lab-hint-body"><p>Each line is an address, some spaces, then the name. The printer&rsquo;s address is the one you found in task 1.1.</p>
</div>
</details>
<details class="lab-solution">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M14 4h6v6M20 4l-9 9M18 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h5"/></svg>
 <span>show the solution</span><em>lab/dns/lab.hosts</em></summary>
  <div class="lab-solution-body">
    <p class="mono lab-solution-tip">or let the lab do it: <b>Solve it for me</b>, next to Check task, does the task and fills in the answers, printing every step</p>
    <div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">192.168.1.20  printer.lab
</span></span></code></pre></div><p>Add that line, then click away from the box (or press <kbd>Ctrl</kbd>+<kbd>S</kbd>) to save it. The DNS
server notices the file changed and reads it again by itself, within a second or two. Then, in the <strong>laptop</strong>
tab:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">laptop:~# dig +short printer.lab
</span></span><span class="line"><span class="cl">192.168.1.20
</span></span><span class="line"><span class="cl">laptop:~# ping -c 2 printer
</span></span><span class="line"><span class="cl">PING printer.lab (192.168.1.20) 56(84) bytes of data.
</span></span><span class="line"><span class="cl">64 bytes from printer.lab (192.168.1.20): icmp_seq=1 ttl=64 time=0.402 ms
</span></span></code></pre></div><p>(<code>+short</code> asks <code>dig</code> for just the answer.) Notice the printer&rsquo;s <code>ttl=64</code>: it&rsquo;s on the laptop&rsquo;s own network, so
no router took 1 off. Compare web&rsquo;s <code>ttl=62</code> in task 2.2.</p>
<p>The name gets the laptop to web&rsquo;s address. Task 3.3 looks at the last step: which program on web answers, and
on which port.</p>
  </div>
</details>

  </div>
</section>

]]></content:encoded></item><item><title>Across two routers</title><link>https://networkdoodles.com/labs/networking-101-lab/task-3-1/</link><pubDate>Thu, 12 Nov 2026 09:00:00 -0500</pubDate><dc:creator>David Henderson</dc:creator><guid>https://networkdoodles.com/labs/networking-101-lab/task-3-1/</guid><description> new to this? step by stepbeginner Click laptop on the Topology tab. In the laptop tab: traceroute -n 192.168.2.10. Click r1. In the r1 tab: show ip route. Do the same in an r2 tab. Fill in Your answers, under the guide. Challenge: click Break it, next to Check task, then find out which router lost a route, and put it back. Check task 3.1, under the guide. more in meet the lab</description><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[
<details class="lab-basics">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="8" r="4"/><path d="M4 21c0-4 4-6 8-6s8 2 8 6"/></svg>
 <span>new to this? step by step</span><em>beginner</em></summary>
  <div class="lab-basics-body">
    <ol>
<li>Click <strong>laptop</strong> on the <strong>Topology</strong> tab. In the <strong>laptop</strong> tab: <code>traceroute -n 192.168.2.10</code>.</li>
<li>Click <strong>r1</strong>. In the <strong>r1</strong> tab: <code>show ip route</code>. Do the same in an <strong>r2</strong> tab. Fill in <strong>Your answers</strong>, under the guide.</li>
<li>Challenge: click <strong>Break it</strong>, next to Check task, then find out which router lost a route, and put it back.</li>
<li><strong>Check task 3.1</strong>, under the guide.</li>
</ol>

    <p class="lab-basics-more mono">more in <a href="/labs/basics/">meet the lab</a></p>
  </div>
</details>


<section class="lab-stage lab-stage-explain" id="explain">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">1</span>
    <span class="lab-stage-kind mono">explain</span><h2>How a packet finds its way</h2>
  </header>
  <div class="lab-stage-body">
    <h3 id="asking-for-directions-one-stop-at-a-time">Asking for directions, one stop at a time</h3>
<p>Imagine posting a letter to a town you&rsquo;ve never been to. Your local post office doesn&rsquo;t know every street in
the country. It only knows <em>letters for that region go to the big sorting office</em>. The sorting office knows
which local office to send it to, and that office knows the street. Nobody knows the whole way; each one knows
the <strong>next stop</strong>.</p>
<p>Routers work like that. Each one has a <strong>routing table</strong>: a list of networks it knows how to reach, and for
each one, where to send packets next. That <em>where next</em> is called the <strong>next hop</strong>.</p>
<p class="lab-recap"><span class="mono">in one sentence</span> A router doesn&rsquo;t know the whole path; its routing table says which next hop to send each network to.</p>
<h3 id="how-a-router-fills-its-routing-table">How a router fills its routing table</h3>
<table>
  <thead>
      <tr>
          <th>How</th>
          <th>What it means</th>
          <th>In this lab</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td><strong>connected</strong></td>
          <td>a network on one of its own ports: it&rsquo;s right there</td>
          <td>r1 knows <code>192.168.1.0/24</code> because it has an address on it</td>
      </tr>
      <tr>
          <td><strong>static</strong></td>
          <td>a route someone typed in by hand</td>
          <td>r1 was told <em>192.168.2.0/24: send it to r2</em></td>
      </tr>
      <tr>
          <td><strong>dynamic</strong></td>
          <td>routers telling each other what they know, with a routing protocol</td>
          <td>not in this lab: it&rsquo;s a later course</td>
      </tr>
  </tbody>
</table>
<h3 id="the-networks-between-r1-and-r2">The networks between r1 and r2</h3>
<p>The link between the two routers is <code>10.0.0.0/30</code>: four addresses, two usable, one for each router. That&rsquo;s the
<code>/30</code> from <a href="/lessons/networking-101/task-3-3/">lesson 3.3</a>, the right size for a cable between two routers.</p>
<p>Behind r2, the servers&rsquo; block <code>192.168.2.0/24</code> is split with VLSM into two <code>/28</code>s, one per server network:
<code>192.168.2.0/28</code> for web and <code>192.168.2.48/28</code> for dns. r1 doesn&rsquo;t need to know that. One route,
<code>192.168.2.0/24 via r2</code>, covers both, because both fit inside it.</p>
<h3 id="routes-have-to-work-both-ways">Routes have to work both ways</h3>
<p>A ping is two trips: there, and back. web&rsquo;s answer goes to <code>192.168.1.50</code>, the laptop, and every router on
the way back needs a route for <em>that</em> network. If one doesn&rsquo;t have it, the ping goes out fine and the answer
is thrown away. From the laptop it looks just the same as if the packet never arrived.</p>
<p class="lab-recap"><span class="mono">in one sentence</span> Every router on the way there needs a route to the destination, and every router on the way back needs a route to the source.</p>
<h3 id="traceroute-whos-on-the-way">traceroute: who&rsquo;s on the way?</h3>
<p>In <a href="/lessons/networking-101/task-2-3/">lesson 2.3</a> you tried <code>tracert</code> (on Windows) or <code>traceroute</code> (Mac and
Linux) on your own computer. Here&rsquo;s how it works.</p>
<p>Every packet carries a number called its <strong>TTL</strong>, <em>time to live</em>. Each router that passes the packet on takes 1
off it, and if it reaches 0, the router throws the packet away and sends a small message back to the sender:
<em>time exceeded</em>, from the router&rsquo;s own address. (That&rsquo;s what stops a packet going round in circles for ever if
the routes are wrong.)</p>
<p><code>traceroute</code> uses this on purpose. It sends a packet with TTL 1: the first router drops it, and its message
says who it is. Then TTL 2: the second router answers. And so on, until the destination itself answers. One
line per stop.</p>
<p class="lab-recap"><span class="mono">in one sentence</span> traceroute sends packets that run out of time one router further each time, so each router on the way says who it is.</p>

  </div>
</section>


<section class="lab-stage lab-stage-show" id="show">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">2</span>
    <span class="lab-stage-kind mono">show</span><h2>A path and a routing table</h2>
  </header>
  <div class="lab-stage-body">
    <p>From the laptop:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">laptop:~# traceroute -n 192.168.2.10
</span></span><span class="line"><span class="cl">traceroute to 192.168.2.10 (192.168.2.10), 30 hops max, 60 byte packets
</span></span><span class="line"><span class="cl"> 1  192.168.1.1  0.130 ms  0.021 ms  0.026 ms
</span></span><span class="line"><span class="cl"> 2  10.0.0.2  0.099 ms  0.040 ms  0.043 ms
</span></span><span class="line"><span class="cl"> 3  192.168.2.10  0.075 ms  0.051 ms  0.050 ms
</span></span></code></pre></div><table>
  <thead>
      <tr>
          <th>Line</th>
          <th>Who</th>
          <th>Why that address</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td><code>1  192.168.1.1</code></td>
          <td>r1</td>
          <td>its address on the side the packet came in: the home network</td>
      </tr>
      <tr>
          <td><code>2  10.0.0.2</code></td>
          <td>r2</td>
          <td>its address on the link from r1</td>
      </tr>
      <tr>
          <td><code>3  192.168.2.10</code></td>
          <td>web</td>
          <td>the destination: done</td>
      </tr>
  </tbody>
</table>
<p>Each line has three times because traceroute tries each stop three times. <code>-n</code> means <em>show numbers</em>: don&rsquo;t
look up names for the addresses.</p>
<p>On r1, <code>show ip route</code>:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">r1#show ip route
</span></span><span class="line"><span class="cl">Codes: C - connected, L - local, S - static, O - OSPF, B - BGP, D - EIGRP
</span></span><span class="line"><span class="cl">       ...
</span></span><span class="line"><span class="cl">Gateway of last resort is not set
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">      10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
</span></span><span class="line"><span class="cl">C        10.0.0.0/30 is directly connected, GigabitEthernet2
</span></span><span class="line"><span class="cl">L        10.0.0.1/32 is directly connected, GigabitEthernet2
</span></span><span class="line"><span class="cl">      192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
</span></span><span class="line"><span class="cl">C        192.168.1.0/24 is directly connected, GigabitEthernet1
</span></span><span class="line"><span class="cl">L        192.168.1.1/32 is directly connected, GigabitEthernet1
</span></span><span class="line"><span class="cl">S     192.168.2.0/24 [1/0] via 10.0.0.2, 00:01:32, GigabitEthernet2
</span></span></code></pre></div><table>
  <thead>
      <tr>
          <th>Letter</th>
          <th>Meaning</th>
          <th>Example</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td><code>C</code></td>
          <td><strong>connected</strong>: a network on one of r1&rsquo;s ports</td>
          <td><code>192.168.1.0/24</code> on GigabitEthernet1, the home network</td>
      </tr>
      <tr>
          <td><code>L</code></td>
          <td><strong>local</strong>: r1&rsquo;s own address on that port, as a <code>/32</code> (one address)</td>
          <td><code>192.168.1.1/32</code></td>
      </tr>
      <tr>
          <td><code>S</code></td>
          <td><strong>static</strong>: typed in</td>
          <td><code>192.168.2.0/24 via 10.0.0.2</code>: <em>send it to r2</em></td>
      </tr>
  </tbody>
</table>
<p><code>Gateway of last resort is not set</code> means r1 has no default route: a packet for a network that isn&rsquo;t in this
table is thrown away. (<em>Variably subnetted</em> means the table has networks of more than one size in that
block; you can skip those lines.)</p>

  </div>
</section>


<section class="lab-stage lab-stage-follow" id="follow">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">3</span>
    <span class="lab-stage-kind mono">follow along</span><h2>Follow the path</h2>
  </header>
  <div class="lab-stage-body">
    <ol>
<li>
<p>Trace the path from the laptop to web, then to dns. Click <strong>laptop</strong> on the <strong>Topology</strong> tab. In the
<strong>laptop</strong> tab:</p>
<div class="lab-file lab-file-run mono">
  <span class="lab-file-kind">run in the laptop tab</span>
</div>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">traceroute -n 192.168.2.10
</span></span><span class="line"><span class="cl">traceroute -n 192.168.2.53
</span></span></code></pre></div><p>Both go through the same two routers. Only the last line differs.</p>
</li>
<li>
<p>Read r1&rsquo;s routing table. Click <strong>r1</strong> on the Topology tab. In the <strong>r1</strong> tab:</p>
<div class="lab-file lab-file-run mono">
  <span class="lab-file-kind">run in the r1 tab</span>
</div>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">show ip route
</span></span></code></pre></div><p>Find the <code>S</code> line. Where does r1 send packets for <code>192.168.2.0/24</code>?</p>
</li>
<li>
<p>Read r2&rsquo;s. Click <strong>r2</strong> on the Topology tab. In the <strong>r2</strong> tab:</p>
<div class="lab-file lab-file-run mono">
  <span class="lab-file-kind">run in the r2 tab</span>
</div>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">show ip route
</span></span></code></pre></div><p>r2 has the two <code>/28</code> server networks as <code>C</code> lines, the link to r1, and an <code>S</code> line for the way back to
the home network, <code>192.168.1.0/24 via 10.0.0.1</code>.</p>
</li>
<li>
<p>Fill in the follow-along answers in <strong>Your answers</strong>, under the guide:</p>
<div class="lab-file lab-file-edit mono">
  <span class="lab-file-kind">edit</span><code>Your answers</code><span class="lab-file-how">under the guide</span>
</div>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">Where r1 sends packets for 192.168.2.0/24: 10.0.0.2
</span></span><span class="line"><span class="cl">How many hops traceroute counts to web: 3
</span></span></code></pre></div></li>
</ol>
<p class="lab-recap"><span class="mono">in one sentence</span> traceroute shows the path from outside; <code>show ip route</code> on each router shows why it goes that way.</p>

  </div>
</section>


<section class="lab-stage lab-stage-challenge" id="challenge">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">4</span>
    <span class="lab-stage-kind mono">challenge</span><h2>Something&rsquo;s broken</h2>
  </header>
  <div class="lab-stage-body">
    <p>Break the network: click <strong>Break it</strong>, next to <strong>Check task 3.1</strong> under the guide.</p>
<p>It changes one router&rsquo;s configuration. Don&rsquo;t go looking for what it changed: find the problem the way you
would on a real network, from the laptop first. In the <strong>laptop</strong> tab:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">laptop:~# traceroute -n -m 5 192.168.2.10
</span></span></code></pre></div><p>(<code>-m 5</code> means <em>give up after 5 stops</em>, so you don&rsquo;t wait for 30.) Then:</p>
<ol>
<li>work out which router lost a route, and answer <em>Which router was missing a route</em> with <code>r1</code> or <code>r2</code> in <strong>Your answers</strong>;</li>
<li>put the route back, on that router;</li>
<li>click <strong>Check task 3.1</strong>.</li>
</ol>
<details class="lab-hint">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="11" cy="11" r="7"/><path d="m20 20-4-4"/></svg>
 <span>hint</span></summary>
  <div class="lab-hint-body"><p>traceroute gets an answer from r1 and then only <code>*</code>: nobody answers. Can the laptop ping r1&rsquo;s far side,
<code>10.0.0.1</code>? And r2&rsquo;s near side, <code>10.0.0.2</code>?</p>
</div>
</details>
<details class="lab-hint">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="11" cy="11" r="7"/><path d="m20 20-4-4"/></svg>
 <span>hint</span></summary>
  <div class="lab-hint-body"><p>Remember, routes have to work both ways. r2&rsquo;s answers have to come back to <code>192.168.1.50</code>. Look at
<code>show ip route</code> on r2: does it know where <code>192.168.1.0/24</code> is?</p>
</div>
</details>
<details class="lab-hint">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="11" cy="11" r="7"/><path d="m20 20-4-4"/></svg>
 <span>hint</span></summary>
  <div class="lab-hint-body"><p>A static route in configuration mode is <code>ip route &lt;network&gt; &lt;mask&gt; &lt;next hop&gt;</code>. The next hop is the router
on the other end of the link.</p>
</div>
</details>
<details class="lab-solution">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M14 4h6v6M20 4l-9 9M18 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h5"/></svg>
 <span>show the solution</span></summary>
  <div class="lab-solution-body">
    <p>r2 lost its route back to the home network: its <code>show ip route</code> has no <code>S</code> line any more. Packets from the
laptop still reach r2, and even web, but every answer (the ping replies, and r2&rsquo;s own <em>time exceeded</em>
messages) is for <code>192.168.1.50</code>, and r2 has no idea where that is. So it throws them away, and the laptop
sees nothing after r1.</p>
<p>Put it back on r2, in the <strong>r2</strong> tab:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">r2#configure terminal
</span></span><span class="line"><span class="cl">r2(config)#ip route 192.168.1.0 255.255.255.0 10.0.0.1
</span></span><span class="line"><span class="cl">r2(config)#end
</span></span><span class="line"><span class="cl">r2#show ip route
</span></span><span class="line"><span class="cl">...
</span></span><span class="line"><span class="cl">S     192.168.1.0/24 [1/0] via 10.0.0.1, 00:00:03, GigabitEthernet1
</span></span></code></pre></div><p>and in <strong>Your answers</strong>:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">Which router was missing a route: r2
</span></span></code></pre></div><p><code>traceroute -n 192.168.2.10</code> shows all three stops again. This is one of the most common faults there is: a
route on the way there and none on the way back. When the first stop answers and everything after it is
silent, look at the return path.</p>
  </div>
</details>

  </div>
</section>

]]></content:encoded></item><item><title>One wrong number</title><link>https://networkdoodles.com/labs/networking-101-lab/task-2-2/</link><pubDate>Thu, 12 Nov 2026 09:00:00 -0500</pubDate><dc:creator>David Henderson</dc:creator><guid>https://networkdoodles.com/labs/networking-101-lab/task-2-2/</guid><description> new to this? step by stepbeginner Click broken-pc on the Topology tab. In the broken-pc tab: ip addr show eth1, ip route, ping -c 3 192.168.2.10 and ip neigh. Fix the prefix: ip addr del 192.168.1.30/16 dev eth1, then ip addr add 192.168.1.30/24 dev eth1. Challenge: web still doesn’t answer. Find out why, and fix it. Check task 2.2, under the guide. more in meet the lab</description><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[
<details class="lab-basics">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="8" r="4"/><path d="M4 21c0-4 4-6 8-6s8 2 8 6"/></svg>
 <span>new to this? step by step</span><em>beginner</em></summary>
  <div class="lab-basics-body">
    <ol>
<li>Click <strong>broken-pc</strong> on the <strong>Topology</strong> tab. In the <strong>broken-pc</strong> tab: <code>ip addr show eth1</code>, <code>ip route</code>, <code>ping -c 3 192.168.2.10</code> and <code>ip neigh</code>.</li>
<li>Fix the prefix: <code>ip addr del 192.168.1.30/16 dev eth1</code>, then <code>ip addr add 192.168.1.30/24 dev eth1</code>.</li>
<li>Challenge: web still doesn&rsquo;t answer. Find out why, and fix it.</li>
<li><strong>Check task 2.2</strong>, under the guide.</li>
</ol>

    <p class="lab-basics-more mono">more in <a href="/labs/basics/">meet the lab</a></p>
  </div>
</details>


<section class="lab-stage lab-stage-explain" id="explain">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">1</span>
    <span class="lab-stage-kind mono">explain</span><h2>When a computer can reach some things and not others</h2>
  </header>
  <div class="lab-stage-body">
    <h3 id="the-story">The story</h3>
<p>Somebody set up broken-pc by hand, instead of letting DHCP do it. They typed its IP address right:
<code>192.168.1.30</code>. But they typed the <strong>prefix</strong> as <code>/16</code> instead of <code>/24</code>, and they forgot the <strong>gateway</strong>
completely. Now its owner says: <em>&ldquo;I can print, but I can&rsquo;t get to the website.&rdquo;</em></p>
<p>That&rsquo;s a real kind of fault, and it&rsquo;s worth knowing well: a wrong prefix doesn&rsquo;t break everything, which makes it
harder to spot. You&rsquo;ll find it the way an engineer would: look at what the computer believes, test, and
compare with a computer that works.</p>
<h3 id="what-the-prefix-decides">What the prefix decides</h3>
<p>From <a href="/lessons/networking-101/task-3-2/">lesson 3.2</a>: before sending anything, a host compares the
destination&rsquo;s network part with its own.</p>
<ul>
<li><strong>Same network?</strong> Send it straight there: ARP for the destination&rsquo;s MAC address (task 2.1).</li>
<li><strong>Different network?</strong> Send it to the default gateway.</li>
</ul>
<p>The prefix decides where the network part ends, so it decides the answer. With <code>/24</code>, broken-pc&rsquo;s network is
<code>192.168.1.0/24</code>: <code>192.168.1.0</code> to <code>192.168.1.255</code>. With <code>/16</code> it&rsquo;s <code>192.168.0.0/16</code>: everything from
<code>192.168.0.0</code> to <code>192.168.255.255</code>. That includes the printer, which is right, but it also includes web, at
<code>192.168.2.10</code>, which is wrong.</p>
<p class="lab-recap"><span class="mono">in one sentence</span> The prefix decides which addresses a host thinks are on its own network, and so whether it ARPs for them or uses the gateway.</p>
<h3 id="two-different-error-messages">Two different error messages</h3>
<p><code>ping</code> tells you <em>how</em> it failed, and the two messages mean different things:</p>
<table>
  <thead>
      <tr>
          <th>Message</th>
          <th>What the computer is telling you</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td><code>Destination Host Unreachable</code></td>
          <td><em>I think that address is on my network, I asked with ARP, and nobody answered.</em></td>
      </tr>
      <tr>
          <td><code>Network is unreachable</code></td>
          <td><em>I have no idea where that network is: no route for it, and no default gateway.</em></td>
      </tr>
  </tbody>
</table>
<p class="lab-recap"><span class="mono">in one sentence</span> <em>Host unreachable</em>: it ARPed and got no answer. <em>Network unreachable</em>: it has no route at all.</p>

  </div>
</section>


<section class="lab-stage lab-stage-show" id="show">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">2</span>
    <span class="lab-stage-kind mono">show</span><h2>What broken-pc believes</h2>
  </header>
  <div class="lab-stage-body">
    <div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">broken-pc:~# ip addr show eth1
</span></span><span class="line"><span class="cl">...
</span></span><span class="line"><span class="cl">    inet 192.168.1.30/16 scope global eth1
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">broken-pc:~# ip route
</span></span><span class="line"><span class="cl">192.168.0.0/16 dev eth1 proto kernel scope link src 192.168.1.30
</span></span></code></pre></div><p>Compare with the laptop&rsquo;s <code>ip route</code> from task 1.2:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">laptop:~# ip route
</span></span><span class="line"><span class="cl">default via 192.168.1.1 dev eth1
</span></span><span class="line"><span class="cl">192.168.1.0/24 dev eth1 proto kernel scope link src 192.168.1.50
</span></span></code></pre></div><table>
  <thead>
      <tr>
          <th></th>
          <th>broken-pc</th>
          <th>laptop</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>its own network</td>
          <td><code>192.168.0.0/16</code>: far too big</td>
          <td><code>192.168.1.0/24</code></td>
      </tr>
      <tr>
          <td><code>default via</code></td>
          <td>missing</td>
          <td><code>192.168.1.1</code>, r1</td>
      </tr>
  </tbody>
</table>
<p>The <code>192.168.0.0/16 dev eth1</code> line says: <em>every address from 192.168.0.0 to 192.168.255.255 is right here
on eth1</em>. So for web, broken-pc ARPs, and nobody on its network has <code>192.168.2.10</code>:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">broken-pc:~# ping -c 3 192.168.2.10
</span></span><span class="line"><span class="cl">PING 192.168.2.10 (192.168.2.10) 56(84) bytes of data.
</span></span><span class="line"><span class="cl">From 192.168.1.30 icmp_seq=1 Destination Host Unreachable
</span></span><span class="line"><span class="cl">From 192.168.1.30 icmp_seq=2 Destination Host Unreachable
</span></span><span class="line"><span class="cl">From 192.168.1.30 icmp_seq=3 Destination Host Unreachable
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">broken-pc:~# ip neigh
</span></span><span class="line"><span class="cl">192.168.2.10 dev eth1 FAILED
</span></span></code></pre></div><p><code>FAILED</code>: it asked <em>who has 192.168.2.10?</em> and nobody answered.</p>

  </div>
</section>


<section class="lab-stage lab-stage-follow" id="follow">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">3</span>
    <span class="lab-stage-kind mono">follow along</span><h2>Find it, then fix the prefix</h2>
  </header>
  <div class="lab-stage-body">
    <ol>
<li>
<p>Log in to broken-pc: click <strong>broken-pc</strong> on the <strong>Topology</strong> tab. In the <strong>broken-pc</strong> tab, look at what
it believes:</p>
<div class="lab-file lab-file-run mono">
  <span class="lab-file-kind">run in the broken-pc tab</span>
</div>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">ip addr show eth1
</span></span><span class="line"><span class="cl">ip route
</span></span></code></pre></div></li>
<li>
<p>Test both directions of the complaint. The printer first, then web:</p>
<div class="lab-file lab-file-run mono">
  <span class="lab-file-kind">run in the broken-pc tab</span>
</div>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">ping -c <span class="m">3</span> 192.168.1.20
</span></span><span class="line"><span class="cl">ping -c <span class="m">3</span> 192.168.2.10
</span></span><span class="line"><span class="cl">ip neigh
</span></span></code></pre></div><p>The printer answers. web gives <code>Destination Host Unreachable</code>, and the neighbour table has
<code>192.168.2.10 ... FAILED</code>. broken-pc thinks web is next door.</p>
</li>
<li>
<p>Fix the prefix. An address and its prefix go together, so you remove the wrong one and add the right one:</p>
<div class="lab-file lab-file-run mono">
  <span class="lab-file-kind">run in the broken-pc tab</span>
</div>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">ip addr del 192.168.1.30/16 dev eth1
</span></span><span class="line"><span class="cl">ip addr add 192.168.1.30/24 dev eth1
</span></span><span class="line"><span class="cl">ip route
</span></span></code></pre></div><p><code>ip route</code> now says <code>192.168.1.0/24 dev eth1</code>. Right size.</p>
</li>
<li>
<p>Try web again:</p>
<div class="lab-file lab-file-run mono">
  <span class="lab-file-kind">run in the broken-pc tab</span>
</div>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">ping -c <span class="m">3</span> 192.168.2.10
</span></span></code></pre></div><p>A different error now: <code>ping: connect: Network unreachable</code>. That&rsquo;s progress. broken-pc knows web isn&rsquo;t on
its network, so it doesn&rsquo;t ARP for it any more. But it doesn&rsquo;t know where else to send it either.</p>
<p>(Changes you make with <code>ip</code> last until the lab restarts. A real computer keeps its settings in a file, so
they come back after a restart; here, <strong>Reset network</strong> in the top bar puts broken-pc back how it was.)</p>
</li>
</ol>
<p class="lab-recap"><span class="mono">in one sentence</span> <code>ip addr del</code> and <code>ip addr add</code> change an address and its prefix; <code>ip route</code> shows the effect straight away.</p>

  </div>
</section>


<section class="lab-stage lab-stage-challenge" id="challenge">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">4</span>
    <span class="lab-stage-kind mono">challenge</span><h2>Get broken-pc to web</h2>
  </header>
  <div class="lab-stage-body">
    <p>Make <code>ping -c 3 192.168.2.10</code> work from broken-pc. The printer must still work too. Then click
<strong>Check task 2.2</strong>, under the guide.</p>
<details class="lab-hint">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="11" cy="11" r="7"/><path d="m20 20-4-4"/></svg>
 <span>hint</span></summary>
  <div class="lab-hint-body"><p><code>Network is unreachable</code> means no route. Which line does the laptop&rsquo;s <code>ip route</code> have that broken-pc&rsquo;s
doesn&rsquo;t? (Click <strong>laptop</strong> on the Topology tab to compare, in a tab of its own.)</p>
</div>
</details>
<details class="lab-hint">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="11" cy="11" r="7"/><path d="m20 20-4-4"/></svg>
 <span>hint</span></summary>
  <div class="lab-hint-body"><p>The command to add a route starts <code>ip route add</code>. A default route is written <code>default via &lt;gateway&gt;</code>.</p>
</div>
</details>
<details class="lab-solution">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M14 4h6v6M20 4l-9 9M18 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h5"/></svg>
 <span>show the solution</span></summary>
  <div class="lab-solution-body">
    <div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">broken-pc:~# ip route add default via 192.168.1.1
</span></span><span class="line"><span class="cl">broken-pc:~# ip route
</span></span><span class="line"><span class="cl">default via 192.168.1.1 dev eth1
</span></span><span class="line"><span class="cl">192.168.1.0/24 dev eth1 proto kernel scope link src 192.168.1.30
</span></span><span class="line"><span class="cl">broken-pc:~# ping -c 3 192.168.2.10
</span></span><span class="line"><span class="cl">64 bytes from 192.168.2.10: icmp_seq=1 ttl=62 time=0.749 ms
</span></span><span class="line"><span class="cl">...
</span></span></code></pre></div><p>Now broken-pc&rsquo;s <code>ip route</code> matches the laptop&rsquo;s, apart from its own address. That&rsquo;s what DHCP would have given
it in the first place: this is why most hosts use DHCP instead of being typed in by hand.</p>
<p>Look at <code>ttl=62</code> in the answer. Every router a packet crosses takes 1 off its <em>time to live</em>. web sent its
answer with 64, and two routers later it&rsquo;s 62. Task 3.1 uses that.</p>
  </div>
</details>

  </div>
</section>

]]></content:encoded></item><item><title>Who's next door?</title><link>https://networkdoodles.com/labs/networking-101-lab/task-2-1/</link><pubDate>Thu, 12 Nov 2026 09:00:00 -0500</pubDate><dc:creator>David Henderson</dc:creator><guid>https://networkdoodles.com/labs/networking-101-lab/task-2-1/</guid><description> new to this? step by stepbeginner Click sw1 on the Topology tab. In the sw1 tab: clear mac address-table dynamic. Click laptop. In the laptop tab: ip neigh flush all, ping -c 3 192.168.1.20 and ip neigh. Back in the sw1 tab: show mac address-table. Write down the laptop’s and the printer’s ports in Your answers, under the guide. Challenge: in the laptop tab, ip neigh flush all, ping -c 3 192.168.2.10, ip neigh. Which address, which MAC, which port? Check task 2.1, under the guide. more in meet the lab</description><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[
<details class="lab-basics">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="8" r="4"/><path d="M4 21c0-4 4-6 8-6s8 2 8 6"/></svg>
 <span>new to this? step by step</span><em>beginner</em></summary>
  <div class="lab-basics-body">
    <ol>
<li>Click <strong>sw1</strong> on the <strong>Topology</strong> tab. In the <strong>sw1</strong> tab: <code>clear mac address-table dynamic</code>.</li>
<li>Click <strong>laptop</strong>. In the <strong>laptop</strong> tab: <code>ip neigh flush all</code>, <code>ping -c 3 192.168.1.20</code> and <code>ip neigh</code>.</li>
<li>Back in the <strong>sw1</strong> tab: <code>show mac address-table</code>. Write down the laptop&rsquo;s and the printer&rsquo;s ports in <strong>Your answers</strong>, under the guide.</li>
<li>Challenge: in the laptop tab, <code>ip neigh flush all</code>, <code>ping -c 3 192.168.2.10</code>, <code>ip neigh</code>. Which address, which MAC, which port?</li>
<li><strong>Check task 2.1</strong>, under the guide.</li>
</ol>

    <p class="lab-basics-more mono">more in <a href="/labs/basics/">meet the lab</a></p>
  </div>
</details>


<section class="lab-stage lab-stage-explain" id="explain">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">1</span>
    <span class="lab-stage-kind mono">explain</span><h2>From an IP address to a MAC address</h2>
  </header>
  <div class="lab-stage-body">
    <h3 id="a-gap-in-the-story">A gap in the story</h3>
<p>Here&rsquo;s something the lessons skipped. When the laptop sends to the printer, it knows the printer&rsquo;s <strong>IP
address</strong>: <code>192.168.1.20</code>. But on the cable, every frame needs a <strong>to</strong> MAC address too
(<a href="/lessons/networking-101/task-1-1/">lesson 1.1</a>), and that&rsquo;s what the switch reads
(<a href="/lessons/networking-101/task-2-1/">lesson 2.1</a>). Nobody typed the printer&rsquo;s MAC address into the laptop. So
how does the laptop know it?</p>
<p>It asks.</p>
<h3 id="arp-asking-the-room">ARP: asking the room</h3>
<p>Think of a classroom on the first day. You know someone called <em>Sam</em> is in your class, but not which face is
Sam&rsquo;s. So you ask the whole room: <em>&ldquo;Which one of you is Sam?&rdquo;</em> Sam puts a hand up and says <em>&ldquo;Me!&rdquo;</em>, and now you
know who to pass your note to. You remember, so you don&rsquo;t have to ask again tomorrow.</p>
<p>Computers do the same, with <strong>ARP</strong>, the <strong>Address Resolution Protocol</strong>. (<em>Resolution</em> here means <em>working
out</em>: working out a MAC address from an IP address.)</p>
<ol>
<li>The laptop shouts a <strong>broadcast</strong> to everyone on its network, to the MAC address <code>ff:ff:ff:ff:ff:ff</code>:
<em>&ldquo;Who has 192.168.1.20? Tell 192.168.1.50.&rdquo;</em></li>
<li>Every host hears it, and only the printer answers, just to the laptop: <em>&ldquo;192.168.1.20 is at
aa:aa:aa:22:22:22.&rdquo;</em></li>
<li>The laptop writes that down, and sends its frames to <code>aa:aa:aa:22:22:22</code>.</li>
</ol>
<p>It&rsquo;s the same <em>shout, then whisper</em> pattern as DHCP in lesson 4.1.</p>
<p class="lab-recap"><span class="mono">in one sentence</span> ARP asks everyone on the network <em>who has this IP address?</em>, and the one that has it answers with its MAC address.</p>
<h3 id="the-neighbour-table">The neighbour table</h3>
<p>The laptop keeps the answers in a list, so it doesn&rsquo;t have to shout before every frame. Linux calls it the
<strong>neighbour table</strong> (a <em>neighbour</em> is another host on your own network: next door). Older books call it the
<strong>ARP cache</strong> or <strong>ARP table</strong>. Each entry is an IP address, the MAC address that goes with it, and a state:</p>
<table>
  <thead>
      <tr>
          <th>State</th>
          <th>What it means</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td><code>REACHABLE</code></td>
          <td>it answered just now: trust it</td>
      </tr>
      <tr>
          <td><code>STALE</code></td>
          <td>it&rsquo;s been a while. Keep using it, but check it again next time</td>
      </tr>
      <tr>
          <td><code>INCOMPLETE</code> / <code>FAILED</code></td>
          <td>it asked, and nobody answered (task 2.2)</td>
      </tr>
  </tbody>
</table>
<p class="lab-recap"><span class="mono">in one sentence</span> The neighbour table is the host&rsquo;s list of <em>this IP address is at that MAC address</em>, for its own network.</p>
<h3 id="what-about-hosts-on-other-networks">What about hosts on other networks?</h3>
<p>ARP is a shout, and shouts stop at the router (<a href="/lessons/networking-101/task-2-2/">lesson 2.2</a>). So the laptop
can only ARP for hosts on <strong>its own network</strong>. For anything else it uses the rule from
<a href="/lessons/networking-101/task-3-2/">lesson 3.2</a>: different network, so send it to the <strong>gateway</strong>. Which
means the frame needs the gateway&rsquo;s MAC address, not the faraway host&rsquo;s. Keep that in mind for the challenge.</p>
<h3 id="the-switch-doesnt-need-arp">The switch doesn&rsquo;t need ARP</h3>
<p>The switch never asks anyone anything. It learns by watching the <strong>from</strong> MAC address of every frame that comes
in, and writes down which port it came from: its <strong>MAC address table</strong>, from lesson 2.1. So after the laptop
and the printer have talked, the switch knows both their ports.</p>

  </div>
</section>


<section class="lab-stage lab-stage-show" id="show">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">2</span>
    <span class="lab-stage-kind mono">show</span><h2>Three tables</h2>
  </header>
  <div class="lab-stage-body">
    <p>On the laptop, <code>ip neigh</code> (short for <em>neighbour</em>) prints the neighbour table:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">laptop:~# ip neigh
</span></span><span class="line"><span class="cl">192.168.1.20 dev eth1 lladdr aa:aa:aa:22:22:22 REACHABLE
</span></span></code></pre></div><table>
  <thead>
      <tr>
          <th>Part</th>
          <th>What it means</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td><code>192.168.1.20</code></td>
          <td>the neighbour&rsquo;s IP address</td>
      </tr>
      <tr>
          <td><code>dev eth1</code></td>
          <td>it&rsquo;s out of this card</td>
      </tr>
      <tr>
          <td><code>lladdr aa:aa:aa:22:22:22</code></td>
          <td>its MAC address (<em>lladdr</em>: <em>link-layer address</em>, layer 2)</td>
      </tr>
      <tr>
          <td><code>REACHABLE</code></td>
          <td>the state</td>
      </tr>
  </tbody>
</table>
<p><code>arp -n</code> prints the same table the old way, with headings. Both are common, so it&rsquo;s worth knowing both:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">laptop:~# arp -n
</span></span><span class="line"><span class="cl">Address                  HWtype  HWaddress           Flags Mask            Iface
</span></span><span class="line"><span class="cl">192.168.1.20             ether   aa:aa:aa:22:22:22   C                     eth1
</span></span></code></pre></div><p>On the switch, <code>show mac address-table</code>:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">sw1#show mac address-table
</span></span><span class="line"><span class="cl">          Mac Address Table
</span></span><span class="line"><span class="cl">-------------------------------------------
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">Vlan    Mac Address       Type        Ports
</span></span><span class="line"><span class="cl">----    -----------       --------    -----
</span></span><span class="line"><span class="cl">   1    aaaa.aa11.1111    DYNAMIC     Gi2
</span></span><span class="line"><span class="cl">   1    aaaa.aa22.2222    DYNAMIC     Gi3
</span></span><span class="line"><span class="cl">   1    aaaa.aa33.3333    DYNAMIC     Gi4
</span></span><span class="line"><span class="cl">   1    aac1.ab49.a6ba    DYNAMIC     Gi1
</span></span></code></pre></div><table>
  <thead>
      <tr>
          <th>Column</th>
          <th>What it means</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td><code>Vlan</code></td>
          <td>which network inside the switch. All four ports are in VLAN 1 here, one network</td>
      </tr>
      <tr>
          <td><code>Mac Address</code></td>
          <td>a MAC address it has seen, in the switch&rsquo;s dotted style</td>
      </tr>
      <tr>
          <td><code>Type</code></td>
          <td><code>DYNAMIC</code>: learned from a frame, not typed in by hand</td>
      </tr>
      <tr>
          <td><code>Ports</code></td>
          <td>the port it was seen on. <code>Gi2</code> is short for <code>GigabitEthernet2</code>, port 2</td>
      </tr>
  </tbody>
</table>
<p>The last entry is r1. The switch and router MAC addresses in this lab are made up fresh every time the lab
starts, so yours will be different from the one here.</p>
<p>And the router has a table just like the laptop&rsquo;s. On r1, <code>show ip arp</code>:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">r1#show ip arp
</span></span><span class="line"><span class="cl">Protocol  Address          Age (min)  Hardware Addr   Type   Interface
</span></span><span class="line"><span class="cl">Internet  192.168.1.1              -  aac1.ab49.a6ba  ARPA   GigabitEthernet1
</span></span><span class="line"><span class="cl">Internet  192.168.1.50             0  aaaa.aa11.1111  ARPA   GigabitEthernet1
</span></span></code></pre></div><p>A <code>-</code> in the age column means it&rsquo;s the router&rsquo;s own address. <code>0</code> means it learned this one less than a minute
ago.</p>

  </div>
</section>


<section class="lab-stage lab-stage-follow" id="follow">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">3</span>
    <span class="lab-stage-kind mono">follow along</span><h2>Watch ARP fill the table</h2>
  </header>
  <div class="lab-stage-body">
    <ol>
<li>
<p>Start with empty tables, so you can watch both fill up. The switch first: click <strong>sw1</strong> on the
<strong>Topology</strong> tab. In the <strong>sw1</strong> tab:</p>
<div class="lab-file lab-file-run mono">
  <span class="lab-file-kind">run in the sw1 tab</span>
</div>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">clear mac address-table dynamic
</span></span><span class="line"><span class="cl">show mac address-table
</span></span></code></pre></div><p><code>clear mac address-table dynamic</code> forgets every address the switch learned. It prints nothing, and the
table under the headings is empty. (A switch soon learns everything again, so clearing it is harmless; it&rsquo;s
a normal step when you&rsquo;re chasing a fault.)</p>
</li>
<li>
<p>Now the laptop. Click <strong>laptop</strong> on the Topology tab, and in the <strong>laptop</strong> tab empty its neighbour table:</p>
<div class="lab-file lab-file-run mono">
  <span class="lab-file-kind">run in the laptop tab</span>
</div>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">ip neigh flush all
</span></span><span class="line"><span class="cl">ip neigh
</span></span></code></pre></div><p><code>flush all</code> empties it. The second command prints nothing: the laptop doesn&rsquo;t know anyone&rsquo;s MAC address now.</p>
</li>
<li>
<p>Send the printer three pings:</p>
<div class="lab-file lab-file-run mono">
  <span class="lab-file-kind">run in the laptop tab</span>
</div>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">ping -c <span class="m">3</span> 192.168.1.20
</span></span></code></pre></div><p><strong>Ping</strong> sends a small <em>are you there?</em> message and waits for the answer. <code>-c 3</code> means <em>three times, then
stop</em>. Each answer line ends with how long the round trip took, in milliseconds. Before the first one could
go, the laptop had to ARP for the printer.</p>
</li>
<li>
<p>Look again:</p>
<div class="lab-file lab-file-run mono">
  <span class="lab-file-kind">run in the laptop tab</span>
</div>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">ip neigh
</span></span><span class="line"><span class="cl">arp -n
</span></span></code></pre></div><p>The printer&rsquo;s IP address and MAC address are there now. Wait a minute and run <code>ip neigh</code> again: it
changes to <code>STALE</code>. You may also see <code>192.168.1.1</code> turn up: r1 asked about the laptop, and the laptop
wrote r1 down from the question.</p>
</li>
<li>
<p>Switch to the <strong>sw1</strong> tab and look at the switch again:</p>
<div class="lab-file lab-file-run mono">
  <span class="lab-file-kind">run in the sw1 tab</span>
</div>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">show mac address-table
</span></span></code></pre></div><p>Two entries now: <code>aaaa.aa11.1111</code> (the laptop) and <code>aaaa.aa22.2222</code> (the printer). The switch learned
each one from the <em>from</em> address of a frame: the laptop&rsquo;s ARP question and pings, and the printer&rsquo;s answers.
Which port is each on?</p>
</li>
<li>
<p>Fill in the follow-along answers in <strong>Your answers</strong>, under the guide:</p>
<div class="lab-file lab-file-edit mono">
  <span class="lab-file-kind">edit</span><code>Your answers</code><span class="lab-file-how">under the guide</span>
</div>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">The laptop&#39;s port on sw1: Gi2
</span></span><span class="line"><span class="cl">The printer&#39;s port on sw1: Gi3
</span></span></code></pre></div></li>
</ol>
<p class="lab-recap"><span class="mono">in one sentence</span> <code>ip neigh</code> shows what the laptop learned with ARP; <code>show mac address-table</code> shows what the switch learned by watching.</p>

  </div>
</section>


<section class="lab-stage lab-stage-challenge" id="challenge">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">4</span>
    <span class="lab-stage-kind mono">challenge</span><h2>Pinging further away</h2>
  </header>
  <div class="lab-stage-body">
    <p>Now ping <strong>web</strong>, <code>192.168.2.10</code>, from the laptop. It&rsquo;s on another network, two routers away.</p>
<p><strong>Before</strong> you look, guess: after the ping, which IP address will be in the laptop&rsquo;s neighbour table? Then
empty the table, ping, and see. Fill in the challenge answers in <strong>Your answers</strong>:</p>
<ul>
<li><code>web_neighbor_ip</code>: the IP address that appears in the neighbour table;</li>
<li><code>web_neighbor_mac</code>: the MAC address that goes with it;</li>
<li><code>r1_port</code>: the port on sw1 where that MAC address is.</li>
</ul>
<details class="lab-hint">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="11" cy="11" r="7"/><path d="m20 20-4-4"/></svg>
 <span>hint</span></summary>
  <div class="lab-hint-body"><p>In the <strong>laptop</strong> tab: <code>ip neigh flush all</code>, then <code>ping -c 3 192.168.2.10</code>, then <code>ip neigh</code>.</p>
</div>
</details>
<details class="lab-hint">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="11" cy="11" r="7"/><path d="m20 20-4-4"/></svg>
 <span>hint</span></summary>
  <div class="lab-hint-body"><p>Is <code>192.168.2.10</code> on the laptop&rsquo;s network, <code>192.168.1.0/24</code>? If not, the laptop doesn&rsquo;t send the frame to
web at all. It sends it to someone else. <code>ip route</code> says who.</p>
</div>
</details>
<details class="lab-hint">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="11" cy="11" r="7"/><path d="m20 20-4-4"/></svg>
 <span>hint</span></summary>
  <div class="lab-hint-body"><p>To check the MAC address from the router&rsquo;s side: click <strong>r1</strong> on the Topology tab, and in the <strong>r1</strong> tab run <code>show interfaces GigabitEthernet1</code> says
<code>address is ...</code>. Then find that address in sw1&rsquo;s <code>show mac address-table</code>.</p>
</div>
</details>
<details class="lab-solution">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M14 4h6v6M20 4l-9 9M18 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h5"/></svg>
 <span>show the solution</span><em>Your answers</em></summary>
  <div class="lab-solution-body">
    <p class="mono lab-solution-tip">or let the lab do it: <b>Solve it for me</b>, next to Check task, does the task and fills in the answers, printing every step</p>
    <div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">The address the laptop asked ARP about, to reach web: 192.168.1.1
</span></span><span class="line"><span class="cl">The MAC address it learned for it: aa:c1:ab:49:a6:ba      # yours is different: r1&#39;s MAC address
</span></span><span class="line"><span class="cl">r1&#39;s port on sw1: Gi1
</span></span></code></pre></div><p><code>192.168.2.10</code> isn&rsquo;t in the laptop&rsquo;s neighbour table, and never will be. web is on another network, so the
laptop sends every frame for web to its gateway, r1, and ARPs for <strong>r1&rsquo;s</strong> MAC address instead. r1 takes it
from there, with a new frame for the next network.</p>
<p>That&rsquo;s the rule from <a href="/lessons/networking-101/task-3-1/">lesson 3.1</a>, seen on a real computer: the IP address
says <em>web</em> the whole way, but the MAC address only ever says <em>the next stop</em>.</p>
  </div>
</details>

  </div>
</section>

]]></content:encoded></item><item><title>Get an address</title><link>https://networkdoodles.com/labs/networking-101-lab/task-1-2/</link><pubDate>Thu, 12 Nov 2026 09:00:00 -0500</pubDate><dc:creator>David Henderson</dc:creator><guid>https://networkdoodles.com/labs/networking-101-lab/task-1-2/</guid><description> new to this? step by stepbeginner Click laptop on the Topology tab. In the laptop tab: ip addr show eth1, ip route and cat /etc/resolv.conf. Ask again by hand: pkill udhcpc, then udhcpc -i eth1 -q. Write the four answers in Your answers, under the guide. Click r1 on the Topology tab. In the r1 tab: show ip dhcp binding. Challenge: on r1, a pool that keeps 192.168.1.50 for the laptop’s MAC address. Then ask again on the laptop. Check task 1.2, under the guide. more in meet the lab</description><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[
<details class="lab-basics">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="8" r="4"/><path d="M4 21c0-4 4-6 8-6s8 2 8 6"/></svg>
 <span>new to this? step by step</span><em>beginner</em></summary>
  <div class="lab-basics-body">
    <ol>
<li>Click <strong>laptop</strong> on the <strong>Topology</strong> tab. In the <strong>laptop</strong> tab: <code>ip addr show eth1</code>, <code>ip route</code> and <code>cat /etc/resolv.conf</code>.</li>
<li>Ask again by hand: <code>pkill udhcpc</code>, then <code>udhcpc -i eth1 -q</code>. Write the four answers in <strong>Your answers</strong>, under the guide.</li>
<li>Click <strong>r1</strong> on the Topology tab. In the <strong>r1</strong> tab: <code>show ip dhcp binding</code>.</li>
<li>Challenge: on r1, a pool that keeps <code>192.168.1.50</code> for the laptop&rsquo;s MAC address. Then ask again on the laptop.</li>
<li><strong>Check task 1.2</strong>, under the guide.</li>
</ol>

    <p class="lab-basics-more mono">more in <a href="/labs/basics/">meet the lab</a></p>
  </div>
</details>


<section class="lab-stage lab-stage-explain" id="explain">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">1</span>
    <span class="lab-stage-kind mono">explain</span><h2>What the laptop borrowed</h2>
  </header>
  <div class="lab-stage-body">
    <h3 id="four-things-on-loan">Four things, on loan</h3>
<p>In <a href="/lessons/networking-101/task-4-1/">lesson 4.1</a> you watched a laptop plug in with no address and come out
with four things, after four messages (<strong>D</strong>iscover, <strong>O</strong>ffer, <strong>R</strong>equest, <strong>A</strong>ck):</p>
<ol>
<li>an <strong>IP address</strong> and its <strong>subnet mask</strong>;</li>
<li>a <strong>default gateway</strong>: the router, the way out to other networks;</li>
<li>a <strong>DNS server</strong>: the computer that turns names into addresses (task 3.2 is all about it);</li>
<li>a <strong>lease</strong>: how long it can keep them before it has to ask again.</li>
</ol>
<p>The lab&rsquo;s laptop did exactly that when the lab started. Task 1.1 found the first one with <code>ip addr</code>. This task
finds the other three, then makes it ask again so you can watch.</p>
<p class="lab-recap"><span class="mono">in one sentence</span> DHCP lends a host an address and mask, a gateway and a DNS server, for the length of a lease.</p>
<h3 id="where-a-computer-keeps-them">Where a computer keeps them</h3>
<p>Linux keeps each one in a different place, and each has its own way to look:</p>
<table>
  <thead>
      <tr>
          <th>What</th>
          <th>Where to look</th>
          <th>What you&rsquo;ll see</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>address and mask</td>
          <td><code>ip addr show eth1</code></td>
          <td><code>inet 192.168.1.100/24</code>: the mask is the <code>/24</code></td>
      </tr>
      <tr>
          <td>default gateway</td>
          <td><code>ip route</code></td>
          <td>a line starting <code>default via</code>: <em>anything that isn&rsquo;t for a network I know, send it here</em></td>
      </tr>
      <tr>
          <td>DNS server</td>
          <td><code>cat /etc/resolv.conf</code></td>
          <td>a line starting <code>nameserver</code></td>
      </tr>
      <tr>
          <td>lease</td>
          <td>the DHCP client&rsquo;s messages</td>
          <td><code>lease time 3600</code>: in seconds</td>
      </tr>
  </tbody>
</table>
<p><code>cat</code> prints a file (it&rsquo;s short for <em>concatenate</em>, an old word for joining files together). <code>/etc/resolv.conf</code>
is the file where Linux writes down which DNS server to ask. The DHCP client fills it in.</p>
<p class="lab-recap"><span class="mono">in one sentence</span> The address is in <code>ip addr</code>, the gateway in <code>ip route</code>, the DNS server in <code>/etc/resolv.conf</code>.</p>
<h3 id="the-client-and-the-server">The client and the server</h3>
<p>Two programs do DHCP. On the laptop, a <strong>DHCP client</strong> asks; here it&rsquo;s called <code>udhcpc</code> (<em>micro DHCP client</em>:
it&rsquo;s a small one). On r1, a <strong>DHCP server</strong> answers, from a <strong>pool</strong>: a list of addresses it&rsquo;s allowed to
hand out, plus the gateway and DNS server to go with them. r1 writes down who has which address in its
<strong>bindings</strong>: a <em>binding</em> ties an address to one host&rsquo;s MAC address.</p>
<p class="lab-recap"><span class="mono">in one sentence</span> The client on the laptop asks; the server on r1 answers from its pool and writes down the binding.</p>
<h3 id="keeping-a-desk-free-for-one-student">Keeping a desk free for one student</h3>
<p>Remember the new student in lesson 4.1, asking where to sit? Most students take any free desk. But the
teacher might keep desk 10 for one student, every day: whoever else comes in first, that desk is theirs.</p>
<p>DHCP can do that too. It&rsquo;s called a <strong>reservation</strong>: the server keeps one address for one MAC address, and
gives it to nobody else. People reserve addresses for things that others need to find, like printers, so
the address never changes.</p>
<p class="lab-recap"><span class="mono">in one sentence</span> A reservation keeps one address for one MAC address, so that host always gets the same one.</p>

  </div>
</section>


<section class="lab-stage lab-stage-show" id="show">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">2</span>
    <span class="lab-stage-kind mono">show</span><h2>DORA, as udhcpc tells it</h2>
  </header>
  <div class="lab-stage-body">
    <p>When you run the laptop&rsquo;s DHCP client by hand, it says what it&rsquo;s doing, one line per step:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">laptop:~# udhcpc -i eth1 -q
</span></span><span class="line"><span class="cl">udhcpc: started, v1.37.0
</span></span><span class="line"><span class="cl">udhcpc: broadcasting discover
</span></span><span class="line"><span class="cl">udhcpc: broadcasting select for 192.168.1.100, server 192.168.1.1
</span></span><span class="line"><span class="cl">udhcpc: lease of 192.168.1.100 obtained from 192.168.1.1, lease time 3600
</span></span></code></pre></div><table>
  <thead>
      <tr>
          <th>Line</th>
          <th>Which DHCP message</th>
          <th>From lesson 4.1</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td><code>broadcasting discover</code></td>
          <td>the laptop&rsquo;s <strong>Discover</strong>, shouted to everyone</td>
          <td><em>anyone there?</em></td>
      </tr>
      <tr>
          <td>(no line)</td>
          <td>r1&rsquo;s <strong>Offer</strong> arrives. <code>udhcpc</code> doesn&rsquo;t print it, but the next line shows what was in it</td>
          <td><em>192.168.1.100 is free</em></td>
      </tr>
      <tr>
          <td><code>broadcasting select for 192.168.1.100, server 192.168.1.1</code></td>
          <td>the <strong>Request</strong>. <code>udhcpc</code> calls it <em>select</em>: it picks this offer, from this server</td>
          <td><em>yes please, that one</em></td>
      </tr>
      <tr>
          <td><code>lease of 192.168.1.100 obtained ... lease time 3600</code></td>
          <td>r1&rsquo;s <strong>Ack</strong>: it&rsquo;s the laptop&rsquo;s now, for 3600 seconds</td>
          <td><em>it&rsquo;s yours</em></td>
      </tr>
  </tbody>
</table>
<p>Look at the words <em>broadcasting</em>: the Discover and the Request are both shouts to everyone, as in the lesson.
<code>-i eth1</code> means <em>on the eth1 card</em>, and <code>-q</code> means <em>quit once you have an address</em> (otherwise it keeps
running, to ask again before the lease runs out).</p>
<p>On r1, the same conversation, from the server&rsquo;s side:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">r1#show ip dhcp binding
</span></span><span class="line"><span class="cl">Bindings from all pools not associated with VRF:
</span></span><span class="line"><span class="cl">IP address      Client-ID/              Lease expiration        Type       State      Interface
</span></span><span class="line"><span class="cl">                Hardware address/
</span></span><span class="line"><span class="cl">                User name
</span></span><span class="line"><span class="cl">192.168.1.100   01aa.aaaa.1111.11       Nov 10 2026 03:20 PM    Automatic  Active     GigabitEthernet1
</span></span></code></pre></div><table>
  <thead>
      <tr>
          <th>Column</th>
          <th>What it says</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td><code>IP address</code></td>
          <td>the address r1 lent</td>
      </tr>
      <tr>
          <td><code>Client-ID</code></td>
          <td>who to: <code>01</code> means <em>Ethernet</em>, and the rest, <code>aa.aaaa.1111.11</code>, is the laptop&rsquo;s MAC address in different groups</td>
      </tr>
      <tr>
          <td><code>Lease expiration</code></td>
          <td>when the loan runs out, unless the laptop asks again first (the date and time are the lab&rsquo;s clock)</td>
      </tr>
      <tr>
          <td><code>Type</code></td>
          <td><code>Automatic</code>: the next free address from the pool. A reservation says <code>Manual</code></td>
      </tr>
      <tr>
          <td><code>Interface</code></td>
          <td>the router port the request came in on: <code>GigabitEthernet1</code>, the home network</td>
      </tr>
  </tbody>
</table>
<p>Routers and switches write MAC addresses in three groups of four, with dots: <code>aaaa.aa11.1111</code> is the same
address as <code>aa:aa:aa:11:11:11</code>.</p>

  </div>
</section>


<section class="lab-stage lab-stage-follow" id="follow">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">3</span>
    <span class="lab-stage-kind mono">follow along</span><h2>Read the loan, then ask again</h2>
  </header>
  <div class="lab-stage-body">
    <ol>
<li>
<p>Log in to the laptop: click <strong>laptop</strong> on the <strong>Topology</strong> tab. In the <strong>laptop</strong> tab, look at its address,
its routes and its DNS settings:</p>
<div class="lab-file lab-file-run mono">
  <span class="lab-file-kind">run in the laptop tab</span>
</div>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">ip addr show eth1
</span></span><span class="line"><span class="cl">ip route
</span></span><span class="line"><span class="cl">cat /etc/resolv.conf
</span></span></code></pre></div><p><code>ip route</code> prints two lines:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">default via 192.168.1.1 dev eth1
</span></span><span class="line"><span class="cl">192.168.1.0/24 dev eth1 proto kernel scope link src 192.168.1.100
</span></span></code></pre></div><p>The first is the <strong>default gateway</strong>: <code>192.168.1.1</code>, which is r1. The second says the laptop&rsquo;s own network,
<code>192.168.1.0/24</code>, is right there on <code>eth1</code>: no gateway needed for it. That&rsquo;s the rule from
<a href="/lessons/networking-101/task-3-2/">lesson 3.2</a>, written down by the computer.</p>
<p><code>/etc/resolv.conf</code> says <code>nameserver 192.168.2.53</code>, the DNS server, and <code>search lab</code> (task 3.2 explains
that one).</p>
</li>
<li>
<p>Still in the <strong>laptop</strong> tab, stop the DHCP client that&rsquo;s running in the background, and run it again by
hand so you can watch:</p>
<div class="lab-file lab-file-run mono">
  <span class="lab-file-kind">run in the laptop tab</span>
</div>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">pkill udhcpc
</span></span><span class="line"><span class="cl">udhcpc -i eth1 -q
</span></span></code></pre></div><p>(<code>pkill</code> stops a running program by its name.) You&rsquo;ll see the four lines from the <em>show</em> step, ending with
the address, the server and the lease time.</p>
</li>
<li>
<p>Now look from r1&rsquo;s side: click <strong>r1</strong> on the Topology tab. In the <strong>r1</strong> tab:</p>
<div class="lab-file lab-file-run mono">
  <span class="lab-file-kind">run in the r1 tab</span>
</div>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">show ip dhcp binding
</span></span><span class="line"><span class="cl">show ip dhcp pool
</span></span></code></pre></div><p>The prompt on r1 is <code>r1#</code>. <code>show ip dhcp pool</code> counts the pool&rsquo;s addresses: 254 in all, 99 kept back
(excluded, for things with fixed addresses, like the printer), 1 leased.</p>
</li>
<li>
<p>Fill in <strong>Your answers</strong>, under the guide:</p>
<div class="lab-file lab-file-edit mono">
  <span class="lab-file-kind">edit</span><code>Your answers</code><span class="lab-file-how">under the guide</span>
</div>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">The DHCP server&#39;s address: 192.168.1.1
</span></span><span class="line"><span class="cl">The laptop&#39;s default gateway: 192.168.1.1
</span></span><span class="line"><span class="cl">The laptop&#39;s DNS server: 192.168.2.53
</span></span><span class="line"><span class="cl">The lease time, in seconds: 3600
</span></span></code></pre></div><p>The DHCP server and the gateway are the same box here, r1, as in most homes. They don&rsquo;t have to be.</p>
</li>
</ol>
<p class="lab-recap"><span class="mono">in one sentence</span> <code>udhcpc</code> shows DORA from the laptop&rsquo;s side; <code>show ip dhcp binding</code> shows the same loan from the router&rsquo;s.</p>

  </div>
</section>


<section class="lab-stage lab-stage-challenge" id="challenge">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">4</span>
    <span class="lab-stage-kind mono">challenge</span><h2>Keep 192.168.1.50 for the laptop</h2>
  </header>
  <div class="lab-stage-body">
    <p>Make r1 give the laptop <code>192.168.1.50</code> every time, then have the laptop ask again so it gets it. The laptop
must still get its gateway and its DNS server.</p>
<p>To change a router you go into <strong>configuration mode</strong>: <code>configure terminal</code> (the prompt becomes
<code>r1(config)#</code>), type the settings, then <code>end</code>. A pool is made with <code>ip dhcp pool NAME</code>, which opens that pool&rsquo;s
settings (<code>r1(dhcp-config)#</code>). A reservation is a pool of its own, with two settings that make it one:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl"> host 192.168.1.50 255.255.255.0
</span></span><span class="line"><span class="cl"> client-identifier 01aa.aaaa.1111.11
</span></span></code></pre></div><p><code>host</code> is the address and mask to keep. <code>client-identifier</code> says who it&rsquo;s kept for: the <strong>Client-ID</strong> you saw
in <code>show ip dhcp binding</code>, <code>01</code> for Ethernet followed by the laptop&rsquo;s MAC address. A DHCP client sends its
Client-ID in every request, and the laptop&rsquo;s <code>udhcpc</code> does, so that&rsquo;s what the router matches on. (There&rsquo;s
also a <code>hardware-address</code> setting, for the MAC address alone, but it only matches clients that send no
Client-ID.)</p>
<details class="lab-hint">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="11" cy="11" r="7"/><path d="m20 20-4-4"/></svg>
 <span>hint</span></summary>
  <div class="lab-hint-body"><p>The commands go on r1, in the <strong>r1</strong> tab: <code>configure terminal</code>, then <code>ip dhcp pool LAPTOP</code> (any name will
do).</p>
</div>
</details>
<details class="lab-hint">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="11" cy="11" r="7"/><path d="m20 20-4-4"/></svg>
 <span>hint</span></summary>
  <div class="lab-hint-body"><p>Some routers copy the HOME pool&rsquo;s gateway and DNS server into a reservation, and some don&rsquo;t. Put them in the
reservation itself, so it works either way: <code>show running-config</code> shows HOME&rsquo;s settings to copy.</p>
</div>
</details>
<details class="lab-hint">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="11" cy="11" r="7"/><path d="m20 20-4-4"/></svg>
 <span>hint</span></summary>
  <div class="lab-hint-body"><p>To ask again on the laptop, go back to the <strong>laptop</strong> tab and do what you did in the follow-along: <code>pkill udhcpc</code>,
then <code>udhcpc -i eth1 -q</code>.</p>
</div>
</details>
<details class="lab-solution">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M14 4h6v6M20 4l-9 9M18 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h5"/></svg>
 <span>show the solution</span></summary>
  <div class="lab-solution-body">
    <p>In the <strong>r1</strong> tab:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">r1#configure terminal
</span></span><span class="line"><span class="cl">r1(config)#ip dhcp pool LAPTOP
</span></span><span class="line"><span class="cl">r1(dhcp-config)# host 192.168.1.50 255.255.255.0
</span></span><span class="line"><span class="cl">r1(dhcp-config)# client-identifier 01aa.aaaa.1111.11
</span></span><span class="line"><span class="cl">r1(dhcp-config)# default-router 192.168.1.1
</span></span><span class="line"><span class="cl">r1(dhcp-config)# dns-server 192.168.2.53
</span></span><span class="line"><span class="cl">r1(dhcp-config)# domain-name lab
</span></span><span class="line"><span class="cl">r1(dhcp-config)#end
</span></span><span class="line"><span class="cl">r1#
</span></span></code></pre></div><p>In the <strong>laptop</strong> tab:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">laptop:~# pkill udhcpc
</span></span><span class="line"><span class="cl">laptop:~# udhcpc -i eth1 -q
</span></span><span class="line"><span class="cl">udhcpc: started, v1.37.0
</span></span><span class="line"><span class="cl">udhcpc: broadcasting discover
</span></span><span class="line"><span class="cl">udhcpc: broadcasting select for 192.168.1.50, server 192.168.1.1
</span></span><span class="line"><span class="cl">udhcpc: lease of 192.168.1.50 obtained from 192.168.1.1, lease time 86400
</span></span></code></pre></div><p>The lease is 86400 seconds, a whole day, because the LAPTOP pool doesn&rsquo;t set one and a day is the default.
<code>show ip dhcp binding</code> on r1 now says <code>192.168.1.50 ... Manual</code>.</p>
<p>Setting <code>default-router</code> and <code>dns-server</code> in the reservation makes sure the laptop gets them. Without them it
would still get <code>192.168.1.50</code>, but on a router that doesn&rsquo;t copy them from HOME, <code>ip route</code> would have no
<code>default via</code> line and <code>/etc/resolv.conf</code> would be empty: it could reach its own network and nothing else.</p>
<p>From now on the laptop is <code>192.168.1.50</code>. The rest of the guide shows that address. If you see <code>.100</code>,
you skipped this challenge or clicked <strong>Reset network</strong>; <strong>Solve it for me</strong>, next to Check task, puts the reservation back.</p>
  </div>
</details>

  </div>
</section>

]]></content:encoded></item><item><title>Meet your computer</title><link>https://networkdoodles.com/labs/networking-101-lab/task-1-1/</link><pubDate>Thu, 12 Nov 2026 09:00:00 -0500</pubDate><dc:creator>David Henderson</dc:creator><guid>https://networkdoodles.com/labs/networking-101-lab/task-1-1/</guid><description> new to this? step by stepbeginner Open the lab (the button on the lab’s page) and wait for the top bar to say network up. On the Topology tab, click laptop. In the laptop tab: ip addr show eth1. Copy the MAC address, IP address and prefix into Your answers, under the guide. Do the same for the printer (click printer on the Topology tab), then work out its network and broadcast addresses. Check task 1.1, under the guide. more in meet the lab</description><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[
<details class="lab-basics">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="8" r="4"/><path d="M4 21c0-4 4-6 8-6s8 2 8 6"/></svg>
 <span>new to this? step by step</span><em>beginner</em></summary>
  <div class="lab-basics-body">
    <ol>
<li><strong>Open the lab</strong> (the button on the <a href="/labs/networking-101-lab/">lab&rsquo;s page</a>) and wait for the top bar to say <strong>network up</strong>.</li>
<li>On the <strong>Topology</strong> tab, click <strong>laptop</strong>. In the <strong>laptop</strong> tab: <code>ip addr show eth1</code>.</li>
<li>Copy the MAC address, IP address and prefix into <strong>Your answers</strong>, under the guide.</li>
<li>Do the same for the printer (click <strong>printer</strong> on the Topology tab), then work out its network and broadcast addresses.</li>
<li><strong>Check task 1.1</strong>, under the guide.</li>
</ol>

    <p class="lab-basics-more mono">more in <a href="/labs/basics/">meet the lab</a></p>
  </div>
</details>


<section class="lab-stage lab-stage-explain" id="explain">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">1</span>
    <span class="lab-stage-kind mono">explain</span><h2>Asking a computer about itself</h2>
  </header>
  <div class="lab-stage-body">
    <h3 id="a-terminal-typing-to-a-computer">A terminal: typing to a computer</h3>
<p>Most of the time you use a computer by pointing and clicking. Network engineers mostly <strong>type</strong> instead. They
open a <strong>terminal</strong>: a window where you type a <strong>command</strong> (an instruction, one line long), press
<kbd>Enter</kbd>, and the computer types its answer back underneath.</p>
<p>The terminal shows a <strong>prompt</strong> when it&rsquo;s ready for your next command. In this lab the prompt says which
computer you&rsquo;re on, so you always know who you&rsquo;re talking to:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">laptop:~#
</span></span></code></pre></div><p>You type after the <code>#</code>. (The <code>~</code> means <em>my home folder</em>; you can ignore it.)</p>
<p class="lab-recap"><span class="mono">in one sentence</span> A terminal is a window where you type a command and the computer types its answer back.</p>
<h3 id="logging-in-to-another-computer">Logging in to another computer</h3>
<p>The lab&rsquo;s first tab, <strong>Topology</strong>, draws the lab network: every computer, the switch and the routers, and
the cables between them. Hover over one to see what it is, what it runs, where each of its ports is cabled,
and whether it&rsquo;s running.</p>
<p><strong>Click</strong> one, and a terminal on that computer opens in a tab of its own, named after it: click <strong>laptop</strong>
and you get a <strong>laptop</strong> tab. That&rsquo;s <strong>logging in</strong>: everything you type in that tab goes to the laptop, and
the laptop answers. The prompt says which computer you&rsquo;re on: <code>laptop:~#</code> on a host, <code>r1#</code> on a router.</p>
<p>You can have several computers open at once, each in its own tab, and switch between them by clicking the
tabs. Clicking the computer on the Topology tab again takes you back to its tab. When you&rsquo;re done with one,
close its tab with its <strong>×</strong>.</p>
<p class="lab-recap"><span class="mono">in one sentence</span> Click a computer on the Topology tab to log in to it: its terminal opens in a tab named after it.</p>
<h3 id="interfaces-the-computers-name-for-its-network-cards">Interfaces: the computer&rsquo;s name for its network cards</h3>
<p>In <a href="/lessons/networking-101/task-1-1/">lesson 1.1</a> you met the <strong>network card</strong>: the part of a host that sends
and receives. A computer calls each of its network cards an <strong>interface</strong>, and gives each one a short name.
On Linux, the system these hosts run, the names look like this:</p>
<table>
  <thead>
      <tr>
          <th>Name</th>
          <th>What it is</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td><code>eth1</code></td>
          <td>a network card with a cable (<em>eth</em> is short for <strong>Ethernet</strong>, the kind of cable and the rules it uses)</td>
      </tr>
      <tr>
          <td><code>lo</code></td>
          <td>the <strong>loopback</strong>: a pretend card the computer uses to talk to itself. It&rsquo;s on every computer, and never leaves it</td>
      </tr>
  </tbody>
</table>
<p>Each lab host has one real network card, <code>eth1</code>, with a cable to the switch (or, for the servers, to r2).</p>
<p class="lab-recap"><span class="mono">in one sentence</span> Linux calls a network card an interface; here the real one is <code>eth1</code>.</p>
<h3 id="ip-addr-what-does-this-card-know-about-itself"><code>ip addr</code>: what does this card know about itself?</h3>
<p>The command <strong><code>ip addr</code></strong> (short for <em>IP address</em>) lists every interface, and for each one its MAC address and
its IP addresses. It&rsquo;s the first command an engineer types on a computer that won&rsquo;t connect, because it
answers the first questions: is the card up, does it have an address, and which network is it on?</p>

  </div>
</section>


<section class="lab-stage lab-stage-show" id="show">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">2</span>
    <span class="lab-stage-kind mono">show</span><h2>Reading ip addr</h2>
  </header>
  <div class="lab-stage-body">
    <p>Here&rsquo;s what <code>ip addr show eth1</code> prints on the laptop (<code>show eth1</code> means <em>just this one card</em>). The table under
it names each part you need:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">laptop:~# ip addr show eth1
</span></span><span class="line"><span class="cl">86: eth1@if87: &lt;BROADCAST,MULTICAST,UP,LOWER_UP&gt; mtu 1500 qdisc noqueue state UP group default
</span></span><span class="line"><span class="cl">    link/ether aa:aa:aa:11:11:11 brd ff:ff:ff:ff:ff:ff link-netnsid 0
</span></span><span class="line"><span class="cl">    inet 192.168.1.100/24 scope global eth1
</span></span><span class="line"><span class="cl">       valid_lft forever preferred_lft forever
</span></span></code></pre></div><table>
  <thead>
      <tr>
          <th>Part</th>
          <th>What it means</th>
          <th>From lesson</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td><code>eth1</code></td>
          <td>the interface&rsquo;s name. (The numbers around it are the computer&rsquo;s own bookkeeping: skip them)</td>
          <td></td>
      </tr>
      <tr>
          <td><code>UP</code></td>
          <td>the card is switched on, and <code>LOWER_UP</code>: the cable is plugged in and working at the other end</td>
          <td><a href="/lessons/networking-101/task-1-2/">1.2</a>, layer 1</td>
      </tr>
      <tr>
          <td><code>link/ether aa:aa:aa:11:11:11</code></td>
          <td>the <strong>MAC address</strong>. <em>link</em> means layer 2, the data link layer; <em>ether</em> means Ethernet</td>
          <td><a href="/lessons/networking-101/task-1-1/">1.1</a></td>
      </tr>
      <tr>
          <td><code>brd ff:ff:ff:ff:ff:ff</code></td>
          <td>the <strong>broadcast</strong> MAC address: <em>everyone on this network</em></td>
          <td><a href="/lessons/networking-101/task-2-2/">2.2</a></td>
      </tr>
      <tr>
          <td><code>inet 192.168.1.100</code></td>
          <td>the <strong>IP address</strong>. <em>inet</em> means IPv4, the four-number kind</td>
          <td><a href="/lessons/networking-101/task-3-1/">3.1</a></td>
      </tr>
      <tr>
          <td><code>/24</code></td>
          <td>the <strong>prefix</strong>: the first 24 bits are the network part</td>
          <td><a href="/lessons/networking-101/task-3-2/">3.2</a></td>
      </tr>
  </tbody>
</table>
<p>Look at the MAC address: <code>aa:aa:aa:11:11:11</code>. It&rsquo;s the laptop from lesson 1.1. We gave the lab&rsquo;s hosts easy
MAC addresses on purpose, so you can tell them apart at a glance. A real card&rsquo;s MAC address comes from its
factory and looks more random. (The switch and the routers have random-looking ones, as you&rsquo;ll see in
chapter 2.)</p>
<p><code>ip addr</code> writes MAC addresses in small letters. <code>aa:aa:aa:11:11:11</code> and <code>AA:AA:AA:11:11:11</code> are the same
address: hex digits don&rsquo;t care about capitals.</p>

  </div>
</section>


<section class="lab-stage lab-stage-follow" id="follow">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">3</span>
    <span class="lab-stage-kind mono">follow along</span><h2>The laptop</h2>
  </header>
  <div class="lab-stage-body">
    <ol>
<li>
<p>Log in to the laptop: on the <strong>Topology</strong> tab, click <strong>laptop</strong>. A <strong>laptop</strong> tab opens, with the prompt
<code>laptop:~#</code>. You&rsquo;re on the laptop now.</p>
</li>
<li>
<p>In the <strong>laptop</strong> tab, ask it its name, to be sure:</p>
<div class="lab-file lab-file-run mono">
  <span class="lab-file-kind">run in the laptop tab</span>
</div>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">hostname
</span></span></code></pre></div><p>It prints <code>laptop</code>.</p>
</li>
<li>
<p>List every interface:</p>
<div class="lab-file lab-file-run mono">
  <span class="lab-file-kind">run in the laptop tab</span>
</div>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">ip addr
</span></span></code></pre></div><p>You&rsquo;ll see <code>lo</code> with <code>127.0.0.1</code> (the loopback, always there) and <code>eth1</code>, the laptop&rsquo;s real network card.
You may see some extra entries with names like <code>tunl0</code> or <code>gre0</code>, marked <code>DOWN</code>. They&rsquo;re spare tunnel
interfaces that come from the bigger computer this lab runs inside. They have no address, and nothing uses
them: skip them.</p>
</li>
<li>
<p>Now just the one card:</p>
<div class="lab-file lab-file-run mono">
  <span class="lab-file-kind">run in the laptop tab</span>
</div>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">ip addr show eth1
</span></span></code></pre></div><p>Find the three things from the table above: the MAC address after <code>link/ether</code>, the IP address after
<code>inet</code>, and the prefix after the slash.</p>
</li>
<li>
<p>A short version, one line per interface, is handy once you know what you&rsquo;re looking for:</p>
<div class="lab-file lab-file-run mono">
  <span class="lab-file-kind">run in the laptop tab</span>
</div>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">ip -br addr
</span></span></code></pre></div><p><code>-br</code> means <em>brief</em>: name, state and address. (The MAC address isn&rsquo;t in this one: <code>ip -br link</code> shows it.)</p>
</li>
<li>
<p>Fill in the laptop&rsquo;s three answers in <strong>Your answers</strong>, under the guide:</p>
<div class="lab-file lab-file-edit mono">
  <span class="lab-file-kind">edit</span><code>Your answers</code><span class="lab-file-how">under the guide</span>
</div>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">The laptop&#39;s MAC address: aa:aa:aa:11:11:11
</span></span><span class="line"><span class="cl">The laptop&#39;s IP address: 192.168.1.100
</span></span><span class="line"><span class="cl">The laptop&#39;s prefix: 24
</span></span></code></pre></div><p>It saves when you press <kbd>Enter</kbd> or click away, and always before a check.</p>
</li>
</ol>
<p class="lab-recap"><span class="mono">in one sentence</span> <code>ip addr show eth1</code> gives a card&rsquo;s MAC address (<code>link/ether</code>), its IP address (<code>inet</code>) and its prefix (after the <code>/</code>).</p>

  </div>
</section>


<section class="lab-stage lab-stage-challenge" id="challenge">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">4</span>
    <span class="lab-stage-kind mono">challenge</span><h2>The printer</h2>
  </header>
  <div class="lab-stage-body">
    <p>Log in to the <strong>printer</strong> and answer its five questions in <strong>Your answers</strong>:</p>
<ol>
<li>its MAC address, IP address and prefix, from <code>ip addr</code>;</li>
<li>its <strong>network address</strong> and <strong>broadcast address</strong>. No command prints these: work them out from the IP
address and the prefix, the way you did in <a href="/lessons/networking-101/task-3-2/">lesson 3.2</a>.</li>
</ol>
<p>Then click <strong>Check task 1.1</strong>, under the guide. It checks the laptop&rsquo;s answers too.</p>
<details class="lab-hint">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="11" cy="11" r="7"/><path d="m20 20-4-4"/></svg>
 <span>hint</span></summary>
  <div class="lab-hint-body"><p>On the Topology tab, click <strong>printer</strong>. In the <strong>printer</strong> tab: <code>ip addr show eth1</code>.</p>
</div>
</details>
<details class="lab-hint">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="11" cy="11" r="7"/><path d="m20 20-4-4"/></svg>
 <span>hint</span></summary>
  <div class="lab-hint-body"><p>With a <code>/24</code>, the first three numbers are the network part. The network address keeps them and puts <code>0</code> at
the end; the broadcast address puts <code>255</code>.</p>
</div>
</details>
<details class="lab-solution">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M14 4h6v6M20 4l-9 9M18 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h5"/></svg>
 <span>show the solution</span><em>Your answers</em></summary>
  <div class="lab-solution-body">
    <p class="mono lab-solution-tip">or let the lab do it: <b>Solve it for me</b>, next to Check task, does the task and fills in the answers, printing every step</p>
    <div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">The printer&#39;s MAC address: aa:aa:aa:22:22:22
</span></span><span class="line"><span class="cl">The printer&#39;s IP address: 192.168.1.20
</span></span><span class="line"><span class="cl">The printer&#39;s prefix: 24
</span></span><span class="line"><span class="cl">The printer&#39;s network address: 192.168.1.0
</span></span><span class="line"><span class="cl">The printer&#39;s broadcast address: 192.168.1.255
</span></span></code></pre></div><p>The printer&rsquo;s network part, <code>192.168.1</code>, is the same as the laptop&rsquo;s. They&rsquo;re on the same network, so the
laptop can send to the printer straight through the switch, with no router: the rule from lesson 3.2. Task 2.1
watches that happen.</p>
  </div>
</details>

  </div>
</section>

]]></content:encoded></item></channel></rss>