Download Router Configuration to a Web Browser

If you have HTTP server enabled on your router (on by default in many IOS releases, enable with ip http server), you can download the current router configuration into your web browser simply by typing in the URL http://router/exec/show/running/full. To get the startup configuration, use http://router/exec/show/startup-config/CR.

Of course, you need to authenticate to the router. By default, you can use anything as the username and the enable-password as the password, but you also use local usernames or AAA authentication. To use local usernames, configure ip http authentication local and enter username and password with the username username privilege 15 password password configuration command.

4 comments:

  1. Is there anyway to send the username and password with the URL request to the router so the user is not prompted for the login? I wanted to have a webpage retrieve the info from the router and I can't figure a way for it to send the username / password or enable password. I could have no enable password but I would rather not. Great tips on this site.

    ReplyDelete
  2. Hello Ivan. I was the person who recently asked the question on your blog about sending the username and password along with a web request to a Cisco router. Thank you very much for help. I know this could be done but the Microsoft security patch is what kept this not working for me. That portion was a big help. I have tested the solution and it works.

    But the solution still doesn't solve my particular problem though. I often work on goofy Cisco hacks for fun and my current project is what brought me to your blog. I wanted to create a poor man's cache engine. This doesn't serve much purpose, it was just something I though would be fun to test out.

    A user (who would probably have the username:password Microsoft security patch enabled) would open a web page on a distant server. The page would send text to the user's browser but the image file(s) would be loaded from the gateway router that the user's broadband connection was directly connected. The gateway router would be a Cisco of course with http services enabled. I created a test php script that took the user's outside IP address, say, x.x.x.73 and set the gateway variable as x.x.x.1, assuming a simple class C, etc. The php script would be in the webpage and load the image from the router using the gateway variable address. The point of this would be that the image would be loaded faster and the ISP would not be wasting bandwidth on the repeated image being requested by its users. This works but the user is prompted for the username and password before the image is loaded the first time. A work around is setting no enable password and http authentication to enable password but of course that is not safe. I couldn't get the username:password@router to work myself which prompted my question to your excellent blog.

    The problem remains that if I disable the Microsoft security feature on the web server, it works as long as the web server is also the machine opening up the webpage. If I access the webserver from a remote PC, that has the MS patch enabled, it still won't work if I incorporate the username:password into the web page line....img src='http://username:password@{$gateway_ip}/picture.jpg. I guess the PC is sending the request client side to the router.

    Any thoughts on this?

    ReplyDelete
  3. An interesting problem, but I guess we need more direct communication path. Please go to my About page, find the link Send message to Ivan at the bottom of the page and send me an e-mail.

    ReplyDelete

You don't have to log in to post a comment, but please do provide your real name/URL. Anonymous comments might get deleted.

Ivan Pepelnjak, CCIE#1354, is the chief technology advisor for NIL Data Communications. He has been designing and implementing large-scale data communications networks as well as teaching and writing books about advanced technologies since 1990. See his full profile, contact him or follow @ioshints on Twitter.