Skip to Content
可编程网络自动化
book

可编程网络自动化

by Jason Edelman, Scott S. Lowe, Matt Oswalt
January 2023
Intermediate to advanced
458 pages
14h 16m
Chinese
Posts & Telecom Press
Content preview from 可编程网络自动化
网络配置模板
143
假设这项部署工作由你负责,你要将所有交换机的配置提交到新建的数据中心。每台交换
机显然都得有自己唯一的配置文件,但是设备之间的大部分配置是相似的。例如,可能具
有相同的
SNMP
团体字符串
、相同的管理员密码和相同的
VLAN
配置(至少对像
TOR
换机这样的相似设备而言是这样)。同样,配置的某些部分可能是单个设备所独有的,管
IP
和主机名便是如此,但如果是
3
层交换机呢?你需要为设备配置独特的子网,可能还
包括一些相当独特的路由协议,具体取决于该设备在拓扑中的位置。确定为哪些交换机设
置哪些参数颇为耗时,并且极有可能出错。模板使我们能够获得标准化的通用基础配置,
有助于确保为每个设备设置正确的值。将模板与填充模板的数据分开是简化配置过程的最
佳方法之一。
对网络工程师而言,模板的主要价值在于实现配置的一致性。实现得当的模板实际上能够
降低在更改生产网络配置时由于人为错误而导致问题的可能性。没必要惧怕在生产环境中
以自动化方式进行复杂的更改,只要遵循良好的纪律并正确测试模板,就可以改善网络操
作。模板并不会自动消除人为错误,但如果正确使用,的确能够大大降低此类情况的发
生,从而减少中断。
使用模板协助部署新网络设备只是模板价值的小小体现而已,它为网络工程师节省了大量
时间。不过可别以为模板只有这点儿用武之地。在很多网络自动化项目中,使用模板的甚
至不是人类用户,而是诸如
Ansible
这样的自动化软件
,它们负责将配置改动推送到工作
在生产环境中的网络设备。
本章会在余下部分中展示
Jinja
模板的使用实例。 ...
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

弱监督学习实用指南

弱监督学习实用指南

Wee Hyong Tok, Amit Bahree, Senja Filipi
Python和NLTK实现自然语言处理

Python和NLTK实现自然语言处理

Posts & Telecom Press, Nitin Hardeniya
Go程序设计语言

Go程序设计语言

艾伦A. A.多诺万, 布莱恩W. 柯尼汉
Python机器学习案例精解

Python机器学习案例精解

Posts & Telecom Press, Yuxi (Hayden) Liu

Publisher Resources

ISBN: 9787115606181