Home / Linux / FOSS / How to set IP statik di Ubuntu dari shell

How to set IP statik di Ubuntu dari shell

Terbiasa dimanjakan menggunakan GUI? hehe… sebagai admin anda perlu harus tahu melakukan perintah melalui command line. Ini hanya tutorial sederhana bagi admin pemula. Mengenai men-set IP secara statik, tanpa GUI. Berikut ini langkah-langkahnya :

Uninstall Network Manager yang ada miliki.  Lalu :

Edit sebagai root:

<span class="punct">/</span><span class="regex">etc</span><span class="punct">/</span><span class="ident">network</span><span class="punct">/</span><span class="ident">interfaces</span>

edit sesuai kebutuhan (contoh saya menggunakan IP address 192.168.0.100):

<span class="comment"># This file describes the network interfaces available on your system</span>
<span class="comment"># and how to activate them. For more information, see interfaces(5).</span>

<span class="comment"># The loopback network interface</span>
<span class="ident">auto</span> <span class="ident">lo</span>
<span class="ident">iface</span> <span class="ident">lo</span> <span class="ident">inet</span> <span class="ident">loopback</span>

<span class="comment"># This is a list of hotpluggable network interfaces.</span>
<span class="comment"># They will be activated automatically by the hotplug subsystem.</span>
<span class="ident">mapping</span> <span class="ident">hotplug</span>
        <span class="ident">script</span> <span class="ident">grep</span>
        <span class="ident">map</span> <span class="ident">eth0</span>

<span class="comment"># The primary network interface</span>
<span class="ident">auto</span> <span class="ident">eth0</span>
<span class="ident">iface</span> <span class="ident">eth0</span> <span class="ident">inet</span> <span class="ident">static</span>
        <span class="ident">address</span> <span class="number">192.168</span><span class="punct">.</span><span class="number">0.100</span>
        <span class="ident">netmask</span> <span class="number">255.255</span><span class="punct">.</span><span class="number">255.0</span>
        <span class="ident">network</span> <span class="number">192.168</span><span class="punct">.</span><span class="number">0.0</span>
        <span class="ident">broadcast</span> <span class="number">192.168</span><span class="punct">.</span><span class="number">0.255</span>
        <span class="ident">gateway</span> <span class="number">192.168</span><span class="punct">.</span><span class="number">0.1

done!</span>

About alfach

Check Also

grep

Trik Beragam Penggunaan Perintah Grep di Linux

Grep pada dasarnya merupakan perintah sederhana namun powerfull dalam melakukan pencarian dalam lingkungan linux, ditambah ...

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>