Skip to content
annwentechnology.comannwentechnology.com
  • Category
    • DevOps
    • Python
  • Home
  • All Courses
    • Devops
  • Explore
    • Contact Us
    • About Us
    • Dashboard
    • Blog
    • Instructor Details
      • Instructor – 1
      • Instructor-2
    • Privacy Policy
  • Register
0

Currently Empty: ₹0.00

Continue shopping

Login / Sign Up
annwentechnology.comannwentechnology.com
  • Home
  • All Courses
    • Devops
  • Explore
    • Contact Us
    • About Us
    • Dashboard
    • Blog
    • Instructor Details
      • Instructor – 1
      • Instructor-2
    • Privacy Policy
  • Register

Linux Networking Basics: MAC, IP, Subnetting & nmcli Commands Explained

  • Home
  • Uncategorized
  • Linux Networking Basics: MAC, IP, Subnetting & nmcli Commands Explained
Breadcrumb Abstract Shape
Breadcrumb Abstract Shape
Breadcrumb Abstract Shape
Uncategorized

Linux Networking Basics: MAC, IP, Subnetting & nmcli Commands Explained

  • November 18, 2026
  • Com 0
Linux Networking Basics guide by Annwen Technology showing ip and nmcli commands
In this guide
  1. What is networking?
  2. LAN and WAN
  3. NIC and MAC
  4. IP address
  5. Classes of IP
  6. Subnet mask
  7. NIC naming in Linux
  8. Verify NIC & IP
  9. ip addr add / del
  10. NetworkManager
  11. Listing connections
  12. Creating a connection
  13. Up / down
  14. Deleting
  15. Modifying

1. What is networking?

A network is formed when multiple physical or virtual computing devices are interconnected so they can share data and resources.

Medium

Devices communicate over a wired medium (copper or fibre cable) or a wireless medium (Wi-Fi, radio).

WIRED WIRELESS
Wired and wireless media

2. LAN and WAN

LAN (Local Area Network) connects devices within a single building or campus, typically through a switch.

A LAN: computers connected through a switch

WAN (Wide Area Network) links many LANs across cities or countries. The Internet is the largest WAN.

Internet
A WAN: several LANs connected through the Internet

3. Network Interface Controller (NIC) and MAC address

The NIC is the hardware card or chip that connects a computer to a network.

NIC (PCIe card) + RJ45 port
A network interface card

The MAC (Media Access Control) address:

  • is a physical / hardware address assigned to the NIC
  • is a unique identifier for IEEE 802 technologies (Ethernet, Wi-Fi, Bluetooth)
  • is written in hexadecimal: 12 hex digits, or 48 bits

Example: 00-1E-67-B0-08-D8

4. Internet Protocol (IP) address

  • A logical, location-based address
  • Written in dotted decimal. An IPv4 address is 32 bits long (4 octets of 8 bits)

Example: 192.168.1.100

Range of IPv4

00000000.00000000.00000000.00000000  →  0.0.0.0
11111111.11111111.11111111.11111111  →  255.255.255.255

5. Classes of IP

ClassFirst octet rangeUsed for
A0 – 127Unicast, large networks
B128 – 191Unicast, medium networks
C192 – 223Unicast, small networks
D224 – 239Multicasting
E240 – 255Reserved for R&D

Special values: 0 means any network (default route), and 127 is the loopback range, used by a machine to talk to itself.

6. Network / Host bits and subnet mask

ClassNetwork bitsHost bitsSubnet maskPrefix
A8 bits24 bits255.0.0.0/8
B16 bits16 bits255.255.0.0/16
C24 bits8 bits255.255.255.0/24

The network bits identify the network, and the host bits identify a device inside it. The subnet mask, or prefix length, tells the system where that split is. For example, 192.168.1.100/24 means network 192.168.1 and host .100.

7. Naming of NICs in Linux

TypeInterface names
Physical NICethX, ensX, enoX, enpXsY
Virtual NIClo, brX, virbrX, teamX, vnetX, bond
Wireless NICwlanX

Modern RHEL uses predictable names like ens160 or enp0s3, based on where the card sits in the hardware, instead of the older eth0.

8. Verify NIC and IP properties

ip link

Lists every network interface with its state (UP/DOWN) and MAC address.

ip addr

Shows the IPv4 and IPv6 addresses assigned to each interface.

ip link && ip addr

Runs both: first the interfaces, then their IP addresses.

Sample output:

[root@servera ~]# ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: ens160: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
    link/ether 00:0c:29:a2:3f:20 brd ff:ff:ff:ff:ff:ff
[root@servera ~]# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
    inet6 ::1/128 scope host
2: ens160: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 00:0c:29:a2:3f:20 brd ff:ff:ff:ff:ff:ff
    inet 10.0.0.10/8 brd 10.255.255.255 scope global noprefixroute ens160
    inet6 fe80::2e6a:a60b:304b:76e0/64 scope link noprefixroute

