<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.10.0">Jekyll</generator><link href="https://h2jaafar.github.io/feed.xml" rel="self" type="application/atom+xml" /><link href="https://h2jaafar.github.io/" rel="alternate" type="text/html" /><updated>2025-11-01T21:07:39-04:00</updated><id>https://h2jaafar.github.io/feed.xml</id><title type="html">Hussein Ali Jaafar</title><subtitle>Write an awesome description for your new site here. You can edit this line in _config.yml. It will appear in your document head meta (for Google search results) and in your feed.xml site description.</subtitle><author><name>Hussein Ali Jaafar</name></author><entry><title type="html">Turtlebot3 Static Ip</title><link href="https://h2jaafar.github.io/blog/turtlebot-ip/" rel="alternate" type="text/html" title="Turtlebot3 Static Ip" /><published>2023-12-12T00:00:00-05:00</published><updated>2023-12-12T00:00:00-05:00</updated><id>https://h2jaafar.github.io/blog/turtlebot-ip</id><content type="html" xml:base="https://h2jaafar.github.io/blog/turtlebot-ip/"><![CDATA[<h1 id="how-to-set-static-ip-for-turtlebot">How to Set Static IP for Turtlebot</h1>

<h2 id="introduction">Introduction</h2>

<p>In this tutorial, we will learn how to set a static IP for Turtlebot3 robots using Netplan. We will be using the YAML file provided as an example.</p>

<h2 id="prerequisites">Prerequisites</h2>

<p>Before proceeding, ensure that you have the following:</p>

<ul>
  <li>A Turtlebot3 robot</li>
  <li>Access to the YAML file provided in the instructions</li>
  <li>Basic knowledge of Linux commands</li>
</ul>

<h2 id="steps">Steps</h2>

<ol>
  <li>Open the YAML file in a text editor.</li>
  <li>Locate the section that corresponds to the wireless interface (wlan0) as follows:</li>
  <li>Change the “dhcp4” parameter from “no” to “yes” as follows:</li>
</ol>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>wifis:
    wlan0:
      dhcp4: no
      addresses:
        - 192.168.0.109/24
      gateway4: 192.168.0.1
      nameservers:
        addresses: [8.8.8.8, 8.8.4.4]
      access-points:
        SSID:
          password: pswd

</code></pre></div></div>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>wifis:
    wlan0:
      dhcp4: yes

</code></pre></div></div>

<ol>
  <li>Add the following lines to the section:</li>
</ol>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>      dhcp4-overrides:
        use-dns: false
        send-hostname: false

</code></pre></div></div>

<p>It should look like this</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c"># This file is generated from information provided by the datasource.  Changes</span>
<span class="c"># to it will not persist across an instance reboot.  To disable cloud-init's</span>
<span class="c"># network configuration capabilities, write a file</span>
<span class="c"># /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:</span>
<span class="c"># network: {config: disabled}</span>
network:
  version: 2
  renderer: networkd
  ethernets:
    eth0:
      dhcp4: <span class="nb">true
      </span>dhcp6: <span class="nb">true
      </span>optional: <span class="nb">true
  </span>wifis:
    wlan0:
      dhcp4: no
      addresses:
        - 192.168.0.109/24 
      gateway4: 192.168.0.1
      nameservers:
        addresses: <span class="o">[</span>8.8.8.8, 8.8.4.4]
      access-points:
        SSID:
          password: pswd
</code></pre></div></div>

<ol>
  <li>Save and close the YAML file.</li>
  <li>Open a terminal and run the following command to apply the changes:</li>
</ol>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo netplan apply

</code></pre></div></div>

<ol>
  <li>Check the new IP address assigned to the wireless interface using the following command:</li>
</ol>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>ifconfig wlan0

</code></pre></div></div>

<p>The output should show the new IP address assigned to the interface.</p>]]></content><author><name>Hussein Ali Jaafar</name></author><category term="Blog" /><category term="docs" /><category term="turtlebot" /><category term="network" /><summary type="html"><![CDATA[How to Set Static IP for Turtlebot Introduction In this tutorial, we will learn how to set a static IP for Turtlebot3 robots using Netplan. We will be using the YAML file provided as an example. Prerequisites Before proceeding, ensure that you have the following: A Turtlebot3 robot Access to the YAML file provided in the instructions Basic knowledge of Linux commands Steps Open the YAML file in a text editor. Locate the section that corresponds to the wireless interface (wlan0) as follows: Change the “dhcp4” parameter from “no” to “yes” as follows: wifis: wlan0: dhcp4: no addresses: - 192.168.0.109/24 gateway4: 192.168.0.1 nameservers: addresses: [8.8.8.8, 8.8.4.4] access-points: SSID: password: pswd wifis: wlan0: dhcp4: yes Add the following lines to the section: dhcp4-overrides: use-dns: false send-hostname: false It should look like this # This file is generated from information provided by the datasource. Changes # to it will not persist across an instance reboot. To disable cloud-init's # network configuration capabilities, write a file # /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following: # network: {config: disabled} network: version: 2 renderer: networkd ethernets: eth0: dhcp4: true dhcp6: true optional: true wifis: wlan0: dhcp4: no addresses: - 192.168.0.109/24 gateway4: 192.168.0.1 nameservers: addresses: [8.8.8.8, 8.8.4.4] access-points: SSID: password: pswd Save and close the YAML file. Open a terminal and run the following command to apply the changes: sudo netplan apply Check the new IP address assigned to the wireless interface using the following command: ifconfig wlan0 The output should show the new IP address assigned to the interface.]]></summary></entry></feed>