Skip to Content
《网络可编程性和自动化》第二版
book

《网络可编程性和自动化》第二版

by Matt Oswalt, Christian Adell, Scott S. Lowe, Jason Edelman
May 2025
Intermediate to advanced
828 pages
10h 54m
Chinese
O'Reilly Media, Inc.
Content preview from 《网络可编程性和自动化》第二版

第 3 章 Linux

本作品已使用人工智能进行翻译。欢迎您提供反馈和意见:translation-feedback@oreilly.com

本章旨在帮助你熟悉 Linux 的基础知识,这是一种在 Network+ 圈中越来越常见的操作系统。你可能会问,为什么我们要在本书中加入有关 Linux 的章节。毕竟,Linux 作为一个类似 Unix 的操作系统,与网络自动化和可编程性到底有什么关系呢?

在网络自动化背景下考察 Linux

从网络自动化的角度来看 Linux,我们觉得这些内容非常重要,原因有以下几点。

首先,有几种现代网络操作系统(NOS)是基于 Linux 的,不过有些使用的是自定义 CLI,这意味着它们看起来或行动起来都不像 Linux。不过,其他一些网络操作系统确实暴露了 Linux 内部和/或使用了 Linux shell(如bash)。

其次,一些新的公司和组织正在向市场推出针对网络设备的完整 Linux 发行版。例如,OpenCompute Project (OCP) 使用 Open Network Linux (ONL) 作为构建 Linux 驱动的 NOS 的基础(Big Switch(现为 Arista 的一部分)在 ONL 上构建了 Switch Light,DENT Project 也在 ONL 上构建了 dentOS)。另一个例子是 Cumulus Networks(现隶属于英伟达),它提供基于 Debian 的 Cumulus Linux 作为支持硬件平台的 NOS。另一个例子是 SONiC(Software for Open Networking in the Cloud 的缩写),它得到了微软、英特尔、英伟达、博通、戴尔等公司的支持。作为一名网络工程师,你越来越有可能需要了解 Linux 才能配置你的网络。

第三,也是最后一点,我们在本书中讨论的许多工具都起源于 Linux,或者需要在 Linux 系统中运行。例如,Ansible(第 12 章讨论的工具)需要 Python(第 6 章讨论的主题)。由于我们将在第 12 章中介绍的一些原因,在使用 Ansible 实现网络设备自动化时,通常会在运行 Linux 的网络连接系统上运行 Ansible,而不是直接在网络设备上运行。同样,当使用 Python 从网络设备中收集和/或操作数据时,通常也会在运行 Linux 的系统中进行。

最后,eBPF 和 XDP 等相对较新的开发成果正在增强 Linux 在整个 Network+ 领域的影响力。这些相互关联的主题非常重要,值得在本章末尾单独列出一节("利用 eBPF 和 XDP 发展 Linux 内核")。我们将在这一节中定义这两项技术,解释它们的重要性,并讨论一些使用案例。目前,我们只需指出 eBPF 正在改变 Linux 的多个方面,包括(但不限于)网络、安全性和可观察性。

基于这些原因,我们认为有必要加入一章,力求实现以下目标:

  • 介绍一下 Linux 的历史背景

  • 简述 Linux 发行版的概念

  • 向你介绍最流行的 Linux 外壳之一 bash

  • 讨论 Linux 网络基础知识

  • 深入学习一些高级 Linux 网络功能

  • 提供有关 bash 脚本自动化的简短讨论

请记住,本章并不打算成为关于 Linux 或 bash shell 的全面论述;相反,它旨在让你在网络自动化和可编程的背景下使用 Linux。说到这里,让我们先简要了解一下 Linux 的历史和起源。

探索 Linux 简史

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Python算法交易实战

Python算法交易实战

Posts & Telecom Press, Sebastien Donadio
软件工程基础

软件工程基础

Nathaniel Schutta, Dan Vega

Publisher Resources

ISBN: 9798341656994