In this video and lab, I'm once again using genus three.
Genus three makes this process a very easy.
One of the best devices to use in June three is the network automation container.
If you don't have this device as an installed device, look under available devices in Genius three
and drag the network automation container to your workspace to install it in S3.
In my example, I already have the network automation container installed, so I'm going to drag it
to the Genius three workspace.
What I'll also do is drag an Ethernet switch to the Genie three workspace and run that on the Genie
three VM.
In my example, I'm running all the devices on the S3 VM.
The network automation container boots up very quickly.
So I want to have the Ethernet switch.
In the topology which will allow.
The Docker container to get an IP address from the net cloud and also have internet connectivity.
The devices I'm going to automate, however, are Cisco Viral iOS V Layer two switches.
And Cisco iOS V Routers.
Cisco.
Viral images are recommended for use in Genius three.
You could use other devices, but please note that you may encounter issues when using dynamic images.
So in this example, I'm going to use a viral images and a network automation container.
Now, in this video, I'm going to build the topology from scratch.
You don't have to do that if you don't want to.
You can download the preconfigured topology that I've shared.
So rather than building the topology, you can simply download it and import it into three.
I'm going to connect the Ethernet switch to the net cloud.
Connect the.
Janus three is a switch to the iOS of Layer two.
Switch and connect the switch to the router.
So we'll start off with a simple topology.
I'll change the switch name to switch one router name to router one.
Very basic topology to start with.
But we'll expand this topology and make it more complex as we go through the course.
But initially I want to get you started automating as quickly as possible.
You can make the topology look pretty.
I'm not worried too much about that.
I simply want to get started.
So I'll start up the network devices and open up consoles to them.
As you can see here, the iOS V player, two switches booting.
And so is the EOS virata.
The network automation container has already booted up.
If config shows us that the network automation container only has an IP version six address, it doesn't
have an IP version for address.
We're not going to manage the Ethernet switch through the console.
What I'm going to do initially, however, is configure the network automation container to use DHCP.
So cat it seen network interfaces shows us that these lines have been commented out.
So I'm going to use nano ETSI network interfaces and I'm going to uncomment these two lines and press
control X and Y to save the file and I'm going to overwrite the file.
So again, I've used Nano, a simple text editor, to uncomment these two lines, and I've saved the
file.
Now, in the prebuilt topology that I've given you.
That's already been done for you.
So you can simply import the topology and that configuration would have already been completed for you.
I'm going to stop at the network automation container and start it up again.
And open up a console to the network automation container.
As you can see here, it's obtained an IP address.
So if config.
Shows us the IP address of the network automation container.
The net cloud runs a DHCP server and has allocated an IP address to the network automation container.
You don't have to use the net cloud if you don't want to.
You could configure your Cisco router as a DHCP server, but to keep things simple and to get started,
I've used the net cloud as the DHCP server.
The net cloud also gives us internet access so I can use commands such as APT.
Get update to update references on the network automation container.
And I can also ping sites on the internet.
So I would recommend the use of the net cloud and the network automation container in Janus three.
One of the reasons for using the network automation container is that it comes preinstalled with both
Python version 2.7 as well as Python three.
In this case, Python 3.5.
You could install a later release of Python if you want to.
But for our example's python, 3.5 suffices.
In other words, it's good enough.
But if you want to install a later release of Python such as 3.6 or later, you can do that.
But for our examples, Python 3.5 is good enough.
So again, I could run Python version three and print something such as Network Automation or Hello
World within the network automation container.
I could do something such as X equals one, y equals to x plus y equals three.
But that's not really the focus of this course.
The focus of this course is network automation.
So in Google, I'm going to do a search for Python three Telnet.
My first hit in Google is the Telnet library on the Python org website.
And this gives us details of the Telnet library available in Python.
I'm going to scroll to the end of the page after the end of the page.
We find this example Python script.
I'm going to copy that and I'm going to open up a text editor.
In this case, I'm using sublime text and I'm going to paste that script into Sublime text.
Now when it comes to Python ideas, they are many integrated development environments available for
Python.
One of the most popular is pie charm.
You can download a free version of Pi Chom and use that to edit your scripts.
In these examples, I'm going to be creating scripts such as my first Python three script directly on
the network automation container.
However, using Nano for editing scripts isn't very easy, so you may prefer to use an ID such as pie,
charm or sublime text.
For doing your editing.
So what I'm going to be doing in a lot of examples is editing the script and creating the script in
sublime text, and then I'm going to copy it into three.
Again, it's up to you.
Pie charm is very popular.
Sublime text is very popular.
Microsoft Studio Code.
Is another integrated development environment that you may prefer if you're used to using Microsoft
products.
So it's really up to you.
You could use pie charm, sublime text, Visual Studio, or you could simply search in Google for Python
ID and use one of the other ideas that are freely available on the Internet.
In a lot of cases, you get free and paid versions of IDs.
I suggest that initially you get the free version of an ID such as Petrom charm and use that.
And once you get better at Python, you can invest in a paid version of an ID, but start out by using
something that's free.