Networking-Linux Kernel-CUMULUS-NETWORKS-Linux101.pdf - The Gorilla Guide to Linux Networking 101 Inside this Guide Discover how Linux continues its

Networking-Linux Kernel-CUMULUS-NETWORKS-Linux101.pdf - The...

This preview shows page 1 out of 96 pages.

You've reached the end of your free preview.

Want to read all 96 pages?

Unformatted text preview: The Gorilla Guide to…® Linux Networking 101 Inside this Guide: • Discover how Linux continues its march toward world domination • Learn basic Linux administration tips • See how easy it can be to build your entire network on a Linux foundation • Find out how Cumulus Linux is your ticket to networking freedom David M. Davis ActualTech Media Helping You Navigate The Technology Jungle! In Partnership With The Gorilla Guide To… Linux Networking 101 Author David M. Davis, ActualTech Media Editors Hilary Kirchner, Dream Write Creative, LLC Christina Guthrie, Guthrie Writing & Editorial, LLC Madison Emery, Cumulus Networks Layout and Design Scott D. Lowe, ActualTech Media Copyright © 2017 by ActualTech Media. All rights reserved. No portion of this book may be reproduced or used in any manner without the express written permission of the publisher except for the use of brief quotations. The information provided within this eBook is for general informational purposes only. While we try to keep the information upto-date and correct, there are no representations or warranties, express or implied, about the completeness, accuracy, reliability, suitability or availability with respect to the information, products, services, or related graphics contained in this book for any purpose. Any use of this information is at your own risk. ActualTech Media Okatie Village Ste 103-157 Bluffton, SC 29909 Entering the Jungle Introduction: Six Reasons You Need to Learn Linux ....................................................... 7 1. Linux is the future ........................................................................ 9 2. Linux is on everything .................................................................. 9 3. Linux is adaptable ....................................................................... 10 4. Linux has a strong community and ecosystem ........................... 10 5. Linux is fun!................................................................................ 10 6. Linux is open-source and sometimes free ................................... 10 Chapter 1: What Is Linux? .....................................................12 The History of Linux ...................................................................... 13 What Is an Operating System? ........................................................ 14 The Components that Comprise the Linux Operating System....... 15 What Is a Distribution? ................................................................... 16 Understanding User Space vs. Kernel Space ................................... 16 Benefits of Using Linux .................................................................. 18 How Is Linux Used in the Enterprise? ............................................ 21 Summary ........................................................................................ 22 Chapter 2: Basics of Linux Administration........................................................... 23 Where Do I Get Linux? ................................................................... 23 How Do I Log In to Linux?............................................................. 24 How Do I Know What Type of Linux I Am Using? ........................ 26 Where Do I Find Things?................................................................ 27 Where Are the Applications, and How Do I Run Them? ............... 31 How Do I Install Applications?....................................................... 33 Linux Processes, Programs, and Services ........................................ 37 Importance of Linux Log Files ....................................................... 39 Users and Superusers ...................................................................... 40 Files and Permissions...................................................................... 42 Summary ........................................................................................ 44 Chapter 3: Basics of Linux Network Administration .......................................... 45 Understanding Linux Network Interfaces ...................................... 45 MAC Addresses .............................................................................. 48 IP Addressing.................................................................................. 49 DHCP ....................................................................................... 51 DNS .......................................................................................... 53 Network Statistics and Counters .................................................... 55 How to Configure Network Interfaces ........................................... 57 Network Interface Bonding ....................................................... 60 Summary ........................................................................................ 63 Chapter 4: Understanding Linux Internetworking......................................................... 64 Layer 2 vs. Layer 3 Internetworking ............................................... 66 Layer 2 Internetworking on Linux Systems .................................... 68 Bridging .................................................................................... 68 Spanning Tree ........................................................................... 70 Layer 3 Internetworking View on Linux Systems ........................... 73 Neighbor Table ......................................................................... 73 IP Routing ................................................................................. 74 Virtual LANs (VLANs) ................................................................... 76 Overlay Networks with VXLAN ..................................................... 79 Summary ........................................................................................ 82 Entering the Jungle iv Chapter 5: Cumulus Linux ................................................... 83 Network Command Line Utility (NCLU)...................................... 85 Building a Better Bridge ................................................................. 87 Two Links Are Better Than One ..................................................... 88 IP Fabrics Are Easy ......................................................................... 90 BGP EVPN—L3 Network Virtualization for Network Engineers .. 92 Next Steps .............................................................................. 95 Your Cumulus Linux Action Plan .................................................. 95 Entering the Jungle v Callouts Used in This Book The Gorilla is the professorial sort that enjoys helping people learn. In the Schoolhouse callout, you’ll gain insight into topics that may be outside the main subject but that are still important. This is a special place where readers can learn a bit more about ancillary topics presented in the book. When we have a great thought, we express them through a series of grunts in the Bright Idea section. Takes readers into the deep, dark depths of a particular topic. Icons Used in This Book Definition. Defines a word, phrase, or concept. Knowledge Check. Tests your knowledge of what you’ve read. Pay attention. We want to make sure you see this! GPS. We’ll help you navigate your knowledge to the right place. Watch out! Make sure you read this so you don’t make a critical error! Introduction Modern data centers are vastly different from legacy ones, and with good reason. In the past, companies typically supported a handful of critical monolithic applications, and the network was put in place primarily to support just those applications. Once installed, the network was left mostly untouched in many organizations. It consisted of dedicated hardware-based routers and switches that, for the times, performed their tasks of routing and switching packets quite well. The routers and switches favored by many enterprises typically came from one of the “big 3” networking vendors, but their products generally included costly appliances made up of custom hardware and highly proprietary software. That network gear was so specialized that an entire ecosystem sprang up around it to provide training, education, certification, consulting, software and support maintenance, and more. Over time, the data center landscape has changed — and for the better, particularly given that the application landscape has also morphed into something radically different from what was seen in the past. The number of business-critical applications is on the rise, and, unlike their older stay-at-home cousins, modern applications are distributed between on-premises infrastructure, between partner networks, and across the public cloud. End user and company data moves around the globe at light speed, and it’s happening constantly. New applications are being built today and torn down tomorrow in favor of even newer applications. Change is happening fast, and the network is adapting to support these changes. Thankfully, the specialized hardware that characterized legacy data centers isn’t so necessary anymore. Today, networking needs are being met using industry-standard switching/routing silicon, off-the-shelf hardware, Intel CPUs, and the Linux operating system. This combination makes networking far more affordable, more scalable, easier to learn, and more adaptable to the constantly changing needs of the business. After all, the network’s sole purpose is to connect the users with their applications and data, so it should do it as reliably, securely, efficiently, and affordably as possible. The key piece of the previous paragraph and the focus of this book is this: Linux networking is the future for almost every use case. But to leverage a Linux-based networking solution, you need to understand Linux, and that’s where this book comes in. Definitions Abound! If you don’t know what some of these words mean, don’t worry! We’ll define them during your Linux 101 journey. By the end of this book, you’ll be using these phrases in casual conversation! Six Reasons You Need to Learn Linux What if you don’t know Linux and are asking yourself, “Is this book really worth my time?” The short answer is a resounding YES, but to back that up, let me give you six good reasons why you should invest some of your time to learn Linux. 1. Linux is the future Although Linux has been around for over 25 years, it has enjoyed a continuous rise in business-critical usage, and many see Linux as being the most popular operating system for the future. The reason as to why Linux is the lingua franca of the modern data center relates to the points below. 2. Linux is on everything Linux runs more than two-thirds of the servers on the Internet, all Android phones, most consumer network gear, such as NetGear and Linksys devices, 99% of the top supercomputers in the world, many Internet of Things (IoT) devices, Tesla cars, and even PlayStation gaming consoles. Introduction 9 3. Linux is adaptable The very reason everything is on Linux is because it’s such an adaptable operating system. Thanks to Linux’s modularity and open-source nature, you can choose the pieces you need for your product or service and develop any pieces that may not already exist. You can install tiny versions of Linux for specialized use cases (such as operating water sprinklers in the gorilla exhibit at the zoo), modify it to work on appliances that route packets across a large enterprise network, or use it as your desktop operating system. Your choices are practically endless. 4. Linux has a strong community and ecosystem Linux has been so successful mainly because of the strong community and ecosystem that surrounds it. There are Linux contributors (developers who write code to make the product better); Linux forums and communities; Linux instructors; Linux training options; Linux blogs; Linux third-party tools; Linux distributions; Linux conferences; and even Linux books such as this one! 5. Linux is fun! Linux is a lot of fun because you can do just about anything with it. Linux is commonly used in Internet of Things (IoT) projects; it runs on tiny Raspberry Pi computers commonly used by hobbyists, and it even makes a great operating system on your laptop or desktop computer. More examples of the many uses of Linux are found throughout the book. 6. Linux is open-source and sometimes free Linux is open-source, meaning that the original source code is made freely available and may be redistributed and modified. That said, there are paid and fully supported commercial editions available, too. The open nature of Linux has made it the adaptable OS of the future, allowing it to run on everything, and has resulted in the creation of a strong ecosystem. Introduction 10 Ready to start learning Linux? Head to the first chapter in this Gorilla Guide and find out the answer to the burning question: What is Linux? Introduction 11 Chapter 1 What Is Linux? As you get started learning about Linux, you’ll likely have many of the same questions that thousands of other people have had since the beginning of Linux time. For that reason, we’ll start this chapter by answering the most common questions about Linux. By reading this chapter, you’ll find the answers to these questions: 1. What is an operating system? 2. What makes up the Linux OS? 3. What makes Linux unique? 4. What are the b enefits of using Linux? Figure 1-1. Linus Torvalds, principal author of the Linux kernel, on August 25, 1991, when he announced his new Linux kernel. “Hello everybody out there using minix I’m doing a (free) operating system (just a hobby, won’t be big and professional like gnu)…” Photo by Krd (Own work) [CC BY-SA 3.0 ( ) or CC BY-SA 4.0 ( )], via Wikimedia Commons The History of Linux Before we dive into Linux, let’s first take a step back in history. The creation of Linux starts with another operating system known as UNIX, which was first released in 1971. In 1983, the GNU Project (which stood for “GNU’s not Unix”) was started to create a complete UNIXcompatible operating system. Efforts stalled, and the project was missing a kernel. Around 1987, a UNIX-like operating system for students was released called MINIX, but its licensing prevented it from being distributed freely. Linus Torvalds (Figure 1-1) at the University of Helsinki in Finland was frustrated by the licensing of MINIX and began working on his own operating system kernel. His kernel, released in 1991, when combined with the GNU applications and open-source licensing, became the Linux operating system we know today. What Is a Kernel, and What Does It Do? The kernel is the special piece of the operating system that controls the CPU hardware, allocates memory, accesses data, schedules processes, runs the applications, and protects them from each other. It is the first program loaded on the computer when the computer starts up. The most critical pieces of code in the kernel are loaded into protected areas of memory so that they can't be overwritten by other applications running in the operating system. Since then, thousands of developers from around the world have contributed to enhancing the Linux kernel as well as the many pieces of software that make up the many different Linux distributions. Those developers include volunteers as well as developers from commercial companies. Today, the nonprofit Linux Foundation helps to create standards, awareness, and advancements across many different Linux projects. What Is Linux? 13 What Is an Operating System? The short answer is that an operating system, or OS, is software that you load on your hardware to make it “do things.” Without an operating system, most hardware is useless. For example, you might have a Dell computer that runs the Windows 10 operating system from which you run your applications. You might have an iPhone that runs the iOS operating system. You may also have an Apple MacBook that runs the Apple macOS operating system. The operating systems on these hardware platforms are what enable them to run applications, as shown in Figure 1-2. APPLICATIONS LIBRARIES SYSTEM DAEMONS SHELLS TOOLS OPERATING SYSTEM KERNEL HARDWARE Figure 1-2. How an operating system works with hardware and applications What Is Linux? 14 The Components that Comprise the Linux Operating System 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. In fact, the Space X Falcon 9 rocket and the International Space Station both use Linux! Linux is typically administered from a command line interface (CLI), also known as a shell. Besides the kernel, which manages the hardware and software processes, Linux distributions include a collection of Linux software, such as device drivers for accessing and controlling hardware, shared libraries, applications, and system daemons, which run the in background and respond to network requests. Figure 1-3 shows an example of what a common Linux distribution might look like. Numerous programming languages are available for Linux, as well as more than 70,000 different applications. Applications are installed from packages, which contain the application itself and metadata about the application. Definition: Metadata Metadata is data about data. In essence, metadata describes the kind of information that an underlying data set will store. Take, for instance, a file system on a computer. When you view a directory listing, you see the file name, file size, create date, last modified date, and so forth. These are basic examples of metadata associated with each object in that directory. What Is Linux? 15 What is a Linux Daemon? A system daemon in Linux is typically a background system process that awaits a specific set of conditions before jumping into action. For example, your Linux system may have a daemon called sshd, which stands for Secure Shell daemon. This system daemon runs in the background and accepts authorized incoming requests to log into the Linux host. System daemons do not interact with users and are not typically under the direct control of users, but rather of the system itself. What Is a Distribution? Often called a “distro,” a Linux distribution is the combination of specific versions of the Linux kernel with other libraries, system daemons, development tools, applications, packaging, and life-cycle management tools that are compatible with each other and tested for interoperability. The most common way that people acquire Linux today is by downloading one of the many different Linux distributions. Distributions are available not just for servers, desktop, and laptop computers, but also for a huge variety of more specialized devices that run Linux. Examples of Linux distributions are Ubuntu, Debian, Fedora, openSUSE, and Cumulus Linux. Understanding User Space vs. Kernel Space Operating systems all execute their kernel in protected and restricted memory that is called kernel space (see Figure 1-4) to prevent the kernel from terminating and crashing the system. What Is Linux? 16 APPLICATIONS DATABASE, WEB SERVER, NETWORK MONITOR, ETC. LIBRARIES SYSTEM DAEMONS SHELLS TOOLS LINUX KERNEL SCHEDULER, DRIVERS, SECURITY, NETWORKING Figure 1-3. Example of a common Linux distribution When a user runs an application or tool, that application or tool executes in what is called user space. This distinction is critical. Applications can come from a variety of sources, may be poorly developed, or originate unknown sources. By running these applications separate from kernel space, they can’t tamper with the kernel resources and cause the system to panic (crash). All applica...
View Full Document

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture