Skip to content
CBT Nuggets
DemoBook a Demo

Create a Juniper Automation Lab

This skill, led by John McGovern, focuses on building a network automation lab for Juniper Networks. It covers the setup of a development environment using virtualization technologies like VMware and EVE-NG, and the installation of Juniper network images. The course emphasizes the use of Python for network automation, detailing how to configure and manage network devices programmatically. Additionally, it guides learners through setting up an integrated development environment with Visual Studio Code to streamline the automation process.

Full skill from Python and Ansible Automation for Juniper Networks. Preview the training IT teams trust.

Updated

55m

Skill 1 of 45 in Python and Ansible Automation for Juniper Networks

What you'll learn

  • Explain how network automation reduces configuration errors and shortens change windows compared to manual CLI management over SSH
  • Deploy EVE-NG in VMware from the OVF package to virtualize Juniper network topologies
  • Obtain Juniper device images through a product serial number or evaluation user access and add them to EVE-NG
  • Install a Linux virtual machine in VMware to serve as the network automation control node
  • Connect VS Code to the Linux control node remotely to create and manage automation files
  • Configure the Junos fxp0 management interface and user login credentials for out-of-band automation access

Free 55-minute video lesson with a full transcript and knowledge checks. No account needed to watch.

Overview

Join John McGovern as he demonstrates how to build a network automation lab for Juniper networks!

Recommended Experience

  • None

Related Job Functions

  • Network Admin
  • Network Engineer

A former CBT Nuggets learner, John used online IT training to help him build a diverse skill set, which includes networking and cybersecurity.

Introduction

Let's talk about some of the core concepts around network automation!

Knowledge Check

Which programming language is most commonly used to automate networks?

Virtualisation

Let's discuss the virtualisation options that we have available to us to create our automation labs!

Knowledge Check

Which virtualisation platform was used in this nugget?

Juniper Images

Let's talk about how we can legally obtain Juniper images for our labbing purposes!

Knowledge Check

(True or False) You must pay a license fee to obtain Juniper network images for evaluation purposes.

Linux Installation

Let's walk through the installation of our Linux control node!

Knowledge Check

Which network adapter setting was used in this Nugget?

Creating the Development Environment

Let's walk through the steps to get our network automation development environment up and running!

Knowledge Check

(True/False) VSCode's Python extension can make Python development easier by providing autocompletion and debugging features.

Creating a Juniper Lab

With everything in place, let's now create our very first juniper lab!

Knowledge Check

Which command is used to configure SSH?

Conclusion

I hope this has been informative for you and I would like to thank you for consuming.

View Transcript

Introduction

0:12Hey, everyone. And welcome to this brand new course here on CBT Nuggets, all around the concepts behind Juniper Network Automation. So we have a lot of really cool things that we have planned within this course. But this very first skill is all going to be focused around getting you up and running with a development environment so that you can write and execute your automation scripts, as well as how you can actually set up a particular lab environment to test out these configurations.

0:45So this means we're going to have to look at some type of virtualization solutions. We're going to have to look at particular ways we can emulate networking devices, as well as talk through some of the basics we need to actually write our scripts. This would be things such as an IED. Now, we'll get to see what that looks like very, very shortly. But before we even get to any of that, I figured the best thing to do to introduce this course is to talk a little bit about network automation, and what it is we are actually trying to achieve by learning these new skills.

1:19So if you happen to be managing networking devices in the traditional sense, this would be using the good old CLI, that is the command line interface. Typically the way you would manage your networks-- if you happen to be over here, let's imagine this is your management station whereby you are logging in. Typically you're going to log in remotely to your target device. Let's say, for example, this node right here. And typically you would use some type of protocol such as SSH for the connectivity. And from that point on, with this connection established, you can know issue commands to that device remotely where they are applied to the actual configuration.

1:59Now, network engineers kind of figured out that this is not the most scalable way to manage networks. Networks, after all, are getting more complex. We have all these new virtualization technologies, we have underlay and overlays. And the amount of nodes within the network just seem to be growing and growing, especially when you begin to deal in the hyperscale environments and these very large data centers such as Google data centers or Amazon data centers, whatever it may be. So if we do want to implement these type of large configuration changes across many, many devices, the bottleneck now is not quite so much the latency across the actual connection to the device, the bottleneck, sadly, is as humans.

2:42When we want to be typing all of these commands over and over and over again, we end up repeating ourselves very often. Say, for example, you wanted to type some basic NTP configuration on a device. So you issue that command to this device, you then log into the next one, and you issue again, log in to the next one, issue again, so on and so forth. Clearly this is going to take a lot of time, which might mean that the actual configuration change is limited to a very particular change window.

3:13Say, for example, we're only allowed to make actual configuration changes between the hours of 12:00 AM and 6:00 AM before anyone actually happens to be in an office, for example, in using the network that we happen to be supporting. That just makes our lives much, much more difficult. Now, you may have used the old school automation solution. And I say that with tongue in cheek. And that is the well known technique of network engineers to utilize things such as Notepad. Basically repeatable configurations that you are going to apply, you type into a little text file.

