Course


Introduction

About this course and Linux networking.

Introduction

Linux is an open-source OS that can be installed on a variety of different types of hardware to allow you to develop software, run applications, and more. At the heart of Linux is the kernel. Linux was developed in C and assembly language to run on i386 personal computers, but it has since been ported to more hardware than just about any other operating system in history. Today, Linux is the most installed operating system globally.

If you’re ever going to do anything interesting with Linux, just like any other OS, you need to be connected to a network, whether it’s your own local company network or the public Internet. In this chapter, you’ll learn what you need to know to connect your Linux host to the network as well as some tools to help you troubleshoot if things don’t go exactly as expected.

Here’s what you’ll learn: • The different types of network interfaces in Linux • How to configure IP addressing • Networking troubleshooting tools available in Linux, setup firewall • How to connect multiple network interfaces together to form a bond

Image

Network Interfaces

Different versions of Linux may name network interfaces differently (see the callout about how Linux network device names are changing). In general, just about all Linux operating systems will have at least two network interfaces. They are:

  • Loopback. The loopback (lo) interface will have an IP address of 127.0.0.1, which represents the host itself. Suppose you want to open a web page running on the same Linux server you are on. You could open http://127.0.0.1 in your web browser. That IP address won’t be accessible over the network.
  • Ethernet. The ethernet 0 (eth0) interface is typically the connection to the local network. Even if you are running Linux in a virtual machine (VM), you’ll still have an eth0 interface that connects to the physical network interface of the host. Most commonly, you should ensure that eth0 is in an UP state and has an IP address so that you can communicate with the local network and likely over the Internet.

The Linux command to configure network interfaces/devices/links (whatever term you use) is ip link. In the following example, you can see how ip link (with no other options) shows two different interfaces, their status, and their MAC addresses associated with each one:

They are unique on the same network, every device has at least one, and addresses typically fall somewhere between 1.1.1.1 and 255.255.255.255. What are they? IP addresses, of course!