<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Faaiq Amarullah</title>
    <description>The latest articles on DEV Community by Faaiq Amarullah (@faaiq_amarullah).</description>
    <link>https://dev.to/faaiq_amarullah</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F919015%2Fc49c2fe3-a029-4c57-819d-1f3b8ea63625.png</url>
      <title>DEV Community: Faaiq Amarullah</title>
      <link>https://dev.to/faaiq_amarullah</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/faaiq_amarullah"/>
    <language>en</language>
    <item>
      <title>Installing K9s: A Comprehensive Tutorial</title>
      <dc:creator>Faaiq Amarullah</dc:creator>
      <pubDate>Thu, 05 Jun 2025 09:20:45 +0000</pubDate>
      <link>https://dev.to/faaiq_amarullah/k9s-tutorial-a-cross-platform-kubernetes-cli-tool-4gge</link>
      <guid>https://dev.to/faaiq_amarullah/k9s-tutorial-a-cross-platform-kubernetes-cli-tool-4gge</guid>
      <description>&lt;h2&gt;
  
  
  📘 What is K9s?
&lt;/h2&gt;

&lt;p&gt;K9s is an open-source, terminal-based UI designed to help you interact with your &lt;strong&gt;Kubernetes clusters&lt;/strong&gt;. It provides a real-time view of all your resources—pods, deployments, services, CRDs, and more—right from your terminal. K9s simplifies cluster management by offering quick keyboard shortcuts and intuitive navigation, allowing you to troubleshoot and operate clusters faster than with &lt;code&gt;kubectl&lt;/code&gt; alone.&lt;/p&gt;




&lt;h2&gt;
  
  
  ⚖️ Why K9s?
&lt;/h2&gt;

&lt;p&gt;Before we dive into the installation, let's briefly highlight why k9s has become an indispensable tool for many DevOps practitioners:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Real-time Monitoring&lt;/strong&gt;: Get live insights into your cluster's health, resource utilization, and pod statuses.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Intuitive Navigation&lt;/strong&gt;: Easily browse through namespaces, deployments, services, pods, and more with a simple keyboard-driven interface.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Log Aggregation&lt;/strong&gt;: View container logs in real-time, filter them, and even follow specific logs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Resource Management&lt;/strong&gt;: Perform common operations like scaling deployments, deleting pods, and editing resources directly from the UI.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Context Switching&lt;/strong&gt;: Seamlessly switch between multiple Kubernetes contexts and clusters.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Search and Filter&lt;/strong&gt;: Quickly find specific resources using powerful search and filtering capabilities.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Port Forwarding&lt;/strong&gt;: Set up and manage port forwards for easy access to your applications.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Customization&lt;/strong&gt;: Tailor k9s to your preferences with custom hotkeys and configurations.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In essence, k9s empowers you to spend less time typing &lt;code&gt;kubectl&lt;/code&gt; commands and more time understanding and managing your Kubernetes environments.&lt;/p&gt;




&lt;h2&gt;
  
  
  🧰 Prerequisites
&lt;/h2&gt;

&lt;p&gt;Before installing K9s, make sure you have:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Access to a Kubernetes cluster (e.g., Minikube, Kind, EKS, GKE, AKS)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;kubectl&lt;/code&gt; installed and configured&lt;/li&gt;
&lt;li&gt;A valid kubeconfig file (usually in &lt;code&gt;~/.kube/config&lt;/code&gt;)&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  ⚙️ Installing K9s
&lt;/h2&gt;

&lt;h3&gt;
  
  
  🔧 Method 1: Automatic Installation Via Webi (Recommended)
&lt;/h3&gt;

&lt;p&gt;For Linux and macOS:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-sS&lt;/span&gt; https://webinstall.dev/k9s | bash
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For Windows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;curl.exe&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-A&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;MS&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;https://webinstall.dev/k9s&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;powershell&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; Restart your terminal after the installation is complete.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt; &lt;/p&gt;

&lt;h3&gt;
  
  
  🔧 Method 2: Manual Installation (For Linux and macOS)
&lt;/h3&gt;

&lt;h4&gt;
  
  
  1. Download the latest version (replace with the latest version tag):
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# For Linux&lt;/span&gt;
curl &lt;span class="nt"&gt;-LO&lt;/span&gt; https://github.com/derailed/k9s/releases/download/v0.50.6/k9s_Linux_amd64.tar.gz