3:47And then you Log in, and you Paste it into a device. Login into the next, Paste it, Log in, and Paste, and so on and so forth. Now, again, I suppose this is a little bit better than having to hand type the same commands. One of the things that it does eliminate is that it can help eliminate the fat fingering of a configuration. You know the way when you keep typing in the same commands over and over again, well, quite easily the very problem of human error comes into play. And we can actually mistype a command, and in effect misconfigure the actual device.

4:22And, again, as you scale this problem up, the more devices you have to connect to, the more likely this is to eventually happen. So at least the Notepad solution in some respect allows you to write the configurations into a text file, check it to make sure that's OK. And every time you happen to paste in that configuration, you're going to be pasting in the exact same configs to every single device. So that is a simple solution to the problem of repeatability. But, again, this is not scalable.

4:54If you happen to have, say, 10,000 devices, think how long that is going to take you to do that. Realistically this is not a feasible solution for that type of scale. Similarly, what if you wanted to type in very similar configurations to all devices but with slight modifications? Let's maybe say you always wanted to log into a device, set a hostname name for each device, and then configure the same DNS server for every single device. Well, the host name for every single device is going to be different.

5:28But you couldn't just type all of that into Notepad and just blindly copy and paste the same config into each device because then each device will have the exact same configuration. This is not a desired effect. Luckily, in the modern world of network automation, these types of solutions are actually very easily solvable. And they're going to be solved primarily by the Python programming language. Now, you can use other programming language, but Python, by far and away, is the most popular and dominant programming language in the world of network automation today.

6:02So this is primarily going to be our focus. But understand that when we happen to use this programming language, we're going to really help reduce the problems of human error that is mistyping configurations, whatever it may be. We're going to be able to easily substitute in variable values for particular pieces of configuration. We'll also be able to test our network more vigorously by being able to connect to all our devices at the same time. And maybe say, for example testing, that we have the correct amount of BGP peerings that we expect for each device, whatever it may be.

6:35We'll also be able to quickly deploy mass changes across many devices at the same time. And when I say the same time, I mean with concurrency literary, we're going to be able to modify all the devices together at once as opposed to logging into one, logging out, logging into the next, logging out, and back into the next, so on and so forth. So this means our change windows get much, much shorter. Our changes are much more stable and reliable and predictable because they are repeatable.

7:06And we are more easily able to test our network, as well as to repair it our network by being able to roll back erroneous configurations back to a healthy network state. And, again, being able to roll back thousands of devices within seconds is a really going to be very, very beneficial for you as a network administrator or engineer. Now, the Juniper platform happens to be one of the very best platforms for network automation out there. In fact, these features such as a rolling turnback configurations is a core functionality of the Junos operating system.

7:41So realistically Junos has been way ahead of the curve of many of these rival networking vendors, such as Cisco, when it comes to being automation friendly. Junos also is able to give us structured data directly from the device itself, which makes it extremely powerful when you want to introduce programmatic logic. Now, if you're not familiar with structured data or working with data in a programmatic way, certainly do not worry about that at all right now. Trust me, we're going to get many, many examples of using this type of structured data, and you are definitely going to see the power of this feature.

8:19So, really, there are far too many benefits of network automation to just fit into one single Nugget. Instead, the benefits should be gradually and continually revealing themselves as you progress throughout this course. But as a high level overview, being able to automate your network is going to allow you to manage your networks more securely. With greater stability, you'll be able to deploy changes faster. And it's going to really help you collaborate with the other members of your team in pushing out complex network configurations.

8:51So all of this sounds quite exciting, indeed it is. So how about we began building our environments so that we can begin practicing and testing all of these techniques? So the very first thing that we have to talk about is the concept of virtualization. And, well, that's what we're talking about in the very next Nugget. So I hope this has been informative for you, and I'd like to thank you for viewing.

Virtualisation

0:00[AUDIO LOGO] Hey, everyone, and welcome back. Now, in the previous Nugget, we talked about the general benefits of network automation. Now, in order to begin learning these concepts, what we want to be able to do is to build a particular lab environment. Now, this lab environment is going to require that we employ virtualization.

0:33So realistically, we want to be able to test our automated configurations against virtual devices. And these virtual devices are ultimately going to be living within a virtual machine, at least in the setup that I'm going to recommend. So in order to be able to run virtual machines, we need to actually have some type of virtualization technology that is going to allow us to do just that. Now, we do have a few options available to us that we can use. One option is VirtualBox by Oracle.

1:04Now, I have used VirtualBox before. But it is, at least in my opinion, not quite as good for our use case as VMware. But again, this is just my own personal preference. But I'm going to recommend to you that you happen to utilize VMware. So this exactly what I'm going to search for right now. So if you happen to search for VMware, we're going to see some different options here available to us. If you happen to be utilizing an Apple Mac computer, the version you would want to get would be Fusion.

1:34Fusion is VMware's solution for that platform, whereas if you happen to be using Linux or Windows, we want to be utilizing the Workstation. Now, the Workstation Pro happens to be the more advanced product. It has a few more additional features. However, this happens to be a paid solution. You're going to have to buy a subscription to be able to access and use this software. Instead, what I'm going to recommend you do, if you would rather not pay for the virtualization solution, is to download Workstation Player if you're on Windows or Linux.

2:09All we would do here is if I click this link here, we can see indeed this is for your Windows machine or your Linux PC. And that is a free download. So if you just click this link here-- and let me just zoom in a little bit. If you Go to Downloads right here-- and then depending if you happen to be on Windows, you would select this option here. And if you happen to be on Linux, you would select this option right here. Now, I already have VMware installed on my Windows machine right now.

