Mastering Python networking your one-stop solution to using Python for network automation, DevOps, and test--driven development
Master the art of using Python for a diverse range of network engineering tasks Key Features Explore the power of Python libraries to tackle difficult network problems efficiently and effectively Use Python for network device automation, DevOps, and software-defined networking Become an expert in im...
Other Authors: | |
---|---|
Format: | eBook |
Language: | Inglés |
Published: |
Birmingham, UK :
Packt Publishing
[2018]
|
Edition: | Second edition |
Subjects: | |
See on Biblioteca Universitat Ramon Llull: | https://discovery.url.edu/permalink/34CSUC_URL/1im36ta/alma991009630685906719 |
Table of Contents:
- Cover
- Title Page
- Copyright and Credits
- Packt Upsell
- Contributors
- Table of Contents
- Preface
- Chapter 1: Review of TCP/IP Protocol Suite and Python
- An overview of the internet
- Servers, hosts, and network components
- The rise of data centers
- Enterprise data centers
- Cloud data centers
- Edge data centers
- The OSI model
- Client-server model
- Network protocol suites
- The transmission control protocol
- Functions and characteristics of TCP
- TCP messages and data transfer
- User datagram protocol
- The internet protocol
- The IP NAT and security
- IP routing concepts
- Python language overview
- Python versions
- Operating system
- Running a Python program
- Python built-in types
- The None type
- Numerics
- Sequences
- Mapping
- Sets
- Python operators
- Python control flow tools
- Python functions
- Python classes
- Python modules and packages
- Summary
- Chapter 2: Low-Level Network Device Interactions
- The challenges of the CLI
- Constructing a virtual lab
- Cisco VIRL
- VIRL tips
- Cisco DevNet and dCloud
- GNS3
- Python Pexpect library
- Pexpect installation
- Pexpect overview
- Our first Pexpect program
- More Pexpect features
- Pexpect and SSH
- Putting things together for Pexpect
- The Python Paramiko library
- Installation of Paramiko
- Paramiko overview
- Our first Paramiko program
- More Paramiko features
- Paramiko for servers
- Putting things together for Paramiko
- Looking ahead
- Downsides of Pexpect and Paramiko compared to other tools
- Idempotent network device interaction
- Bad automation speeds bad things up
- Summary
- Chapter 3: APIs and Intent-Driven Networking
- Infrastructure as code
- Intent-Driven Networking
- Screen scraping versus API structured output
- Data modeling for infrastructure as code
- The Cisco API and ACI.
- Cisco NX-API
- Lab software installation and device preparation
- NX-API examples
- The Cisco and YANG models
- The Cisco ACI
- The Python API for Juniper networks
- Juniper and NETCONF
- Device preparation
- Juniper NETCONF examples
- Juniper PyEZ for developers
- Installation and preparation
- PyEZ examples
- The Arista Python API
- Arista eAPI management
- The eAPI preparation
- eAPI examples
- The Arista Pyeapi library
- Pyeapi installation
- Pyeapi examples
- Vendor-neutral libraries
- Summary
- Chapter 4: The Python Automation Framework - Ansible Basics
- A more declarative framework
- A quick Ansible example
- The control node installation
- Running different versions of Ansible from source
- Lab setup
- Your first Ansible playbook
- The public key authorization
- The inventory file
- Our first playbook
- The advantages of Ansible
- Agentless
- Idempotent
- Simple and extensible
- Network vendor support
- The Ansible architecture
- YAML
- Inventories
- Variables
- Templates with Jinja2
- Ansible networking modules
- Local connections and facts
- Provider arguments
- The Ansible Cisco example
- Ansible 2.5 connection example
- The Ansible Juniper example
- The Ansible Arista example
- Summary
- Chapter 5: The Python Automation Framework - Beyond Basics
- Ansible conditionals
- The when clause
- Ansible network facts
- Network module conditional
- Ansible loops
- Standard loops
- Looping over dictionaries
- Templates
- The Jinja2 template
- Jinja2 loops
- The Jinja2 conditional
- Group and host variables
- Group variables
- Host variables
- The Ansible Vault
- The Ansible include and roles
- The Ansible include statement
- Ansible roles
- Writing your own custom module
- The first custom module
- The second custom module
- Summary
- Chapter 6: Network Security with Python.
- The lab setup
- Python Scapy
- Installing Scapy
- Interactive examples
- Sniffing
- The TCP port scan
- The ping collection
- Common attacks
- Scapy resources
- Access lists
- Implementing access lists with Ansible
- MAC access lists
- The Syslog search
- Searching with the RE module
- Other tools
- Private VLANs
- UFW with Python
- Further reading
- Summary
- Chapter 7: Network Monitoring with Python - Part 1
- Lab setup
- SNMP
- Setup
- PySNMP
- Python for data visualization
- Matplotlib
- Installation
- Matplotlib - the first example
- Matplotlib for SNMP results
- Additional Matplotlib resources
- Pygal
- Installation
- Pygal - the first example
- Pygal for SNMP results
- Additional Pygal resources
- Python for Cacti
- Installation
- Python script as an input source
- Summary
- Chapter 8: Network Monitoring with Python - Part 2
- Graphviz
- Lab setup
- Installation
- Graphviz examples
- Python with Graphviz examples
- LLDP neighbor graphing
- Information retrieval
- Python parser script
- Final playbook
- Flow-based monitoring
- NetFlow parsing with Python
- Python socket and struct
- ntop traffic monitoring
- Python extension for ntop
- sFlow
- SFlowtool and sFlow-RT with Python
- Elasticsearch (ELK stack)
- Setting up a hosted ELK service
- The Logstash format
- Python helper script for Logstash formatting
- Summary
- Chapter 9: Building Network Web Services with Python
- Comparing Python web frameworks
- Flask and lab setup
- Introduction to Flask
- The HTTPie client
- URL routing
- URL variables
- URL generation
- The jsonify return
- Network resource API
- Flask-SQLAlchemy
- Network content API
- Devices API
- The device ID API
- Network dynamic operations
- Asynchronous operations
- Security
- Additional resources
- Summary
- Chapter 10: AWS Cloud Networking.
- AWS setup
- AWS CLI and Python SDK
- AWS network overview
- Virtual private cloud
- Route tables and route targets
- Automation with CloudFormation
- Security groups and the network ACL
- Elastic IP
- NAT Gateway
- Direct Connect and VPN
- VPN Gateway
- Direct Connect
- Network scaling services
- Elastic Load Balancing
- Route53 DNS service
- CloudFront CDN services
- Other AWS network services
- Summary
- Chapter 11: Working with Git
- Introduction to Git
- Benefits of Git
- Git terminology
- Git and GitHub
- Setting up Git
- Gitignore
- Git usage examples
- GitHub example
- Collaborating with pull requests
- Git with Python
- GitPython
- PyGitHub
- Automating configuration backup
- Collaborating with Git
- Summary
- Chapter 12: Continuous Integration with Jenkins
- Traditional change-management process
- Introduction to continuous integration
- Installing Jenkins
- Jenkins example
- First job for the Python script
- Jenkins plugins
- Network continuous integration example
- Jenkins with Python
- Continuous integration for Networking
- Summary
- Chapter 13: Test-Driven Development for Networks
- Test-driven development overview
- Test definitions
- Topology as code
- Python's unittest module
- More on Python testing
- pytest examples
- Writing tests for networking
- Testing for reachability
- Testing for network latency
- Testing for security
- Testing for transactions
- Testing for network configuration
- Testing for Ansible
- Pytest in Jenkins
- Jenkins integration
- Summary
- Other Books You May Enjoy
- Index.