Level 1
0 / 100 XP

Network Interfaces and the Loopback Interface

In this lesson, we will explore network interfaces in Linux, an essential concept for anyone dealing with Linux networking. Network interfaces are the point of interconnection between a computer and a network. They can be physical, like Ethernet and Wi-Fi adapters, or virtual, like loopback and VPN interfaces. Understanding how to manage and configure these interfaces is key to effectively managing network connectivity and traffic on a Linux system.

Introduction to Network Interfaces

A network interface in Linux is a software representation of a network connection. It's how the operating system interacts with the underlying network hardware or virtual network connections.

Types of Network Interfaces

  1. Physical Interfaces : These are associated with physical network hardware. Examples include:
    • Ethernet interfaces (e.g., eth0, enp0s3)
    • Wi-Fi interfaces (e.g., wlan0, wlp2s0)
  2. Virtual Interfaces : These are not tied to physical hardware and include:
    • Loopback interface (lo), used for internal communication within the host.
    • Virtual Ethernet interfaces (e.g., veth), often used in container networking.
    • VPN interfaces (e.g., tun0, tap0), used for virtual private networks.

Managing Network Interfaces

Listing Network Interfaces

You can list all network interfaces using the ip command:

ip link show

This will display all available network interfaces along with their state (up or down) and hardware addresses.

Text
paulh@ubuntu-server:~$ ip link show 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: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000 link/ether 08:00:27:3e:6b:88 brd ff:ff:ff:ff:ff:ff

Explaining everything that is written…