This book shows the Python programming language's importance and power to automate network devices such as routers, switches, firewalls, system devices like Linux servers, and cloud devices like the AWS platform. It shows to manage and configure thousands of devices with a single script, saving time
Python Networking Solutions Guide: Leverage the Power of Python to Automate and Maintain Your Network Environment
β Scribed by Tolga Koca
- Publisher
- BPB Publications
- Year
- 2023
- Tongue
- English
- Leaves
- 205
- Category
- Library
No coin nor oath required. For personal study only.
β¦ Synopsis
Python is the de-facto standard for automated network operations nowadays. With the power of Python, network devices can be automated easily with basic scripts. Written in direct and intuitive language, this practical guide will help you to automate your network with Python.
In this book, you will understand what network automation is precisely. The book will help you get familiar with the basics of the Python language. It will also help you learn how to monitor, maintain, and deploy configurations in network and system devices such as routers, switches, servers, and storage. The book will explain how to automate cloud infrastructures like AWS (Amazon Web Services) with Python.
By the end of the book, you will be able to decrease your routine workload and improve productivity by automating your networking tasks.
β¦ Table of Contents
Cover Page
Title Page
Copyright Page
Dedication Page
About the Author
About the Reviewer
Acknowledgement
Preface
Errata
Table of Contents
1. Introduction to Network Automation
Structure
Objectives
Introduction to network automation
Benefits of network automation
Future of networking
Introduction to Python
Python usage area
Python installation
Python for Windows
Python for Linux
Python for MAC
Running Python codes
Pycharm installation for Windows
Install and import Python modules
Conclusion
Multiple choice questions
Answer
Questions
2. Python Basics
Structure
Objectives
Print and Δ±nput functions
Print()
Input ( )
Data types
String and integer
String methods
List
List methods
Dictionary
Dictionary methods
Statements and conditions
If condition
For statement
While statement
Break and continue statement
Range statement
For else statement and nested loops
Tryβ¦except statement
Conclusion
Multiple choice questions
Answers
Questions
3. Python Networking Modules
Structure
Objectives
File handling
Open function
OS module
Word files
Excel files
RE modules
RE module functions
Special sequences
Sets in the RE module
Advanced topics of Python
Functions
Functions with parameters
Functions with default parameters
Call variables from functions
Creating modules
Classes
Conclusion
Multiple choice questions
Answers
Questions
4. Collecting and Monitoring Logs
Structure
Objectives
Connection modules
SSH connection
Paramiko module For SSH
Connect 1 device with Paramiko
Running configuration commands with Paramiko
Connect to multiple devices with Paramiko
Netmiko module for SSH
Connect a single device with Netmiko
Connect to multiple devices with Netmiko
Telnet connection
Telnetlib module for telnet
Connect to multiple devices with telnetlib
Netmiko module for telnet
Collecting logs
Collecting version and device information
Collecting CPU levels
Finding duplicated IP address
Collecting logs with multithreading
Tools and calculators
IP address validator
Subnet calculator
Conclusion
Multiple choice questions
Answers
Questions
5. Deploy Configurations in Network Devices
Structure
Objectives
Configure network devices
Configuration of interfaces
Replacing configurations on files
Configure devices with Jinja2 template
Introduction to Jinja2 template
Introduction to YAML language
Rendering Jinja template with a YAML file
Configure devices with Jinja
If statement in Jinja
Configure devices with Napalm module
Collect logs from devices with NAPALM
Configure devices with NAPALM
Configure devices with Nornir module
Configure inventory in Nornir
Connection to devices with Nornir-Netmiko
Connection to devices with Nornir-NAPALM
Configure devices by Nornir and Jinja template
Conclusion
Multiple choice questions
Answers
Questions
6. File Transfer and Plotting
Structure
Objectives
File transfers
Backup configuration file with SSH
File transfer with FTP connection
File transfer with SFTP connection
File transfer with Netmiko SCP connection
Netmiko SCP connection with concurrent module
File transfer with Nornir SCP connection
Backup configuration file with SCP
Plotting data
Plotting CPU levels
Plotting interface bandwidth
Conclusion
Multiple choice questions
Answers
Questions
7. Maintain and Troubleshoot Network Issues
Structure
Objectives
Upgrade network devices
Alert alarms in devices
Collect logs with SNMP
Send logs via email
Reachability test to network devices
Ping test script
Traceroute test script
Conclusion
Multiple choice questions
Answers
Questions
8. Monitor and Manage Servers
Structure
Objectives
Implement server environment
Download VMware player and Ubuntu
Install Ubuntu on VMware
Activate SSH connection
Maintain Linux servers
Collect logs via syslog
Login servers with secure password
Collect CPU and memory levels
Collect interface information
Collect type and permission of files
Server configurations
Create users in servers
Install packages
Transfer files with Paramiko
Reboot servers concurrently
Stop running processes by script
Conclusion
Multiple choice questions
Answers
Questions
9. Network Security with Python
Structure
Objectives
Activate security services
Install and activate the βFirewalldβ service on servers
Configure firewall settings on servers
Create access lists in network devices
Manipulate network packets with scapy
Check logs and configurations
Check CPU levels periodically with Crontab
Check router configuration for insecure passwords
Check port security configuration in routers
Collect packets from ports with Pyshark
Conclusion
Multiple choice questions
Answers
Questions
10. Deploying Automation Software
Structure
Objectives
Introduction to InquirerPy module
Automation tool design
Create main tool script
Create subtask scripts
Network device scripts
Server scripts
Other remaining scripts
Conclusion
Multiple choice questions
Answers
Questions
11. Automate Cloud Infrastructures with Python
Structure
Objectives
Cloud environment deployment
Introduction to AWS
Installation of Boto3 and AWS CLI
EC2 instance management
Manage EC2 instances with Python
Connection to EC2 instances
S3 bucket management
EBS volume management
Manage EBS volumes
Create snapshots of EBS volumes
Attach EBS volume to EC2 instance
IAM user management
Conclusion
Multiple choice questions
Answers
Questions
Index
π SIMILAR VOLUMES
<p><span>Automate Your Network Configuration, Management, and Operation Tasks with Python</span></p><p></p><p></p><p></p><p><span>Key Features</span></p><p><span>β Get familiar with the basics of network automation.</span></p><p><span>β Understand how to automate various network devices like Routers
Key Features β’ Get started with network automation (and different automation tasks) with relevant use cases β’ Apply software design principles such as Continuous Integration and DevOps to your network toolkit β’ Guides you through some best practices in automation Book Description Network auto
New edition of the bestselling guide to mastering Python Networking, updated to Python 3 and including the latest on network data analysis, Cloud Networking, Ansible 2.8, and new libraries Key Features β’ Explore the power of Python libraries to tackle difficult network problems efficiently and e
Network automation and programmability has become the central point of revolutionary change in the last few years. As the hype and marketing sets in, the topics has become confusing and theoretical. This practical guide will show how to use Python to simplify your daily network tasks. You will learn