Book Image

Mastering Linux Network Administration

By : Jay LaCroix
Book Image

Mastering Linux Network Administration

By: Jay LaCroix

Overview of this book

Linux is everywhere. Whether you run a home office, a small business, or manage enterprise systems, Linux can empower your network to perform at its very best. Armed with the advanced tools and best practice guidance of this practical guide, you'll be able to mold Linux networks to your will, empowering your systems and their users to take advantage of all that Linux-based networks have to offer. Understand how Linux networks function and get to grips with essential tips and tricks to manage them - whether you're already managing a networks, or even just starting out. With Debian and CentOS as its source, this book will divulge all the details you need to manage a real Linux-based network. With detailed activities and instructions based on real-world scenarios, this book will be your guide to the exciting world of Linux networking.
Table of Contents (17 chapters)
Mastering Linux Network Administration
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Preface

In this book, we will learn about the concepts that are required to manage real Linux-based networks. The goal is to help the reader grow from a beginner or an intermediate-level Linux user, to someone who can manage and support real Linux-based networks. The book starts with a couple of introductory chapters, in which the reader will set up their environment and then refresh some basics that will serve as the foundation for the rest of the book. From there, more advanced topics will be covered with useful examples, which the reader will be able to follow along with gaining valuable hands on practice.

During this journey, we will cover the tasks that a network administrator will typically perform on the job such as installing Linux, setting up DHCP, sharing files, IP addressing, monitoring resources, and so on. These examples are covered for not one but two popular distributions, Debian and CentOS. Since these two are very popular distributions in the enterprise, the reader will be well prepared to manage networks based on one distribution or the other (and also the countless other distributions based on them).

Finally, the last few chapters will cover the best practices to prevent intrusions and attacks and also troubleshooting to assist you when things go wrong.

What this book covers

Chapter 1, Setting up Your Environment, covers the process of setting up your lab environment for use in this book. Installing Debian and CentOS is covered, along with the pros and cons of using virtual machines.

Chapter 2, Revisiting Linux Network Basics, refreshes the reader on core Linux concepts that provide a foundation for the rest of the book such as TCP/IP, hostname resolution, and the IP and net tools suites.

Chapter 3, Communicating Between Nodes via SSH, covers all things SSH. In this chapter, we take a look at how to use SSH and how to set up an OpenSSH server to allow other nodes to connect. The scp command is also covered, allowing us to transfer files from one machine to another.

Chapter 4, Setting up a File Server, covers both Samba and NFS. Here, we'll discuss when it's appropriate to use one over the other, as well as the configuring and mounting these shares.

Chapter 5, Monitoring System Resources, deals with the monitoring of resources on our Linux systems such as inspecting free disk space, checking available memory, rotating logs, and viewing journal logs.

Chapter 6, Configuring Network Services, is all about the services that make our network come together. Topics such as DHCP and DNS servers are covered here. NTP is also thrown in for good measure.

Chapter 7, Hosting HTTP Content via Apache, covers Apache, which is currently the most used web server software in the world. Here, we'll not only install Apache, but we'll configure it and manage the modules as well. The virtual hosts are also covered.

Chapter 8, Understanding Advanced Networking Concepts, takes the reader to the next level by discussing more advanced topics such as subnetting, Quality of Service, redundancy in DHCP and DNS, and many more.

Chapter 9, Securing Your Network, deals with hardening our systems in order to prevent unauthorized access. Here, we'll cover iptables, fail2ban, SELinux, and much more.

Chapter 10, Troubleshooting Network Issues, rounds up our journey with some troubleshooting tips you can use if you run into problems.

What you need for this book

This book requires you to have one or more computers at your disposal that are capable of running either Debian or CentOS, preferably both. It really doesn't matter if you run them on a virtual machine or physical hardware, as the only requirement is that you should be able to install one or both of these distributions and access them via a terminal. Root level access is required for these installations.