&lt;span class="c"&gt;# For macOS&lt;/span&gt;
curl &lt;span class="nt"&gt;-LO&lt;/span&gt; https://github.com/derailed/k9s/releases/download/v0.50.6/k9s_Darwin_amd64.tar.gz
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  2. Extract the archive:
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# For Linux&lt;/span&gt;
&lt;span class="nb"&gt;tar&lt;/span&gt; &lt;span class="nt"&gt;-xzf&lt;/span&gt; k9s_Linux_amd64.tar.gz

&lt;span class="c"&gt;# For macOS&lt;/span&gt;
&lt;span class="nb"&gt;tar&lt;/span&gt; &lt;span class="nt"&gt;-xzf&lt;/span&gt; k9s_Darwin_amd64.tar.gz
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  3. Move the binary to your PATH:
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo mv &lt;/span&gt;k9s /usr/local/bin/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  4. Verify the installation:
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;k9s version
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt; &lt;/p&gt;

&lt;h3&gt;
  
  
  🔧 Method 3: Manual Installation (For Windows)
&lt;/h3&gt;

&lt;h4&gt;
  
  
  1. Download the binary:
&lt;/h4&gt;

&lt;p&gt;    Go to &lt;a href="https://github.com/derailed/k9s/releases" rel="noopener noreferrer"&gt;K9s Releases&lt;/a&gt; and download the &lt;code&gt;k9s_Windows_amd64.tar.gz&lt;/code&gt;.&lt;/p&gt;

&lt;h4&gt;
  
  
  2. Extract using 7-Zip or similar.
&lt;/h4&gt;

&lt;h4&gt;
  
  
  3. Move &lt;code&gt;k9s.exe&lt;/code&gt; to a directory in your system PATH, e.g., &lt;code&gt;C:\Program Files\k9s&lt;/code&gt;.
&lt;/h4&gt;

&lt;h4&gt;
  
  
  4. (Optional) Add the path:
&lt;/h4&gt;

&lt;p&gt;    - Hit &lt;code&gt;Win+r&lt;/code&gt; and type &lt;code&gt;sysdm.cpl&lt;/code&gt;&lt;br&gt;
    - Go to "Advanced" tab and click "Environment Variables"&lt;br&gt;
    - Edit &lt;code&gt;Path&lt;/code&gt; under "System variables"&lt;br&gt;
    - Add the directory where &lt;code&gt;k9s.exe&lt;/code&gt; is located&lt;/p&gt;
&lt;h4&gt;
  
  
  5. Verify:
&lt;/h4&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;k9s&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;version&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  🚀 How to Use K9s?
&lt;/h2&gt;

&lt;p&gt;Once installed, just type:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;k9s
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This launches an interactive UI in your terminal.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpfjlshpp5u1wtlin1xuc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpfjlshpp5u1wtlin1xuc.png" alt="K9s Screenshoot Pod" width="800" height="431"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffszb1bspjnsuhh0dtpm5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffszb1bspjnsuhh0dtpm5.png" alt="K9s Screenshoot Deployment" width="800" height="431"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy3ufzgst2wmttip4l99i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy3ufzgst2wmttip4l99i.png" alt="K9s Screenshoot Describe Deployment" width="800" height="431"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxq5kpoga35v8z91kwyvy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxq5kpoga35v8z91kwyvy.png" alt="K9s Screenshoot Logs Deployment" width="800" height="430"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  🧭 Common Keyboard Shortcuts
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Key / Command&lt;/th&gt;
&lt;th&gt;Function&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Arrow Keys (Up/Down/Left/Right)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Navigate lists and views&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Enter&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;View details of a selected resource (e.g., list deployment's pod, list pod's container)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Esc&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Go back to the previous view&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Search resources (e.g., &lt;code&gt;/nginx&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;:&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Switch resource views (e.g., &lt;code&gt;:pod&lt;/code&gt;, &lt;code&gt;:deploy&lt;/code&gt;, &lt;code&gt;:service&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;e&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Edit selected resource manifest&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;d&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Describe selected resource&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Ctrl+d&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Delete selected resource&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;l&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;View logs of a pod&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;s&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Shell into the selected pod&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;y&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Show YAML manifest&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;0&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Switch to all namespace view&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;?&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Show help&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Ctrl+c&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Quit&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  🔐 K9s and Kubernetes Security (RBAC)
&lt;/h2&gt;

&lt;p&gt;K9s uses your kubeconfig credentials and respects any &lt;strong&gt;RBAC policies&lt;/strong&gt; in place. If a resource is restricted based on your cluster permissions, K9s will reflect that. Ensure your service account or IAM role has the necessary &lt;code&gt;get&lt;/code&gt;, &lt;code&gt;list&lt;/code&gt;, &lt;code&gt;watch&lt;/code&gt;, and &lt;code&gt;delete&lt;/code&gt; permissions.&lt;/p&gt;




&lt;h2&gt;
  
  
  📚 Resources
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/derailed/k9s" rel="noopener noreferrer"&gt;K9s GitHub Repository&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.hackingnote.com/en/cheatsheets/k9s/" rel="noopener noreferrer"&gt;K9s Cheat Sheet&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://kubernetes.io/docs/home/" rel="noopener noreferrer"&gt;Kubernetes Documentation&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  ✅ Conclusion
&lt;/h2&gt;

&lt;p&gt;K9s is a must-have tool in any Kubernetes practitioner's toolkit. With its cross-platform support and real-time UI, managing your cluster becomes significantly faster and more intuitive.&lt;/p&gt;

&lt;p&gt;No need to memorize dozens of &lt;code&gt;kubectl&lt;/code&gt; commands—K9s gives you a live window into your cluster that fits right inside your terminal.&lt;/p&gt;

</description>
      <category>devops</category>
      <category>kubernetes</category>
      <category>cli</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>How to use nmcli command?</title>
      <dc:creator>Faaiq Amarullah</dc:creator>
      <pubDate>Sun, 18 Sep 2022 03:52:33 +0000</pubDate>
      <link>https://dev.to/faaiq_amarullah/managing-networking-based-on-rhel-8-202e</link>
      <guid>https://dev.to/faaiq_amarullah/managing-networking-based-on-rhel-8-202e</guid>
      <description>&lt;p&gt;Computer network refers to computing devices that are interconnected and can exchange data and share resources with each other. These network devices use a system of rules, known as communication protocols, to transmit information over physical or wireless technologies.&lt;/p&gt;

&lt;p&gt;One of the requirements of a computer network is that there is a computer that can run the operating system properly without any problems. This time I will discuss how to configure a network on a RHEL 8-based computer. As we know, computers with Linux-based OS are famous for their CLI. A command-line interface (CLI) is a text-based user interface (UI) used to run programs, manage computer files and interact with the computer. So now I will explain how to managing and configuring network using CLI.&lt;/p&gt;

&lt;p&gt;To configure the network using the cli in RHEL 8 base, we will use the &lt;strong&gt;nmcli&lt;/strong&gt; command. &lt;strong&gt;nmcli&lt;/strong&gt; is a command-line tool for controlling NetworkManager and reporting network status. &lt;strong&gt;nmcli&lt;/strong&gt; is used to create, view, edit, delete, enable, and disable network connections, as well as control and display the status of network devices.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Who Can Modify Network Settings&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Only the root user can modify and edit the NetworkManager configuration using the CLI. A normal user can only read the NetworkManager configuration, unless he has privileges as the root user (sudo), then he will get the same benefits as the root user. If you get an error message, then you just need to add sudo before nmcli.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Viewing Networking Information&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;To show all of network devices, you can use this command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;nmcli dev status
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It's can display devices name, types, states, and connections&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdf3lvkbf5jbx8xcjmdr9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdf3lvkbf5jbx8xcjmdr9.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To displays a list of all connections, use this command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;nmcli con show
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;you can add --active option to displays only active connections&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqj2t0sl7gn4zxl806drh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqj2t0sl7gn4zxl806drh.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Adding a network connection&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;The command below can add new connection named &lt;em&gt;new1&lt;/em&gt; for the interface eth0, which gets IPv4 networking information using DHCP and autoconnects on startup. The name of the configuration file is based on the value of the &lt;em&gt;con-name&lt;/em&gt; option, &lt;em&gt;new1&lt;/em&gt;, and is saved to the /etc/sysconfig/network-scripts/ifcfg-&lt;em&gt;new1&lt;/em&gt; file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;nmcli con add con-name new1 type ethernet ifname eth0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can create an &lt;em&gt;new1&lt;/em&gt; connection to an eth0 device using a static ipv4 address. You can use ipv4.address and ipv4.gateway options to add new static ip. it's still autoconnect on starup and save the configuration into the same file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;nmcli con add con-name new1 type ethernet ifname eth0 ipv4.address 192.168.1.5/24 ipv4.gateway 192.168.1.1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Not only ipv4, you can also add static ipv6 configuration to new1 connection. You just need to add the ipv6.address and ipv6.gateway options.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;nmcli con add con-name new1 type ethernet ifname eth0 ipv6.address 2001:db8:0:1::c000:207/64 ipv6.gateway 2001:db8:0:1::1 ipv4.address 192.168.1.5/24 ipv4.gateway 192.168.1.1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F42o96li5pjwoozt02aow.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F42o96li5pjwoozt02aow.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;if you get an error message like in the picture above, you just need to add sudo or you need to log in as root user. if it is successful, it will display the message "successfuly added". A collection of random letters like in the picture above is the connection id.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Controlling Network Connections&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;To activate the new connection configuration, you just need to use the command &lt;strong&gt;nmcli con up&lt;/strong&gt; &lt;em&gt;name&lt;/em&gt;. If you forget the name, remember that the &lt;strong&gt;nmcli con show&lt;/strong&gt; command will list all connections. If the connection name contains spaces, then you need to add a ' symbol.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;nmcli con up new1
nmcli con up 'new 1'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;to deactivate it, use the command &lt;strong&gt;nmcli con down&lt;/strong&gt; &lt;em&gt;name&lt;/em&gt; or &lt;strong&gt;nmcli dev dis&lt;/strong&gt; &lt;em&gt;devicename&lt;/em&gt;. Use &lt;strong&gt;nmcli dev dis&lt;/strong&gt; &lt;em&gt;devicename&lt;/em&gt; to deactivate a network interface.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;nmcli con down new1
nmcli dev dis eth0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;if you get an error message, you just need to add sudo or you need to log in as root user.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Modifying Network Connection Settings&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;To see the details of a connection, we can use the command &lt;strong&gt;nmcli con show&lt;/strong&gt; &lt;em&gt;nameconnection&lt;/em&gt;. After the command is executed, a description of the connection will appear. Use the up arrow and down arrow on the keyboard to scroll. Use q to quit.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;nmcli con show new1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsn90kyfouy5khlyrh5rk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsn90kyfouy5khlyrh5rk.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6kur0ib9zlnhbdjea4sl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6kur0ib9zlnhbdjea4sl.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;nmcli con mod&lt;/strong&gt; &lt;em&gt;nameconnection&lt;/em&gt; command can modify the configuration of a connection. This command can be added with several options. For example, the command below will change the ipv4 address and ipv4 gateway of the new1 connection.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;nmcli con mod new1 ipv4.address 192.168.2.5/24 ipv4.gateway 192.168.2.1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft4vb3bqr68mujtjm1ab4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft4vb3bqr68mujtjm1ab4.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm8delz31wz9ngfj6o4un.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm8delz31wz9ngfj6o4un.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can also add more than one ip on one connection. You just need to add the + symbol before the option. For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;nmcli con mod new1 +ipv4.address 10.1.1.11/24
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can add several options like the one in the image below&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fitk4e62c23s7fkzf23th.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fitk4e62c23s7fkzf23th.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can also manually edit the file /etc/sysconfig/network-scripts/ifcfg-&lt;em&gt;nameconnection&lt;/em&gt; using a text editor like nano or vim. Because I named it new1, the file will be stored in /etc/sysconfig/network-scripts/ifcfg-new1.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo vim /etc/sysconfig/network-scripts/ifcfg-new1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi9n4rswghsmjo0q0mjlm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi9n4rswghsmjo0q0mjlm.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgg1fksljrakraji9jigv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgg1fksljrakraji9jigv.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;if you have finished configuring via vim or nano, don't forget to save it. If you are using vim, press Esc and type :wq if you are using nano, press Ctrl+x &amp;gt; y &amp;gt; Enter to save it.&lt;/p&gt;

&lt;p&gt;You can configure IP statically or dynamically, it all depends on your needs.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flf469y6elmvcv0csawll.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flf469y6elmvcv0csawll.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After all the configuration is done, you need to run this command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;nmcli con reload
nmcli con down 'new1'
nmcli con up 'new1'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;strong&gt;nmcli con reload&lt;/strong&gt; command is used to make NetworkManager read configuration changes. The interface still needs to be restarted for changes to take effect.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Deleting a Network Connection&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;To delete a connection, you need to run the command &lt;strong&gt;nmcli con del&lt;/strong&gt; '&lt;em&gt;nameconnection'&lt;/em&gt;. This will disconnect the connection and will automatically delete the file /etc/sysconfig/network-scripts/ifcfg-&lt;em&gt;nameconnection&lt;/em&gt;. For example :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;nmcli con del 'new1'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwfn5hqomaw5lbxag58jv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwfn5hqomaw5lbxag58jv.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Command Set&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjdvms2rg0a3rz5x5ihn3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjdvms2rg0a3rz5x5ihn3.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>linux</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
