Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Python Network Programming Techniques

You're reading from   Python Network Programming Techniques 50 real-world recipes to automate infrastructure networks and overcome networking challenges with Python

Arrow left icon
Product type Paperback
Published in Oct 2021
Publisher Packt
ISBN-13 9781838646639
Length 340 pages
Edition 1st Edition
Languages
Tools
Concepts
Arrow right icon
Author (1):
Arrow left icon
Marcel Neidinger Marcel Neidinger
Author Profile Icon Marcel Neidinger
Marcel Neidinger
Arrow right icon
View More author details
Toc

Table of Contents (14) Chapters Close

Preface 1. Chapter 1: A Primer on Python 3 2. Chapter 2: Connecting to Network Devices via SSH Using Paramiko FREE CHAPTER 3. Chapter 3: Building Configuration Templates Using Jinja2 4. Chapter 4: Configuring Network Devices Using Netmiko 5. Chapter 5: Model-Driven Programmability with NETCONF and ncclient 6. Chapter 6: Automating Complex Multi-Vendor Networks with NAPALM 7. Chapter 7: Automating Your Network Tests and Deployments with pyATS and Genie 8. Chapter 8: Configuring Devices Using RESTCONF and requests 9. Chapter 9: Consuming Controllers and High-Level Networking APIs with requests 10. Chapter 10: Incorporating your Python Scripts into an Existing Workflow by Writing Custom Ansible Modules 11. Chapter 11: Automating AWS Cloud Networking Infrastructure Using the AWS Python SDK 12. Chapter 12: Automating your Network Security Using Python and the Firepower APIs 13. Other Books You May Enjoy

Creating a VPC

VPC is an AWS service that lets you create separate and isolated environments for your resources to run in. In fact, every EC2 instance you start is part of your default VPC, but creating and then associating an EC2 instance with a specific VPC allows you to have full control over routing tables, internal IP addresses, and all other aspects of your instance's connectivity. In this recipe, we will learn how to create such a VPC programmatically. In the Subnetting your VPC recipe, we will create a subnet within a VPC and create an EC2 instance in the previously created VPC. Then, in the Changing routes in your VPC recipe, we'll learn how to change the routes in our VPC. But before we can change these properties, we'll have to create a VPC.

Getting ready

Open your code editor and start by creating a file called create_vpc.py. Next, navigate your terminal to the same directory that you just created the _vpc.py file in.

You'll have to have authentication...

lock icon The rest of the chapter is locked
Visually different images
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Python Network Programming Techniques
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime
Modal Close icon
Modal Close icon