2:39But again, if you don't, just click Download. And the download should begin. Now, to install VMware, you simply open up the program. And just follow the installation prompts. But like I say, I have VMware up and running. So I will just stop this right now. Now, once we have VMware, we want to have some type of software that is going to allow us to build network topologies in a virtual machine. Now, again, we do have different options available to us. We have something called GNS3. This is a great solution for network emulation but also is a new solution out on the horizon called Containerlab.

3:16However, this is driven towards container images as opposed to virtual images. And whilst it is probably the best solution when you want to quickly spin up automated labs, I think the easiest to use, thus the lowest barrier of entry for us, is to use the very good software known as EVE-NG. So let us get that download then. So what I will do is go back to Google. And if you just search for EVE-NG, click the top link here. Now, again, EVE-NG has a paid version as well as a free version.

3:49The paid version is the Professional Edition. This, as you would expect, gets you some extra features. But honestly, they are not necessarily for our purposes right here. So if you want to go ahead and get the Professional Edition absolutely, that is your choice. But I'm just going to recommend for our purposes that the Community Edition, which is the free version, is all we need. So if I go up to Download here at the very top of the screen-- let me just zoom in so you see it better-- click this here. Now we can see all of these options. I'm going to choose Free EVE Community Edition.

4:21You can install the ISO file. But to make things as easy as possible, I'm going to recommend you choose the OVF file. Now, we have two different sources whereby we can install this image. We can get it from the MEGA mirror or the Google mirror. So either one which you happen to choose, whatever happens to be fastest is A-OK. Let me just click on, say, for example, the Google mirror. So it says here, this is too large for Google to scan for viruses. I'm going to elect to just download this anyways. So if I click this here, now the download is going to progress.

4:55Now, this happens to be a zipped file. So once this download completes, what you'll want to do is to unzip this and extract the contents of this particular file. And again, I have already done so. So if I just stop this right here-- and here is the compressed file right here. Once I extract it, I have this folder. I can go in here and again click in. This particular file here, this open virtualization format package, this is the file that we want to use with VMware. OK, great. So assuming you have followed the prompt for VMware, once you open it up, you should see this type of interface.

5:33Now, I already have an EVE-NG machine created for my labbing purposes. But I actually will walk through the creation of a new one. So what I will do here is I'm just going to open a virtual machine. I'll click Open here. And I will go in the same directory. And I will get this OVF file. So I'll click this here and choose Open. So now what I need to do is to give a name for my virtual machine. So I'll just call this NEWEVETEST. And now you can specify whereabouts you actually want to store this particular virtual machine.

6:05So I will just leave at the default settings. And choose Import. This is going to import this virtual machine right here. And just give this a little bit of time. OK, so now the virtual machine has been imported. What I will now do is select Edit virtual machine settings. And if you want to allocate more memory to this particular virtual machine, if you happen to be running larger labs, all you can do here is just scroll this up and down as you need. Now we'll just leave it at around 8 gig.

6:36That is enough for right now. And I'm going to leave my network adapter at the bridged connection. So if I just say, OK, now I just click Play to play the virtual machine. The virtual machine shall begin loading up. And we're going to have to do some very basic configurations to get our machine up and running. OK, so I'm now presented with a login screen. I'm going to say the login is the word root. And the password is the word eve-- e-v-e in lowercase letters. Hit Enter. Now we're going to have to type the root password again.

7:07I'll just say eve. Hit Enter. And repeat it. Hit Enter. I will just leave the hostname as eve-ng. Just hit Return. And I will do Return again. And I want to have a DHCP connection. So I'll just hit Return again. Do I have an NTP server? I'm just going to leave that blank. Return home again. And I'm going to have a direct connection. So just Return again. And now the machine should begin loading. So just give this maybe a minute or two. Now this is giving me the IP address of 192.168.4.58.

7:38This is going to be the address that I use for this virtual machine. But very, very likely, you're going to have a different IP address depending on your VMware adapter subnet. My VMware adapter subnet 192.168.4.0/24, hence why the eve machine has a host address within this range. So again, if I log in to the machine, I will say root as the login. And the password again is eve. Hit Enter. So I've now logged in to the machine. What I now want to do is to browse to that IP address in my web browser.

8:12So I will type 192.168.4.58, which is my IP address. If I hit Enter, this is going to take me to the sign-in page for the EVE-NG virtual machine. So now the username here is no longer root. The username to log in to the web page here is actually admin. But the password is still eve-- so E-V-E. Then if I sign in, I will just say don't save. If I click Add new Lab here, I'll just give it a name. Let's just call this lab1.

8:42And then save. Suddenly, we now have this interface for EVE-NG where we can actually build a network topologies. But before we actually build on network topologies, we need to have particular images, these virtual images, of the network operating systems that we want to use. So how are we going to get these virtual images? Well, that's what we're talking about in the very next Nugget. So I hope this has been informative for you, and I'd like to thank you for viewing.

Juniper Images

0:00[AUDIO LOGO] Hey, everyone, and welcome back. Now, in the previous Nugget, we set up VMware. And within VMware, we created an EVE-NG virtual machine. Now that virtual machine is up and running right now. However, we do need to load in particular virtual images so that we can create our virtual network topologies.

