In this video, I'd like to take a look at using HTTP, which
can be used not just for file transfer
but it also can be very useful if we're
interacting with a device through an API
or another protocol that uses HTTP or HTTPS.
So let's go back to our 2911, which is acting as our server.
Let's create an HTTP server from it.
And then we'll demonstrate using file transfers using HTTP.
So that's our plan.
We want to do a few things to help make sure it works.
One is we want to make sure we have connectivity WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
One is we want to make sure we have connectivity
between the server and the client.
We want to enable the server, which we'll do on the 2911
for HTTP.
And we'll also want to make sure we
have room on the system, which we've already
done to make sure it can accommodate the new file.
All right, let's go to the 2911.
And let's get to work.
So here on the 2911, which is going to act as our server,
we'll do a DIR.
And here is the file that we're going to work with.
It's fairly small so it'll be fast copy.
And to make this guy a server, I'll
just go ahead and do a config t IP HTTP space server. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
just go ahead and do a config t IP HTTP space server.
And boom.
Woo hoo.
It's a HTTP server.
We could also do an IP HTTP secure server.
And I was going to mention that if it
doesn't have the keys it needs, it'll go ahead and generate it.
So right now it says SSH has been enabled.
Told us that it just did by enabling secure server.
There weren't keys yet so it did effectively
a crypto key generate and set up a trust point.
So it now has the keys involved in it to support HTTPS.
And we need to do a few more things. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
And we need to do a few more things.
We need to do IP HTTP, authentication local.
And we want to make sure we have a local user name as
well for authentication.
So let's make a user name of Bob and a privilege
level of King Kong and a secret of Cisco exclamation mark 2 3.
All right.
Not a bad idea to create a backdoor.
Don't use that password in production, obviously.
But making sure you have a local user
account with effectively a level 15 rights.
And then at the end of your method lists, WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
And then at the end of your method lists,
like soup tic tac x server groups or radius,
you can fall back to local, which
would be the local database, which would be this user.
OK.
So we have the HTTP server enabled.
We've specified local authentication for HTTP.
We have a user name.
We also need to specify the actual location on the flash
that the HTTP server can serve up.
And to do that it's IP HTTP.
And it is this bad boy right here.
Path.
Set the base path for each HTML.
So if you had a folder where all your files where, WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
So if you had a folder where all your files where,
you point to that.
We're going to do IP HTTP path.
And it's going to put flash colon with a whack.
And that is the root of the file system.
If we do a do DIR, that's where our image is right there.
Image.bin.
So the server can serve it up.
All right.
So now, let's go ahead and go down to our client.
The 10.0.0.2.
So we're just going to telnet over there.
And we'll do a DIR of the file system.
I deleted the image.bin previously. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
I deleted the image.bin previously.
So it's no longer on this local file system.
And now we can do a copy.
Oh, you know what?
Here's the trick.
Let's go to the big screen.
Here's the tricky part.
Because we said authentication local,
it's going to require some authentication.
So we have a couple options.
We have three options here.
We could do copy HTTP flash, and it would prompt us
for the information.
That's one option.
We could embed the username colon password
@ as part of the URL.
That would work.
And we could also do the IP HTTP username, similar to FTP, WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
And we could also do the IP HTTP username, similar to FTP,
that we could then use.
And also the IP HTTP password that would automatically
be passed in.
So I wanted to share with you those three options that we
could use to insert or hand over those credentials for the HTTP
session that we're going to do right now.
All right.
So let's embed it.
Let's embed it.
And that's certainly one--
so I'll just show you the other commands to copy.
Config T, IP HTTP.
IP HTTP client username, and then WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
IP HTTP client username, and then
we put Bob, then IP HTTP client password,
Cisco exclamation mark 23.
So that way, when we do the copy HTTP to flash,
it can use those credentials, in case
we didn't want to put it all in the string.
All right, so let's go ahead and do a copy.
Even though I did that, I still want
to show you the full string because seeing it a few times
with the username colon password and then @ in the IP address,
it's helpful to see that a few times.
So we'll do a copy HTTP colon whack whack.
And I'm going to be a little bit redundant here and put WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
And I'm going to be a little bit redundant here and put
Bob's username again.
Bob colon Cisco 123, or exclamation mark 23.
And then @ and the rest of the URL,
which is 10.0.0.1, the IP address of the server,
flash, and then the file name, image.bin.
Then we'll copy that over to flash.
And it's confirming the destination file name.
And there it goes.
One exclamation mark because the--
if there is a huge file and there's lots of blocks of data, WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
if there is a huge file and there's lots of blocks of data,
you get exclamation marks for every single successful block
of data that was copied.
All right.
And we do a DIR.
And we are good.
Now another thing we can do is if we're
doing web based interaction with this device,
maybe we're using some network automation tools
and we want to connect to this device,
the setting up of the HTTP like we just
did is how we would do it for local authentication.
Also if we're doing HTTPS with a secure server,
we set up that option as well.
So another option to test this, if it was failing we WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
So another option to test this, if it was failing we
could do some debugs.
We could also connect via a browser from a client
to the server at a reachable IP address
to the router one, this one needs to be serviced,
just to verify that HTTPS services are working,
and if-- or HTTP services are working.
And if we're using HTTPS, there's
some really good debugs.
Let me exit out of here.
Do a debug of pH IP HTTP and then there's
just a lot of great options including SSL. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
just a lot of great options including SSL.
So if you're-- based on the default ciphers that are being
used, if there's not an agreement on which ciphers
you're going to use for the SSL session,
that could cause it to fail.
So if you do a debug IP HTTP all and then
you start to try to connect and there's failures,
it can give you error codes and information
about why it's failing instead of just like, huh,
it's not working.
Do I need to use a different encryption set for the SSL?
So the onus might be between the client and the server,
do we need to use a different set of encryption and hashing
algorithms that can be agreed upon? WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
algorithms that can be agreed upon?
So if the client's using one set that
doesn't agree with the sets that are available at the server,
they won't be able to form that SSL session.
All right.
And one other element I want to share with you
here in troubleshooting is far as connections aren't working,
if we're trying to connect via FTP or TFTP
or HTTP or HTTPS is not working, we can also
take a look at the router and say,
what open ports do you have?
Like, if SSH is currently set up,
it should be listening on port 22.
If HTTPS is currently set up, it should
be listening on port 443. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
be listening on port 443.
And the way we can see that is the show control plane post,
and I believe there is an open port.
Yeah, right there.
There's an open ports option.
And that is just going to show, it's
like doing a net state on a Linux box or a Windows box.
And so here is listening on port 22.
Listening on port 23, which is bad news.
Listening on port 80.
It's also listening on port 443 and UDP port
69, which is the TFTP server that we set up
in a previous video.
All right.
So thanks for joining me in this video on setting up
HTTP services and also doing a file transfer via HTTP. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
HTTP services and also doing a file transfer via HTTP.
And in the next video, I'd like to demonstrate
how we can set up an SCP server and then
do a copy via the secure copy protocol, or SCP.
So I'll see you in that video in just a moment.
Meanwhile, I hope this has been informative for you.
And I'd like to thank you for viewing.