HTTP 101

HTTP Server

To enable the HTTP Server on the Cisco IOS, use:
1
R(config)# ip http server
Copied!
By default, the server runs on port 80. You can change it with:
1
R(config)# ip http port PORT-NUMBER
Copied!
To restrict the clients that can access the HTTP server, use:
1
R(config)# ip http access-class ACL
Copied!
To enable authentication for the HTTP server, use:
1
R(config)# ip http authentication {enable|local}
2
! When using local auth, the user must have priv 15
Copied!
If you use AAA authentication then you can also set up AAA authentication:
1
R(config)# ip http authentication aaa login-authentication METHOD-LIST
2
! Additionaly, define EXEC and COMMAND authorization:
3
R(config)# ip http [exec-authorization METHOD-LIST|command-authorization LEVEL METHOD-LIST
Copied!
Normally, the files used by the HTTP server are located on the flash. You can specify the path to the server root, using:
1
R(config)# ip http path PATH-TO-SERVER-ROOT
Copied!
To define a timeout policy, use the command:
1
R(config)# ip http timeout-policy idle IDLE-TIMEOUT life LIFE-TIMEOUT requests MAX-REQ
2
! IDLE-TIMEOUT - default 180 - timeout if no data is received
3
! LIFE-TIMEOUT - default 180 - max lifetime of a connection regardless of data sent
4
! MAX-REQ - maximum number of requests per connection.
Copied!

HTTPS Server

To enable the HTTPS server, use:
1
R(config)# ip http secure-server
Copied!
By default, the secure server runs on port 443, but it can be changed with:
1
R(config)# ip http secure-port PORT-NUMBER
Copied!

HTTP Client

The Cisco IOS Router can also act as an HTTP Client. The HTTP client is used when issuing commands such as:
1
R# more http://SERVER[/PAGE]
2
R# copy http://SERVER/FILE ...
Copied!
The HTTP client can be configured inside the configuration mode. For example you can specify an HTTP user and password to be used:
1
R(config)# ip http client username USER
2
R(config)# ip http client password PASS
Copied!
or the source interface:
1
R(config)# ip http source-interface INTERFACE
Copied!
Additionaly an HTTP Proxy can be configured, using:
1
R(config)# ip http client proxy-server PROXY-SRV proxy-port PROXY-PORT
Copied!
Last modified 24d ago