Ansible For Network Automation - GNS3 Labs - Video 2

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
now welcome to the second video in ansible for Network automation now in the previous video we download and install the gns3 client we created the basic topology with default devices and we imported AC 3725 Dynamix image and created the basic topology alright the next step so we're going to get to in this video include downloading the gns3 vm the vm workstation pro downloading the viral images and the Network automation appliance and then we're going to start installing first with the vm workstation pro we're going to integrate the gns3 vm then we're going to import the viral images and the Network automation appliance and then we're to create a topology and start automating alright let's get to it these are all the downloads we're gonna do I'm gonna have all the links in the description so don't worry about copying or anything like that but we're gonna go do all the downloads at once and then we're going to start installing and configuring so first we ready to get to gns3 vm and i'm out here just at gns3 comm and I'm gonna click on download then download VM for gns3 this link right here and then I'm going to download this one right here for a vm workstation and fusion and one other thing of note is that the version see that it specifies the version here 2.2 10 it has to be the same exact version as we have for the gns3 client alright then in order to find the vm workstation pro download i'm just going to type in vm works they should pro into Google download Auto field for me since I already had that writes and then it takes us to this screen perfect then I'm just gonna click right here on download now because this is 15 v for Windows that's going to start that download all right then in order to download the Network automation appliance we're going to go to just gns3 dot-com and click on marketplace and then on the left hand side here we're going to click on appliances and then we're going to click on network automation it's the one it's the first one here then I'm going to select that for download and then lastly we are gonna go and get the Cisco burl images so here I am in my account for a Cisco Network learning store and you can see my order here and we're just gonna click on this download link right here and in order to find the images we're gonna go to this number 1 right here and click and you can see that you can download a bunch of different stuff in here but for our purposes I am just going to download I'm gonna download this one right here this this one on the bottom that's four zero zero 5e so I'm going to download this image this is going to be our switch image and it's gonna want me to accept which I will do and then I'm gonna click on iOS B and I'm gonna download this one here on the bottom I'm pretty sure all these at work but these are just the ones that I've been using and I know that they work download and accept all right so now all our stuff is downloaded now we're going to get to installing so here I am in my downloads folder the first installation we're gonna do is VM workstation Pro and so I'm just gonna double click on this to get it started alright so after a brief pause it opened up on another window but I've dragged it over so now I'm just gonna pretty much do a next next next next install here and just go with the defaults alright so it's finally done and then it prompts for a restart because we have that driver in there and I'm gonna say yes and restart my computer now alright so I'm just putting this slide in here after the fact because I forgot to talk about it as I was installing VMware station but the VTX must be enabled in the BIOS of your PC and this is a piece of it you're probably have to go and figure out for yourself since it's different for every single computer but if you don't have it enabled you're gonna get error messages and you won't be able to go any further if you don't figure it out I have rebooted my computer and now I am going to click on continue here to start the 30-day trial finish that's before we can integrate the VM we have to unpack this or extract rather so there that is okay all right so before we integrate this gns3 VM one thing that I wanted to note that I have found to be important is that before you even install the VM workstation Pro I forgot to mention this is that you want to make sure that you have your gns3 client turned off before you install VMware station program before you integrate the gns3 vm alright and to integrate the gns3 vm we will have to click on file and open select the gns3 vm click open leave that name the same and let it import all right the next step is going to be powering this on okay now I'm starting back up gns3 here alright so now we have gns3 powered on we've got the workstation powered up we've got the the blue background and that's looking the way we want it to look and now the next goal is going to be to get both of these turned on green here and so in order to fully integrate the gns3 VM into the clients we go up to edit preferences and then we select gns3 VM we're going to click enable this is already selected but you want to select a VM VMware Workstation and then this also has to it has to pick this up and you want to see the gns3 VM it's going to be the name of the VM so then we're specifying the port the RAM and the V CPUs so the amount of resources that you put here is just going to be completely dependent on what you have on your computer I have 64 gigs of ram so I'm putting basically 24 gigs to this server and I'm going to give it 4 V CPUs hit apply ok create a new project all right so I didn't run into an issue a date you might run into as well so after going in and changing the settings here to integrate the gns3 VM it did not come up immediately I restarted the gns3 program along with the vm workstation program and i wasn't able to get both lights to turn green until I fully rebooted my PC then everyone enjoyed this a few times especially if you keep your workstation on like all day or whatever if you're going to be using a lot of gns3 it's probably going to increase the amount of times that you reboot your computer all right so our next step is going to be importing the viral images just go up to file and this is the method that I've been doing select + new template right here install the appliance on the gns3 server and that would be a pose to using it on the client which you have to put it on the server just make sure you're always using the Quay mu emulator ones that's what the viral image is use so we'll do the router first here so I'm gonna click on that one and then hit install install on the gns3 VM next next ok so for the startup config you can highlight this one just like this and then hit download which is going to open up a link to SourceForge where it starts downloading alright so now we have that startup config right here in our folder and since now it's there we can hit import alright so here it is so I'm going to just open that and I think this is the one that we're going to be importing and since we already have this downloaded we're just going to hit import and you select that one and so in order to install this one I'm just gonna click on it since it's ready to install and click Next yes finish it has been imported successfully okay and then we can see it is now a menu item there we're gonna do the same thing for our switch image go to switches it's a little arrow i OS VL to install on the gns3 yes next alright so i had previously imported the image right so i had to go and hit import and then select that image and import it so now it's ready to go so I'll click on that right there next yes finish alright now we can see that we have our switch image there as well alright the next step is going to be importing the Network automation appliance in order to do that we're gonna use pretty much the same method I'm gonna go up to file select new template and then I'm gonna open up the guests category and I'm gonna scroll down to where it says Network automation there's two of them one says custom I'm going to select the one that is not custom I want to click install install the appliance on the gns3 VM alright now we will check to see if it's there and you can see that the Network automation device is there alright and now we are ready to build a topology and start automating alright so I'm just throwing this slide in here so that I'm able to speed up the installation video so that this video isn't too long alright so the first thing that I did is I drag on the Network automation appliance I drag on one of the 37:25 routers then I pull on two of the iOS B routers and then you'll see me change the name change the symbol and duplicate the device change in the name is done by double clicking on the name itself and then it allows you to change the name to what you want it to changing the symbol is done by right-clicking on the symbol and then you can drag down about halfway down on the drop down menu and then it allows you to select from one of the other symbols well then you duplicate a device also by right-clicking on it and then there's just an op an option to duplicate the device it can be quicker to do it that way if you're going to make a bunch of the same type of device and then I drag on the default Ethernet switch on nothing needs to be configured on the Ethernet switch it's just the main central device of this Euler lab that everything connects to then I pull on a gnat cloud which will allow us to give DHCP to the network Automation appliance and then I pull on two of the iOS V layer 2 switches yeah and then I use the connector tool to connect everything to the Ethernet switch and then I power everything on oh and one last thing most of the devices when you drag and drop them on to the topology and gns3 it's going to ask you whether or not you want to put the device on the gns3 vm or if you're gonna want to run it on the client universally for every time that it asked me I'm gonna be putting it on to the M okay so we're just going to get to it and start building the topology so I'm looking by the way clicking on this button right here will allow you to see all of the devices that you have whereas this would just be routers which is your PC nat cloud type devices that's for firewalls which we have none [Music] and then next we're going to open up the console this this button right up here by my cursor is how you open up the consoles for all devices at once by the way all right now let me have that completed the next thing I'm gonna do is we are going to get an IP address on our network automation device and the way that we do that is by executing this command that I have highlighted right here so nano Etsy network and interfaces so I'm just going to paste that into my network automation command line and then what we do for your cursor down here and delete that out and delete that out pound simple is what tells the server that is just a comment and some when you delete the pound symbol that's what activates these commands so this basically just tells it to give the Ethernet zero interface an IP address with DHCP and then I'm gonna hit control X to exit out and save so then it asked me if I want to save and I hit Y for yes and then it is asking me if this is the place that I want to save it or if I want it to be a different folder I could specify a different folder but I'm just gonna hit enter another way that you check to see what the IP addresses are on the server is with the command ifconfig which is short for interface config alright and you can see here that we do not have an ipv4 address that we can use yet ok so in order to force it to get an IP address from DHCP what we're going to do is power the Network automation appliance off then back on [Music] okay so now we can see that it has rebooted back up and we're at the CLI did ifconfig again and we can see that it has pulled an IP address right here okay so now that we know what the network is that the IP address for the Network automation appliance is we're gonna give everything else IP addresses in this range basically so that the management network is very simple and everything's in the same deal and so one thing I forgot to do earlier is this ABC thing is actually going to show you it's gonna put interface labels on all the connections so I'm gonna enable that here too cuz it makes it kind of helpful alright so now we're gonna configure IP addresses on all the other devices alright so if you look at my notepad here I've got this enlarged and pulled up so that you can screenshot this configuration if you're following along and you want to use the exact configuration that I have as you can see I've got the routers in the dot 50 range and then I put the the switches starting in the 60s range alright now that all the devices should have IP addresses in the same subnet I'm going to configure you I'm gonna complete the configuration on the network automation appliance all right so the first thing that we're going to configure is the danceable a config file so there is a default ansible doctor tech file I'm not gonna worry about that too much right now we're just going to create our own ansible config file in the root folder that will override the default one again if you want to screencap this and put that in that's gonna be the easiest way to do it that in like that look at it alright so an important line to make notice here is this inventory equals my host so this is going to reference the host that we are going to be automated which means that we have to create on my host file we're gonna do that same things we're gonna go now my house and create a my host file in the directory this does is it creates groups of devices that we're going to go out and configure you don't have to have these but you don't have to have multiple groups you could just create one and just call it devices or all and then it would just be that one room but this will allow us to have a group of routers that we can specify with this name right here routers if we want to send specific configuration to the routers and then likewise for discussion I'm gonna hit control X again why enter those there and there's one more file that we need to configure and if this is gonna be the Etsy host file so this is gonna be the file where we create the mappings of the IP address host name bring my cursor down beneath what's already in there I stop all this is configured correctly then we should be able to verify this with following command here [Music] okay so there you can see the list of all the hosts that we have which is what we want to see all right and then you can see you can run the same command and verify all of the host names that are in the group routers so we send out a command that's targeted at routers it's going to process the devices in the order that we see here and the same for all if we send out a command up it's going to automate devices it's going to do it in the order that you see here I know also I just got a list of all the verification commands that you're gonna use on the Network automation appliance to verify our configuration here so if you want a screencap to edit or copy down there you go alright so at this point we should have pain connectivity to all of the devices so we're gonna ping by hostname this will test that the host name to IP address resolution is working within the server and if we have connectivity to with the devices all right so we do to our r1 even though there isn't an r1 and I just realize that our Etsy host is off because I had renamed the routers are to through our four so I'm gonna fix that real quick [Music] okay so now our ping should be working our three works switch one two okay so we can ping all by hostname all right and the last thing that we need to configure is is the ssh accessibility to these remote devices so right now I'll just do a test and verify that it's currently not working from the Network automation device we know that we can ping it but if we try an ssh it shouldn't work all right so the connection is refused that is as expected and then I have this configuration right here that I'm just going to copy and paste and put it into all of the routers and switches okay so now it's it's been configured so we should be able to perform the same test and it should work make sure you watch the key of connecting I'm going to type in yes that's asking for the password which is Cisco so the username is Cisco its username and password is Cisco Cisco so I'll just type in Cisco and answer and as you can see right here our to us right now I'm inside our - so I'll hit exit and now we're back to the CLI of the server and just real quick I'm going to test all the rest of these as well you we verify connectivity we verified that we were able to ssh to all of the devices and now we are ready to start automating alright so this video has already turned out to be much longer than I initially thought that would but I did promise you at the beginning that we would complete building a topology and perform automation by the end of it so that's what we're going to do and now what I've got here in my notepad is an ad hoc ansible command so what's an ad hoc command and hoc commands are basically just the operation of performing a single command on a device and it doesn't need a full playbook to do it so I'm going to copy this right here if we were running a playbook this first argument would be ansible playbook but this one is just going to be ansible and then we're going to be running this on the r1 device and then this dash M is an argument for module and the module that we're going to be using is the raw module there is documentation on the raw module on the ansible website but we're not going to go into that right now and then - a allows us to specify an argument which is going to basically be the command that we're going to execute on the on router one which is show version and then this - you means that we're going to be using the username of Cisco and - kay means that it will prompt us for a password when we try and execute it all right so I hit enter now it's prompting us for the SSH password Cisco and then I get the error of course because I forgot that we don't have an r1 there and it's r2 all right so I will just correct that for the password again okay and then all of this yellow output is from the show version command on r2 alright so that concludes this video in this video we were able to install everything integrate and configure everything and we were able to create a topology and start automating now in the next video we're going to fully flesh out the ad hoc commands and we're going to get into ansible playbooks so if you're getting value out of this please consider liking the video and subscribing and I'll see you in the next one [Music] [Music]
Info
Channel: Network Savage
Views: 3,742
Rating: 4.9000001 out of 5
Keywords: ansible for network automation, gns3, ansible network automation, gns3 network automation, gns3 network automation appliance, ansible tutorial, gns3 network automation ansible, gns3 network automation ip address, gns3 network automation lab, ansible, network automation, gns3 network automation docker, gns3 network automation container, network automation in gns3, network automation with gns3 and ansible, network automation with gns3, gns3 labs network automation labs
Id: jJE6s_C1Rt0
Channel Id: undefined
Length: 26min 16sec (1576 seconds)
Published: Tue Jun 30 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.