Okay, Snake, we don't need you.
I don't mind Python as in the programming language, but I don't particularly like snakes.
You can watch this video as an example where I had a encounter with a black mamba in Africa.
When that snake bites you, you've got about 30 minutes to live or 60 minutes, and then you're dead.
So fortunately nothing happened, but it was a very close encounter.
In this video, I'm going to show you how to back up iOS configurations.
I'm going to show you two methods to do that.
The first method is using cron, which is very similar to Cron on Linux.
It basically allows you to schedule things.
So we're going to schedule automated backups of Cisco routers and switches.
You can back up the configurations, you can do other things.
In a previous video, which I've linked here, I showed you how to use TCL scripts to do things, but
you can use Cron to schedule TCL scripts.
The second method is to use archiving.
Both these methods have been available in the Cisco iOS for a while.
I don't need Mr. Python here because we are not going to be using Python.
In other videos, I have shown you how to use Python to backup configuration, so have a look at this
video.
If you're interested in doing that.
I'll also create some updated videos because my Python videos on YouTube are quite old at this point.
But again, Cron has been available in the Cisco iOS for a while.
As you can see here, it's been available since 12.2 on some versions of iOS, so it's been available
for a while.
Archiving provides you with many features.
It's also been available in the Cisco iOS for a while.
So as you can see here, 12 to 12.3.
It's also available in Cisco, ICSI.
Okay, as always, because this is YouTube.
I need to ask you, please subscribe to my YouTube channel.
Please like this video if you find it useful and please click on the bell to get notifications when
I post a new video.
Okay, so I've spoken enough now.
Let's get started.
I'm using a Janus three topology here.
I've got three Cisco routers.
These are just traditional Cisco routers in my example and router two show version.
Notice we're using the iOS version 15.6 to T.
So this is just standard Cisco iOS.
It's not iSCSI.
I've also got a ubuntu server here.
The server is actually the toolbox server available in genius three.
And what's nice about this docker container engine is three is we have tftp.
So if I go to the ftp boot directory.
There are a bunch of files already here, but what I'll do is I'll remove all the files in this directory.
So Liz now shows us that there are no directories in this TFTP boot directory.
No files currently exist in this directory.
But what's nice about this docker container is that it runs a FTP server.
Now if you've got a Windows PC, you could use different FTP servers.
You could use SolarWinds, which is a free FTP server, and I've linked that below.
Or you could use TFTP 32 as an example.
There are multiple or 64 if you prefer.
There are multiple TFTP server options available for free so you don't have to pay for a TFTP server
today.
Okay.
So this ubuntu host has a IP address of ten .1.322.
That's the IP address that we're going to back up configs to.
Now on router two, that's the router here in our topology.
You could do this on multiple routers, but I'll just do this on router two.
I'm going to use the command cron.
So kr0n.
In this example, I need to specify a policy list and an occurrence.
So basically what are we going to do and how often are we going to run the commands?
Okay, so cron, let's say policy list.
Give it a name.
So let's say backup config, whatever name you like.
So just give it some kind of name.
And then what we're going to do is run a CLI command and in this example I'm going to type show run
type redirect to FTP.
And again, you could use CEP or something else if you want.
The Ubuntu host has this IP address once again.
So ten one three, two.
So I'll paste that in.
And give it a name, let's say r to show run cfg.
So that's the file name where we're going to save the configuration.
Okay, cron occurrence.
So give it a name.
Let's say backup every minute, whatever you want to use.
Notice here we have two options in how often are we going to run this?
So in one minute, in my example or at a specific time.
So I'm going to say in one minute we can specify minute or hour, minutes or days, hours and minutes.
So in one minute recurring, what I'm going to do is run the policy list of backup config.
So scrolling up.
That's the policy that we created back up config.
So that's the one that we're going to run.
So end and that's all you need to do really.
So show.
Cron schedule shows us that our backup will run in 38 seconds, 35 seconds, 34 seconds.
Going back onto the TFTP server.
Notice we don't have a configuration on the TFTP server because it's going to run in 23 seconds.
Before that runs, let's do a debug.
So debug cron all so that we can see what's going on.
Show Cron schedule once again.
14 seconds to go.
No config on the TFTP server.
9 seconds 7 seconds.
Sorry about this delay.
I'll speed this up if you like in future.
Now, one of the things I want you to see is notice.
Before it ran it was inactive, but as soon as it ran, it became active.
So it's active while it's running.
And you can see here, this is what happened.
The command was called show run redirect config to the TFTP server.
So that command has run, it'll run again in 56 seconds or 16 seconds in this example.
Notice the config is there.
If I type more are to config.
Notice there is the running configuration of my router.
It's been backed up to the TFTP server.
Now it's actually just run again.
So the config has been backed up once again.
So I could remove this or in this example, let's just move it to our 2v1 config.
So Liz now shows us that we've got the old config here.
When this runs again in 31 seconds, we'll get to the new configuration on the TFTP server.
Now one of the questions people often ask is, okay, how do I get a timestamp and I'll show you that
using the archive method.
Okay, so it's just run list again.
Notice there's our configuration.
So once again more are to see if there's a running configuration backed up to the TFTP server.
Okay.
So that's the first method cron.
You can get this to do many types of things.
They've got some examples on the Cisco website.
You can find a lot of examples of this online as well.
You can get it to run TCL or tickle scripts.
You can get it to do all kinds of things.
It's basically a scheduler, just like you have in Unix or Linux.
Okay, next one is archiving.
Okay.
Archiving allows you to do a lot more than just back up configs.
You can restore configurations, you can have a history of configurations.
Very nice feature available on Cisco iOS.
So in global config mode archive.
What option are we going to use?
We're going to use log config.
So we're going to log our configuration.
And actually you can see here, cron has just run.
So what I'll do actually is turn off the debug so do an all basically disable debugging that's not part
of the archive command.
So just so that doesn't get confusing, I'll do that again.
I typed archive and then I typed a log config pressed enter and now what I'm going to do here is enable
logging.
So logging enable I'm going to hide keys which basically suppresses output e.g. passwords when displaying
logged commands.
We don't particularly want our passwords displayed.
So hide keys.
The next step is exit.
And what we want to do here is specify a path.
Notice the options.
There are many options here.
We could use flash.
So a right to the configurations, to the flash or the router.
We can send it to a TFTP server, we can send it to a secure copy server.
But in our example I'm simply going to use tftp so tftp forward slash forward slash ip address of the
TFTP server is this ten 132
and.
What I'm going to do here is specify a date, so notice dollar H, hyphen or dash.
What I also want to do is back up the configuration whenever the configuration is saved.
So as soon as I save the configuration, I want to write it to the archive.
You can also specify time period now.
Typically you don't want to do it as I'm doing it.
You have one minute you might use a value like this, which is once a week, but in my example, I'm
just going to specify one minute because I want it to back up continuously now to show archive.
This is the most recent configuration so it's actually backed it up a ready to the.
TFTP server show clock.
Notice the date 12 September the time 11 4958 so this got backed up at 232.
That is the most recent configuration and that's what I'm seeing here.
Now clear the screen, Ellis.
L Notice we can see another configuration has been backed up, so we now have two configurations on
the TFTP server.
And if I type show archive on the router notice we can see most recent configuration is there.
Okay.
So let's do that again.
As soon as I type w or so, write my configuration and then type show archive.
Notice an archive was made back on the Ubuntu server.
There's our newest archive show archive.
Right.
The configuration.
Show Archive.
This is the most recent one.
Now back on the TFTP server.
Originally we had two.
Now we've got three and it's actually done another archive because I'm making it archive every minute.
So copy, run, start, save the configuration back on the TFTP server.
Notice we've got another backup of configuration.
Okay.
So that was fairly simple.
I've shown you how to archive the router's configuration and point it to a TFTP path.
It's going to run every minute in my example.
Now that's probably way too much, but just for this demonstration that works.
It's also going to archive the configuration when I save the configuration.
Show Archive.
Notice we can have up to ten displayed on the router.
So what I'll do is I'll simply do a bunch more.
So do another one.
Notice we are at nine as a number here.
Do another one.
Show Archive Notice ten is the most recent.
Notice we lost zero there.
Say that again.
Notice we're at 11.
We lost one.
But those configs still exist on my TFTP server.
So there's the original config.
Notice where all the way to 11.
So these are two great ways to automate the backup of router configurations.
Once again, show run.
I'll use forward slash here to search for archive.
There's our archive configuration and as always, I'll put this below the video and here is the cron
configuration.
Now with KRON.
One thing I forgot to show you is the option.
So I'll just paste that configuration in here.
Notice with KRON you can get it to run at a certain time.
So notice at 11 p.m. sunday reoccurring and the policy that's going to run is this one.
So show run forward slash kron.
I've got it running every minute.
Probably want to remove that.
And then I've got it running every Sunday evening.
The issue here is it's going to overwrite the config on the TFTP server.
Archiving makes this a lot easier.
Very simple configuration to archive your config to a TFTP server or FTP server or secure copy server
every week, every minute, whatever you decide to do.
Okay.
So hopefully you found this video useful.
If you have, please.
Would you like it please?
Would you subscribe to my YouTube channel and please click on the bell to receive notifications when
I upload a new video.