0%

0/1 Lessons

Introduction to Linux Server Operating Systems

• 30min

0 / 3 lessons complete

Linux Server Installation and Lab Setup

• 23min

0 / 6 lessons complete

Working with the Linux Command Line Interface

• 1hr 30min

0 / 12 lessons complete

User and Group Management

• 44min

0 / 7 lessons complete

Linux Storage

• 30min

0 / 6 lessons complete

Linux Administration Basics

• 53min

0 / 8 lessons complete

Linux Networking

• 47min

0 / 8 lessons complete

Course Conclusion

• 5min

0 / 1 lessons complete

Network Interfaces and the Loopback Interface

Instructions

Q&A (0)

Notes (0)

Resources (0)

Saving Progress...

Resources

There are no resources for this lesson.

Notes can be saved and accessed anywhere in the course. They also double as bookmarks so you can quickly review important lesson material.

Create note

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.

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 here can get pretty deep, and I don't want to go off the rails to explain every detail which you probably don't need right now. Here is a high-level breakdown of the output you see if you're interested:

  1. Loopback Interface (lo):
    • Identified as the lo interface, indicating it's a loopback interface.
    • Flags (LOOPBACK,UP,LOWER_UP) show it's a loopback interface that's active and operational.
    • MTU (Maximum Transmission Unit) is set to 65536 bytes, typical for loopback interfaces.
    • qdisc noqueue indicates no network traffic queuing, common for loopback.
    • state UNKNOWN is standard for loopback interfaces as they don’t have a physical link status.
    • Hardware (MAC) address and broadcast address are both all zeros, which is standard for loopback interfaces.
  2. Ethernet Interface (enp0s3):
    • Named enp0s3, following a predictable naming convention.
    • Flags (BROADCAST,MULTICAST,UP,LOWER_UP) indicate support for broadcasting and multicasting, and show the interface is active with an operational physical layer.
    • Standard MTU for Ethernet is 1500 bytes.
    • qdisc fq_codel is the queuing discipline, used for managing network traffic.
    • state UP shows the interface is ready for data transmission.
    • Hardware (MAC) address is specific to the Ethernet interface, and the broadcast address is the standard ff:ff:ff:ff:ff:ff.

Configuring Network Interfaces

You can configure network interfaces in various ways, such as assigning IP addresses, setting up routing, or changing the state (up or down).

To bring an interface up:

sudo ip link set eth0 up

To assign a temporary IP address with the ip command:

Whatever IP address you assign must fall within your networks subnet, if you're unsure of what this means then run the `ip addr` command and copy the existing IP or modify only the last octet (last set of numbers)

sudo ip addr add 192.168.1.10/24 dev eth0

Here is a general rule of thumb. Notice the /24? That's the IP in CIDR block notation and it means you can modify the last octet if you want to change the IP. Slash 24 is very common for home labs.

Server Academy Members Only

Sorry, this lesson is only available to Server Academy Full Access members. Become a Full-Access Member now and you’ll get instant access to all of our courses.

0 0 votes
Lesson Rating
Subscribe
Notify of
profile avatar
0 Comments
Inline Feedbacks
View all comments