0:33So the first thing that I want to do is to try to download these Juniper images. So if you happen to search for Juniper download, this top link right here should take you to where we want to go. Now the very first thing that you're going to have to do is to create a user account. So what you should do here is go to Accounts. If you have not already got an account, select User Registration. And from this point on, you're going to have to type in your email address, whatever it may be. So type in our email address you happen to have.

1:03This is not actually my email address, but you get the draft. Type in whatever yours happens to be. And then just re-enter the email address. If you click Submit, you are going to get an email sent to that particular email address. And within that email, you're going to have to click a particular link. Now once you happen to collect the link within this email, you're going to be presented with this particular page. And you can begin filling out these forms. So my country right here would be in the United Kingdom. I would select this.

1:34Now if you happen to have access to a real Juniper device, one that you have bought, then what you can actually do is use the product serial number from that device, and that can get you access to download the particular images. If you do not have a Juniper device, what you could do is request evaluation user access. Well, it's basically going to give you access to Juniper images for a 60-day evaluation trial. So whichever one you happen to choose you can do that. In this case here, I will just say evaluation user.

2:05I will select that I am not a robot and then choose Next. Now the reality is after you do such a thing that is a little bit of a waiting game. You're going to have to wait for Juniper support to respond to you and ultimately authorized the creation of your account and the ability for you to be able to access these images. Now once you have access to these particular images, all you want to do is to search for EVE-NG Juniper and say, for example, click this link here for the vMX. And all you want to do is to walk through all of these instructions exactly as they are detailed on the EVE-NG machine.

2:41This is going to allow you to copy those images into the EVE-NG machine, and you will then have access to these particular devices. If you scroll on down, we can see the process for vMX. Although, else you can have the vQFX, all the instructions you need. We can see the Juniper firewalls here also. Again, click this. Follow all of the instructions. So once you have that done, you should have access to Juniper devices within EVE-NG. The next thing we have to look at is how we can actually begin building our development environment to be able to begin automating these devices.

3:15And well, that's what we're talking about in the very next Nugget. So I hope this has been informative for you, and I'd like to thank you for viewing.

Linux Installation

0:00[AUDIO LOGO] Hey, everyone, and welcome back. So previously, we learned how we could spin up EVE-NG within VMware. And we also talked about adding particular network images to that VM. So we have the possibility to virtualize network topologies. Now what we want to focus in on is our network automation control node.

0:35This is going to be the node in the network that connects to all the devices that we're trying to manage. And this node is going to be equipped with all of the development tools that we need to write and manage our automation system. Now, just to be clear, you can absolutely develop on many different platforms. You can develop on Windows. You can develop on Mac. But I really would have to recommend that you look at a Linux solution, because so much of the open-source technology aimed towards network automation has been designed with Linux in mind.

1:08That's just going to make everything a much smoother experience. So for that reason, I'm going to suggest that you also create a new virtual machine within VMware of a Linux instance. Now, my recommendation happens to be Ubuntu because Ubuntu is very user friendly. It's very well maintained. And it is very, very stable. So with that said, how about we walk through the installation of Ubuntu? So if you happen to search for Ubuntu, what we're going to do is to click this top link right here.

1:41And we will just accept all. So what I'm going to do is to go to the Download option here. And to make things as easy as possible to manage, we will elect to download an Ubuntu Desktop. So let's click this right here. Now, we have different options available with Ubuntu. We can download the latest release. But the one I'm going to suggest to you is one with long-term support. So you should see LTS next to whatever version you download. And of course, if you're watching this and the future, the actual version number here may very well be completely different by that point.

2:14But like I say, go for the LTS. That is going to be the stable version. So what I will do here is choose Download. So like I say, this should begin downloading this ISO image. And once that is done, we can begin installing this image using VMware. OK, so now that I have downloaded this ISO image, what I now want to do is to go back to VMware. And this time, I'm going to choose Create a New Virtual Machine-- so a little bit different this time. Then I'm going to choose the installer disk, the ISO file.

2:46So I'm just going to browse to the location where this ISO image happens to be saved. So I will go into this directory, where I have saved this file. Let's open this up. And as we can see here, VMware has detected the particular operating system. And it's going to go through an easy install, which just makes our life much, much easier. So I'll just say Next. Now, I'll give the full name ipvzero. I'll have the username also as ipvzero. I will create a password for this particular machine. And I will then say Next.

3:17I'll give the machine a name. Let's just call this Ubuntu. You can change the location of where you want to save this machine. Again, I will leave it and the default directory. Let's choose Next. And now we have to specify the hard disk capacity. How big do you want this machine to be? I will just have it at 20 gig. And say Next. And I will then say Finish. I will then go on to the Customize Hardware. And I will also make the network adapter the same configuration that I have for EVE-NG. So I'll select a bridge.

3:48Then I'll choose Close. We can see the setting has changed. And then Finish. So now the VM is going to boot up. And we'll just have to be patient and do some waiting here. Now we're going to have to walk through some basic configuration, selecting your keyboard layout. In my case, I am in the United Kingdom. So I will select English UK. And then I will choose Continue. But of course, choose the settings that are applicable to you. And I will just go for a normal installation. Click Continue. I will say Erase disk and install Ubuntu.