While you can certainly use any Linux installations you may already have, it's highly recommended to have separate, fresh installations to work with, as some of our topics can be disruptive if they are run on production networks. If you are in doubt, VirtualBox or older machines that you may have lying around will do just fine. Network access is required, but that goes without saying, given the subject matter of this book.

Some general Linux know-how is expected. By no means is the user required to be advanced, as the purpose of this book is to upgrade your existing knowledge. That being said, there are a few things that you should already be familiar with in order to have the smoothest possible experience. First, you should already know how to modify configuration files using a text editor. No assumptions are made in this book as to which text editor you use, it's really up to you. As long as you understand any text editor, whether it be nano, vim, or even gedit—you're in good shape. If you can open a root-owned configuration file, then make changes and save it—you're all set. If in doubt, nano is a great text editor for beginners and only takes a few minutes to learn. For the more advanced users, vim is a good choice. Speaking of root, you should also understand the difference between running commands as a root or a normal user. Also, you should be able to navigate the file system and browse around.

However, even if you need to brush up on the editing of text files or switching to the root user, don't let that stop you. There is quite a bit of knowledge online that you can use to brush up, most text editors available for Linux offer really good documentation.

Who this book is for

This book is targeted at the users who already know the basics of Linux, who want to learn how to manage Linux-based networks or take their skills to the next level. This can either be for the purpose of supporting an all-Linux network or even a mixed environment. This book takes the reader through easier topics such as installing Debian, to the more advanced concepts such as subnetting. By the end of this book, you should have enough knowledge to set up a completely networked environment, including all the components that such a network should feature. If this excites you, then this book is definitely for you!

However, in this book we focus on real-world examples pertaining only to Linux. If your goal is to become certified with Cisco or obtain some other high-level certification, this may not be the best place for you. Here, it's all about practical examples, without focusing too much on the theory. While certification cram books are neat, in this book we get things done – the real things that you will be required to do if asked by your boss or client to implement a Linux network. If that's your goal, you're definitely in the right place.

Conventions

In this book, you will find a number of text styles that distinguish between different kinds of information. Here are some examples of these styles and an explanation of their meaning.

Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "In most cases, this will be /dev/sda."

A block of code is set as follows:

default-lease-time 86400;
max-lease-time 86400;
option subnet-mask 255.255.252.0;
option broadcast-address 10.10.99.255;
option domain-name "local.lan";
authoritative;
subnet 10.10.96.0 netmask 255.255.252.0 {
  range 10.10.99.100 10.10.99.254;
  option routers 10.10.96.1;
  option domain-name-servers 10.10.96.1;
}

Any command-line input or output is written as follows:

systemctl status httpd

Any command that is required to be run with root previleges will be prefixed with a # character, like this:

# yum install httpd

New terms and important words are shown in bold. Words that you see on the screen, for example, in menus or dialog boxes, appear in the text like this: "Once it's finished, you can save the results by clicking Scan and then Save Scan."

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or disliked. Reader feedback is important for us as it helps us develop titles that you will really get the most out of.

To send us general feedback, simply e-mail , and mention the book's title in the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide at www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code

You can download the example code files from your account at http://www.packtpub.com for all the Packt Publishing books you have purchased. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.

Downloading the color images of this book

We also provide you with a PDF file that has color images of the screenshots/diagrams used in this book. The color images will help you better understand the changes in the output. You can download this file from http://www.packtpub.com/sites/default/files/downloads/9597OS_ColorImages.pdf.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you could report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website or added to any list of existing errata under the Errata section of that title.

To view the previously submitted errata, go to https://www.packtpub.com/books/content/support and enter the name of the book in the search field. The required information will appear under the Errata section.

Piracy

Piracy of copyrighted material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works in any form on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at with a link to the suspected pirated material.

We appreciate your help in protecting our authors and our ability to bring you valuable content.

Questions

If you have a problem with any aspect of this book, you can contact us at , and we will do our best to address the problem.