Network Interfaces and IP Address Fundamentals

Open Systems Interconnection Reference Model

1. Application
2. Presentation
3. Session
4. Transport
5. Network
6. Data Link
7. Physical

What is a Network Interface?

A Network Interface is the connection point between a computer and a network. It is the operating system’s abstraction of a network adapter, allowing applications to send and receive network traffic.

Each network interface has its own network configuration, including:

  • MAC Address
  • IP Address
  • Subnet
  • Default Gateway
  • DNS Server

A computer may have multiple network interfaces simultaneously.

For example:

InterfacePurpose
EthernetWired network connection
Wi-FiWireless network connection
LoopbackInternal communication within the same machine

You can check the network interface using the following command

ip address

Common Types of Network Interfaces

Ethernet

  • An Ethernet interface provides a wired network connection through an Ethernet cable.
  • Typical interface names: eth0, enp0s3, ens33.

Wi-Fi

  • A Wi-Fi interface connects to a wireless network through an Access Point (AP).
  • Typical Linux interface names: wlan0, wlp2s0.

Loopback

  • The Loopback interface is a virtual network interface that allows a computer to communicate with itself.
  • Unlike Ethernet or Wi-Fi, it is not connected to any physical network (cannot connect to the internet)
  • Typical Linux interface name: lo
  • Default IP address: 127.0.0.1

For example,

Browser

127.0.0.1

Local Web Server

Accessing

http://127.0.0.1

means the browser is communicating with a service running on the same computer.


MAC Address

A MAC Address (Media Access Control Address) is the hardware identifier assigned to a network interface. Characteristics:

  • Operates at Layer 2 (Data Link Layer) of the OSI model
  • Intended to be globally unique and unchanged.
  • Assigned by the hardware manufacturer
  • Define the network identity of the network interface.

Example:

00:1A:2B:3C:4D:5E

IP Address

An IP Address (Internet Protocol Address) is the logical address used to identify a device on a network. Characteristics:

  • Operates at Layer 3 (Network Layer) of the OSI model
  • Can be changed
  • Used for routing packets (data) between networks
  • Define the network location of the network interface.

Examples:

192.168.1.15
10.0.0.20

Private IP and Public IP

IP addresses are divided into two categories.

  • Private IP

    • A Private IP Address is used within a local network and cannot be routed directly over the Internet.
    • Typically ranges: 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16
    • Private IP addresses are commonly assigned to:
      • Personal computers
      • Smartphones
      • Docker containers
      • Kubernetes Pods
      • Virtual machines
  • Public IP

    • A Public IP Address is globally routable on the Internet.
    • Public IP addresses are commonly assigned to:
      • Internet routers
      • Cloud virtual machines
      • Public web servers

Relationship Between Private and Public IP

A typical home network looks like this:

                    Internet

                Public IP Address
                    203.0.113.10

                    Home Router
          ┌──────┴──────┐
          │                          │
    192.168.1.10                 192.168.1.20
        Laptop                      Phone

Devices communicate internally using Private IP addresses.

When accessing the Internet, the router performs Network Address Translation (NAT), translating private IP addresses into its public IP address.

Gateway

A gateway is the device that connects your local network (LAN) to other networks, especially the Internet.

When your computer wants to send traffic to an IP address outside of its own subnet (IP addresses belong to the same local network), it forwards the packet to the gateway. The gateway then routes the traffic onward to the correct destination.

In most home or office networks, the gateway is the router’s private IP address.

Example:

Computer:        192.168.1.10
Subnet:          192.168.1.0/24
Default Gateway: 192.168.1.1

CIDR Notation

CIDR (Classless Inter-Domain Routing) is the standard notation used to describe subnets. Devices within the same subnet can usually communicate directly without passing through a router.

Example:

192.168.1.10/24

Here,

192.168.1.10

is the IP address, while

/24

indicates that the first 24 bits represent the network portion, leaving the remaining 8 bits for host addresses.

Common CIDR prefixes:

CIDRSubnet MaskUsable Hosts
/8255.0.0.0~16.7 million
/16255.255.0.0~65,534
/24255.255.255.0254
/30255.255.255.2522

For instance: 192.168.1.42/16 means that all the IP with 192.168.x.x shares the same subnet (belong to the same local network)


Dynamic IP (DHCP)

A Dynamic IP Address is assigned automatically by a DHCP (Dynamic Host Configuration Protocol) server. When a device joins a network:

Computer

DHCP Request

DHCP Server (usually the router)

Assign IP Address

192.168.1.53

Advantages:

  • Automatic configuration
  • Easy administration
  • Common in home and office networks

Disadvantages:

  • IP addresses may change
  • Not suitable for servers requiring a permanent address

Static IP

A Static IP Address is manually configured and remains fixed unless changed by an administrator or usually the internet service provider (ISP).

Example configuration:

IP Address : 192.168.1.100
Subnet     : 255.255.255.0
Gateway    : 192.168.1.1

Advantages:

  • Permanent address
  • Ideal for servers and network services
  • Simplifies DNS configuration

Disadvantages:

  • Requires manual configuration
  • Incorrect configuration may cause IP conflicts

Summary

Network Interface

        ├── MAC Address

        ├── IP Address
        │       ├── Private IP
        │       └── Public IP

        ├── Subnet
        │       └── CIDR

        └── IP Assignment
                ├── Dynamic IP (DHCP)
                └── Static IP

Related articles

HTTP Protocol (HyperText Transfer Protocol)

Defines how clients (e.g., browsers) and servers communicate using a stateless request–response model. HTTP is an application-layer protocol that runs on top of TCP. HTTP follows a simple cycle: A …

Training

Transport Layer Security (TLS)

TLS is a cryptographic protocol used to secure communication over a network. It is most commonly used in HTTPS, where it encrypts data between a client (browser) and a server. TLS ensures that data…

Training

Secure Shell Protocol (SSH)

SSH is a cryptographic network protocol used to securely access and manage remote computers over an unsecured network. It is commonly used for remote server administration, file transfer, and secur…

Training