4:19And click Install Now. I will say Continue. Now I'll select my location. I happen to be in the UK for my timezone. Then click Continue. Now I'll specify my name. So I will say ipvzero, if I can type that correctly, and the computer name. I'll just leave it as ipvzero. Same for the username. And I will choose my password. OK, so now I will click Continue. So this may take a few minutes, depending on how fast your computer is. Again, just be patient. So now the installation is complete. What we're going to do is to click Restart Now to restart the virtual machine.

4:53So the VM will restart. Just give it a moment to do so. So now I will click on my username and type in my password that I created. And hit Enter. And now I will click this bottom left right here. I will type in terminal. So if I do ip addr, it's going to show me all my IP address information. If I do that and pipe for 192, that will filter just for the line 192. And we can actually see my internet address is within the same subnet as my EVE-NG machine-- 192.168.4.0.

5:28And that has a /22 mask. Actually, I believe I said /24 in a previous Nugget. But again, it doesn't actually matter. They are on the same network. That means if I happen to boot up my EVE-NG machine, I will be able to ping between my Ubuntu machine here and the EVE-NG topology, because again, they're on the same network. And lastly, I just want to ping 8.8.8.8 to make sure I have internet connectivity, which I do. So now we have our Ubuntu machine up and running.

6:00It's on the same subnet as our EVE-NG virtual machine. What we now want to do is to begin constructing our development environment. And well, that's what we're doing in the very next Nugget. So I hope this has been informative for you, and I'd like to thank you for viewing.

Creating the Development Environment

0:00[AUDIO LOGO] Hey, everyone, and welcome back. Now, in the previous Nugget, we walked through how we could install Ubuntu, which is a Linux virtual machine, into VMware. Now that we have access to this Linux environment, we want to use it as our development environment where we will write and edit our code, manage configuration files, and more.

0:34Now, we can actually develop directly within this virtual machine itself. But what we want to do is we want to install an integrated development environment. This is really just an environment which is going to make the development process much, much easier, providing new tools and applications to simplify and streamline so much of the programming practices that we are going to be using. So what I'm going to do is I'm going to elect to download a very popular IDE. And that is Visual Studio Code.

1:06Now, Visual Studio Code was developed by Microsoft. But don't think you can only use this on Windows machines. Indeed, you can also use this on Mac as well as on Linux. So what I'm going to do is I'm going to go and open up my browser. And I'm going to search for vs code. So if I click this link here-- and let me just full-screen this. Now, depending on the platform which you're using, you want to download whatever version suits your needs. So right now in this example here, I happen to be utilizing a Windows machine.

1:38So because of that, I'm going to select the Windows download. So let me just click this link right here. We can see the executable package is downloading. OK, so once that has downloaded, let's just click this link here to begin the installation. And let me just minimize this page here and minimize this. So you want to read the terms, of course. Never skip that part. And we want to accept the agreement. So click Next. Now we want to specify whereabouts are we going to install Visual Studio Code. So I will just choose Next.

2:09And again Next. Now, if you want to do things such as create a desktop icon, you can do so. But for now, I'll just leave things as they are and choose Next. And then finally, I will select Install. So now the installation is going to happen. Just give this a little moment. Perfect. So I'm going to make sure Launch Visual Studio Code is ticked. And then click Finish. Now, VS Code is automatically remembering some of my settings. So my output might look a little bit different than yours. But don't worry about that.

2:39What we now want to do is to begin to install some extensions. These extensions are going to provide to you additional functionality to make our lives easier. So what I'm going to do is I'm going to go to File. And then I will go to Preferences. And then I will go up to extensions. We can see here, I already have a bunch of extensions which VS Code is remembering. And the first one here that I want to suggest to you is this one here-- Remote SSH. So just search this in the search bar. Click Remote SSH.

3:11Now, as it transpires, mine is already installed. Let me just temporarily uninstall it. So this is pretty much how it shall appear to you. You will have this button to install this particular extension. And if you do so, by clicking it, it will install. And now Remote SSH has been downloaded. So here is the deal. With Remote SSH, it means that I can open up Visual Studio Code within my regular Windows environment, or whatever I happen to be.

3:41And I can remotely log in to this Ubuntu server. And I can use Visual Studio Code with all of my extensions that I have installed in my system and have those available within that Linux Ubuntu virtual machine. Now, before we can actually utilize this extension, we're going to have to install the SSH server daemon within our virtual machine. So check this out. We'll go back to the VM. Let me just type clear to clear the screen. I'm going to take the command sudo apt update, and hit Enter.

4:13I will type in my administrator password. So just give us a moment. Perfect. And now I'm going to say sudo apt install openssh-server. And then Enter. Again, I will say y. Hit Enter again. And this will began installing the OpenSSH server. So this server here is going to be capable of accepting SSH requests. So now we have SSH installed. Let's go back to VS Code. And what I'm going to do is I'm going to hold the Function key and press F1.

4:46Now, this is going to show me a list of things which I can use. At the very top, we can say Remote SSH because I happen to have recently used this in a previous installation. But if you can't find it, just begin typing remote, and then I will do a colon and then begin typing connect. And we can see this option here-- Remote SSH, Connect to Host. This is the one we want. So I will select this. Now what I have to do is to type in the IP address of the target. Now, if we go back and I type in ip addr, I can actually see my IP address here as 192.168.4.59 on the server.