9. Add or delete an IP address with the ip command

Delete an IP address

ip addr del 10.0.0.10/8 dev ens160

Removes the IP 10.0.0.10 (mask /8) from interface ens160.

Add an IP address

ip addr add 172.16.0.10/16 dev ens160

Assigns the IP 172.16.0.10 with a /16 mask to interface ens160.

Note: changes made with the ip command are not permanent. They are lost after a reboot or network restart. For a permanent configuration, use NetworkManager. On RHEL 7/8, profiles are stored in /etc/sysconfig/network-scripts/ifcfg-*; on RHEL 9 and later they are stored in /etc/NetworkManager/system-connections/.

10. NetworkManager

NetworkManager is a daemon in RHEL that manages IP properties and keeps them persistent across reboots. There are two ways to manage it:

nmtui

Opens a text-based menu to add, edit and activate connections, with no commands to remember.

nmcli

The command-line client for NetworkManager. Fast and scriptable.

11. Listing connections

nmcli con show

Lists all saved connection profiles with their name, UUID, type and device.

nmcli con show --active

Lists only the connections that are currently up.

nmcli con show <con-name> | grep ipv4

Filters a profile’s settings down to its IPv4 details: method, address, gateway, DNS.

nmcli con show <con-name> | grep connection

Shows the profile’s general settings: ID, UUID, interface name and autoconnect.

12. Creating a connection

DHCP (automatic IP)

nmcli con add con-name <con-name> ifname ens160 type ethernet

Creates an Ethernet profile on ens160 that gets its IP automatically from a DHCP server.

Manual (static IP)

nmcli con add con-name <con-name> ifname ens160 type ethernet ip4 172.17.0.10/16 gw4 172.17.0.1 ip6 2000::10/64 gw6 2000::1

Creates a profile with a static IPv4 address and gateway plus a static IPv6 address and gateway.

13. Activating and deactivating a connection

nmcli con up <con-name>

Activates the profile and applies its settings to the interface.

nmcli con down <con-name>

Deactivates the profile and removes its settings from the interface.

14. Deleting a connection

nmcli con del <con-name>

Deletes the connection profile permanently and takes it down if it was active.

15. Modifying a connection

nmcli con modify <con-name> ipv4.addresses 172.18.0.10/16 ipv4.gateway 172.18.0.1 ipv4.dns 8.8.8.8 ipv4.method manual

Changes the saved profile to a static IP, gateway and DNS server. Run nmcli con up to apply it.

nmcli con up <con-name>

Re-activates the profile so the modified settings take effect immediately.

Tip: nmcli con modify only edits the saved profile. Nothing changes on the interface until you bring the connection up again.

Found this useful?

Bookmark it for your next RHEL lab and follow Annwen Technology for more Linux & automation guides.
Innovate · Automate · Elevate

Share on:
Anne Rinita

Hey there! I’m Anne Rinita, the founder of Annwen Technology — a place I created to help people build real careers in AWS, DevOps, and Cloud.

I just had a strong passion for learning and teaching. Whatever I learned, I shared — and that’s how Annwen Technology was born. Over time, it’s grown into something much bigger: a community where students learn through real projects, hands-on practice, and guidance that prepares them for the real IT world.

I’ve always believed that knowledge becomes powerful only when it’s shared. My husband, who’s been working as a DevOps engineer for more than 10 years, has been my biggest support, helping me bring real industry experience into every course we design.

The name Annwen is deeply personal to me — it’s my daughter’s name, Annwen Rosanna. She’s the reason I work harder every day and the inspiration behind everything I build.

Through Annwen Technology, I’m on a mission to help people transform their careers and gain confidence in tech — not just by learning tools, but by truly understanding how everything works behind the scenes.

DevOps Roadmap for Freshers in 2026: A Step-by-Step Guide

Leave a Reply Cancel reply

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

Latest Post

Thumb
Linux Networking Basics: MAC, IP, Subnetting &
November 18, 2026
Thumb
DevOps Roadmap for Freshers in 2026: A
November 18, 2026
Thumb
Annwen Technology Alumni Success Stories
October 6, 2025

Categories

  • blog
  • Uncategorized
photo_2026-09-14_10-21-20

Your trusted online institute for the best IT courses.

Address: Kumarapuram, Thuckalay
Call: +91 9025614123
Email: careers@annwentechnology.com

Explore & Learn

  • Home
  • All Courses
  • Explore

Links

  • Contact Us
  • About Us
  • User Account
  • Reset Password
  • Forgot Password
  • User Login
  • Privacy Policy

Contacts

Enter your email address to register to our newsletter subscription

Icon-facebook Icon-instagram X-twitter Icon-linkedin2 Icon-youtube
Copyright 2026 | All Rights Reserved
annwentechnology.comannwentechnology.com