5:22So let's type in that address here. I'll say 192.168.4.49. Hit Enter. A new window is going to open up, as we can see. Let's minimize this. It's now asking me to identify the platform of this host. It's going to be a Linux machine. And now it's telling me the SSH fingerprint. So do I want to continue? I will say, yes, Continue. And now I have to type in the password for this particular VM. And actually, before I do anything, I've just noticed a little problem. Notice what it's actually trying to log in with.

5:52It's trying to log in with my VS Code credentials. That is johnm. See that johnm? This is not what we actually want, because the user name johnm doesn't actually exist on my virtual machine. So that's a little gotcha. So in fact, what I will do is I will press Escape to cancel this. I will say Close Remote. And we'll go back again. So I'll press function F1 again. And I will say Connect to Host. Now, what I'm going to say here is I'm going to say ssh ipvzero because that is the username that is on the device.

6:25And now I will type in the address 4.59. If I hit Enter now, it's going to open up this connection. Let's full-screen this one. We can now see the prompt as ipvzero, which is exactly what we want. Now I'll type in the ipvzero password that I created on the Linux machine. Hit Enter. And now we should be logged in to that server. So if I click Terminal here and select New Terminal, notice here we actually are in the Linux machine. So if I just minimize this and pull this up, we actually have a command line directly within this box.

6:59So if I did maybe, say, mkdir and said TESTFOLDER, if I minimize this VS Code and I go back to my virtual machine-- let's clear this and do an ls-- look at this. The TESTFOLDER has been created within the virtual machine directly from my Windows machine using VS Code. So that means if I happen to create a new file-- let's call this one file.txt. Do an ls. We now have this file. If I then go to File here and then Open File, check this out. If I scroll on down, I can see that file within the options.

7:31Select it. And then I can choose Open. So if I want to write some particular code or just maybe modify a configuration file, I can now do it within the VS Code editor. And all the changes I make, such as "Some changes"-- and I will just save the file. If I now go back, do an ls on the machine, and I cat the file to open it, notice anything I take within editor appears within the VM. So now that we have VS Code up and running, what we want to do is to ensure that we have Python installed within the system.

8:04Now, within our installation, Python should already be installed. We can check this by saying, python3 --version. And notice we can do this directly within VS Code, of course. And if we hit Enter, we can see that we already have Python installed. Indeed, we have Python version 3.10. And with Python being installed, what I now want to do it is to go to File, Preferences, and Extensions again. And this time, within the extension, I'm going to search for Python. And we can see this option here. Let's click this-- Python. This is going to give us IntelliSense, meaning that any Python files we happen to edit and modify, we're going to get things such as autocompletion and suggestions.

8:43So notice here, it says, Install in SSH plus the IP address of the target. This is where I want to install the Python extension. So if I just click this here, just give it a moment, and now the extension has been installed. So what I can do here is just close this over. And if I create a file called maybe testfile.py and I open this up, VS Code is going to notice the .PY extension and deduce that this is a Python file. And when I begin typing, we're going to get autocompletion plus all these different suggestions.

9:14So let's maybe say, from. And look at this. See all these Python suggestions? And if I say, j, we can see all the other suggestions-- S-O-N. And whenever I get a suggestion I like, I can just press Tab to complete that suggestion. So this, like I say, is going to make the development of our Python programs much, much easier than just trying to develop in a regular text editor. So that is the basic setup of our development environment. Indeed, we are going to be adding to this environment continually as we progress throughout this course.

9:45But for now, those are the basics that we need to have to get up and running. So I hope this has been informative for you, and I'd like to thank you for viewing.

Creating a Juniper Lab

0:00[MUSIC PLAYING] Hey, everyone and welcome back. So now what I want to do is I want to walk you through the basic setup for our Juniper lab. Now that we have EVE-NG up and running with our Ubuntu system and we now should have our Juniper devices accessible to us. So what I'm going to do here is I'm going to right click.

0:31And I'm going to select nodes. Now if I happen to search for vMX, I'm actually going to see here two different devices. Now that actually ties in to how Juniper operating systems work. So depending on the type of image that you have, if you happen to have an older image, then you will be dealing with just one device. However, in more recent releases of Junos, the device is actually subdivided into two separate devices. We have this VCP and the VFP.

1:05Now the VCP is all about the control plane. This is effectively the reporting engine. This is a device that is responsible for your routing protocol, configurations, your IP address configurations, all the type of config that you would put in to your device is going to be entered into the written configuration. The actual forwarding of the packets is going to go through the VFP. So the actual configuration, if you're coming from maybe say a Cisco world, might be a little bit confusing to you first.

1:38But rest assured if you happen to have one of these newer devices, we are going to have to add both devices and connect them together. So that they eventually act like one big block. So I will select VCP first. And I will go down and click Save. Here is my routing engine. Now I'm going to connect the VFP, the forwarding device. This is going to have 12 ethernets, as we can see here. And I'm going to click Save. Now these devices have to be connected to one another.

2:10So all I'm going to do is I'm going to hover my mouse over the device. And I'm going to drag and pull this little link into the next. Now the interfaces that we actually want to connect these devices with as the one which says int, you see this one here? em1/int, the int has the internal connection for the device. So, again, int to int, we see here. If I say Save, these two devices are now connected via an internal components.

2:40And effectively, they just aren't legal one device, if you so wish. But we're going to have two separate this out. Now like I say, our configurations are going to be targeted on the routing engine itself. Yeah, that's the thing. We don't just want to connect to any old interface within this device. Instead we want to configure what is called a management interface. So realistically what we're talking about here is out of band management. And this is a very basic concept within network automation.

3:11The reality is we don't want to be connecting on an interface that is participating in our general networking. So let's imagine we have a device here and a device here and let's maybe say a device here. OK, so they're all connected to each other. Now if we happen to be managing this device from way over here and I connect into one of my devices. And let's say I wanted to from this vantage point manage this device up here. Well, if I actually traverse the network, I can actually reach this device here.

3:46However, if I happen to push out some automated change, maybe the configurations on this device somehow breaks the connection between this device here. Now think about it, if this device here goes down, I can no longer access this device or this device. I'm effectively locked out of absolutely everything. And that could be the result of a configuration change that we're making to our network. Instead, what we want to have is a direct connection to all of our devices within the network on a subnet that is not actually participating actively within the network.

4:20It's going to be within what is called its own VRF. That is its own virtual routing table. So it's not actually going to affect anything within the network itself. Now, depending on the image that you happen to have, you may happen to have different management interfaces. In my case here with the images I am using, let me show you the interface that I'm going to use. Now one thing to note as well is that to actually connect N to this topology, I'm going to right click and I'm going to select a network.

4:51Now the network type here is going to be a Management Cloud zero. And if I click Save, this little cloud here-- and let me just Zoom in a little bit-- this little cloud here, you can imagine this as a gateway out of the virtual machine to my regular network. So from this vantage point, I can connect into my EVE-NG topology. So that means I could use my VS codes from my Ubuntu to server and talk to the devices within this topology. Now in order for that to happen, I'm going to have to connect that end to the node that I want to manage. I'll just drag this here into the routing engine.

5:23Now, see this interface here, em0/fxp0, this is the management interface for this particular device. So it's going to be its own separate management interface. It's not going to be participating in the actual networking when I'm connecting to other devices in the topology, this interface is just to connect to the management station alone. So that it can be managed remotely. But if I click Save here, I have now got my Juniper device. Like I said, it's two devices joined together as a one device.

5:56And this logical one device is connected to the monitoring cloud, which effectively allows me to reach in from VS Code and talk to this particular device here. But before I do such a thing, I'm going to have to run through some basic configurations. So what I'm going to do first is I'm going to go to More Actions, and I will start all nodes. That is going to start up these devices. And depending on how powerful your machine happens to be, this may take five minutes, 10 minutes, 20 minutes.

6:28Sometimes these devices can be pretty heavy weight and take a little bit of time to start up. So what I'm going to do is I'm going to pause the video and come back when the device is running. So what I will do in the meantime is I will just click on the routing engine, which should open up a terminal to that device. And as we can see here, the device is still booting up. OK. So after what felt like an eternity, the device has finally booted up. And the first thing I'm going to do is I'm going to log in as the root user. Now what I want to do is I want to go into the Junos CLI.

6:59And I'm going to type CLI. Now you will notice right now that a lot of stuff is going to begin flying up on my screen. We're going to have this auto image, DHCP client request, as well as a whole bunch of syslog messages as we can see right there. Now this can be quite challenging because they really interrupt you as you try to navigate the CLI. If you want to turn these features off right now, the very first thing that I'm going to have to do is I'm going to have to set a route authentication password.

7:30And then after that, I'm going to be able to commit some changes to the system, changes which can stop this behavior. Now because of this continual flood of data going down my screen just to make it a little bit easier to see what I'm actually typing, I'm going to type it into Notepad and then I'll paste it in. So the first thing I will do is I go into Edit mode here. And once I'm in Edit mode. I'm going to take this particular command. So I'm going to say set system-- but let me just Zoom in a little bit-- set system root-authentication plain-text password.

8:04Now plaintext password is a bit of a misnomer because Junos is actually going to encrypt this password. But nevertheless, this is what we'll do. And then after this, we're going to be prompted to type in or password. And the password I'm going to use is going to be Juniper one with a capital J. The first thing I will do here is I will copy this command. Go to the command line. I'll paste it in. Hit Enter. Type in the password, Juniper1 and I'll confirm it. OK. So right now, we have the authentication password. But as we can see, the terminal is still being interrupted with these particular messages.

8:38So the next command that I am going to configure, it's going to be delete chassis auto-image-upgrades. That should stop the DHCP requests, then I'll have this right here. And I will commit to the change. Committing the change is a really just saving the change. So that it actually takes effect in the configuration. We'll get to see much more of this when we talk about actually automating our networks. Now the next command I'm going to see is going to be deactivate system syslog user and then start.

9:10I will copy this here and I'll paste it in. And then commit this. OK. Great. So now what we want to do is we want to create a user accounts, set up SSH, and do some basic IP addressing. So like I say, if we happen to go to the topology here, the interface that I'm going to modify is going to be this one here, the fxp0. And depending on the image you happen to have, this management interface may be a little bit different. But for me it's going to be this. Now the first thing I will do here is whilst I'm in edit mode, if I take the command show, it's actually going to show me all of my configurations right now.

9:47And if we happen to go down to interfaces, we see that the management interface fxp0 actually is configured for DHCP. So before we actually give this interface a particular IP address, we want to remove this DHCP configuration. So that is something we're going to have to address. Now just before that, let's begin setting up these user credentials. OK. So whilst I'm in edit mode, I'm going to say edit system login. And now I'm going to set a user.

10:17So I'll say set user. And I'll give the user name John. And the class of the user, this is basically going to denote my privilege levels. And I'm going to say superuser which is basically admin rights. And then I'm going to say set user John full-name. And I'll just do the full name as John McGovern. And hit Enter. I'll then say set user John authentication plain-text-password, we'll just do Juniper1 again with the capital J. And then I will commit to these changes.

10:49So let's to go back to the root of the tree. I'm going to say top that takes me from edit system log in back to edit mode. Now what I'm going to do is I'm going to say set system services SSH to configure SSH and I will come at this. Now we're going to generate some SSH keys. There we go. Now what I'm going to do is I'm going to configure that interface. But remember like I say, if I do show interfaces, we can see here we have DHCP configured. So what I'm going to do is I'm going to go into this particular interface by saying edit interfaces fxp0 and hit Enter.

11:28And I'm just going to say delete unit 0 family inet dhcp and then commit these. So now if I say sure we no longer have any configurations within the fxp0. What I'm now going to do is I'm going to set the management IP address, the out-of-band address. Now as it transpires, as we know, my particular subnets for my VMware adapter is 192.168.0/22. So I want to use an address within this particular range just to make things a little bit easier for me.

12:02So what I'm going to do here is I'm going to say set unit 0, which has the logical units. I will say family inet and the address here is going to be 192.168.4. and let's maybe say, oh, I don't know, 123. And we'll do it with a /22 mask. And I'm going to commit these changes. So now if I go back to the top of the tree, I'll exit back out to go into operational mode. Now I'll try to ping this interface by saying ping 192.168.4.123.

12:36And we can ping this interface from our device. Now what we want to do is to go to our VS Code and try to ping this interface because again, we should be able to reach VS Code via the management close interface. So I open up VS Code. Once again, I will say ping 192.168.4.123. And we can see we can actually ping this device. Let's stop this. And lastly, what I want to do is to check that I have SSH connectivity. So we'll see SSH and the user name I created was John.

13:07And I'm going to give the address 192.168.4.123 and hit Enter. I'm going to say yes to accept the key. And now I'm going to type in the password Juniper1 with a capital J. If I hit Enter, now we can see here we have remote access to our Juniper device whereby we can edit and as you show commands, whatever it may be. And because we now have SSH connectivity to our devices, we are able to utilize particular Python libraries to automate these devices.

13:40That really is all for the basic setup of our Juniper network automation. What comes next and the upcoming skills really is the good stuff. That is going to be all about writing scripts, changing configurations, pulling show commands, editing configuration files, all of that and more will certainly be covered. For now, that is for our introduction into Juniper network automation. I hope this has been informative for you. And I'd like to thank you for viewing.

Frequently asked questions

What does the Create a Juniper Automation Lab lesson cover?

This 55-minute lesson walks a team member through building the lab and development environment used for Juniper network automation. It covers deploying EVE-NG in VMware from the OVF package, adding Juniper device images, installing a Linux VM as the automation control node, connecting VS Code to that node remotely, and configuring the Junos fxp0 management interface and login credentials.

How do you get Juniper device images to use in EVE-NG?

If the team owns a Juniper device, its product serial number can be used to get access to download the images. Without a device, the learner can request evaluation user access, which the trainer explains provides Juniper images for a 60-day evaluation trial before they are added to EVE-NG.

Why use a Linux virtual machine as the network automation control node?

The control node is the machine that connects to all the devices being managed and holds the development tools used to write and run automation. The trainer notes development is possible on Windows or Mac, but the lesson installs a Linux VM in VMware and connects to it from VS Code so files and folders are created directly on the control node.

Why configure the fxp0 management interface for Juniper automation?

Automation targets the routing engine over out-of-band management rather than an interface participating in general network traffic. In the lesson, the learner removes the default DHCP setting on fxp0, assigns it an address, and sets up user login credentials and privilege class so automation tools can reach the device.

How does network automation reduce errors compared to managing Juniper devices over SSH?

The lesson explains that repeatedly typing CLI commands device by device invites human error, and the risk grows as the number of devices scales. Automation applies the same repeatable configuration across many devices concurrently, which shortens change windows and makes changes more stable and predictable.

How does this lesson fit into the Python and Ansible Automation for Juniper Networks course?

It is the first skill in an intermediate course of about 35+ hours, and the environment it builds is extended throughout the later modules. Team Leads can assign lab setup and Python automation first, then Ansible, Nornir, and PyEZ, followed by validation, source-of-truth, observability, and CI/CD topics, ideally for engineers with at least a year of network management experience.

What's next?

Ready to keep going?

For your team

Bring this training to your team

See how CBT Nuggets helps IT teams close skills gaps, hit compliance targets, and prove training ROI.

Book a Demo
Just need Python and Ansible Automation for Juniper Networks?

Learning on your own? Browse individual plans ($49/month, billed annually) →

Not ready to buy?
with no purchase required. Already have an account?
Book a Demo