Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am attempting to script a system for automatically deploying new Cisco switches (Cisco 3012 switches for an IBM BladeCenter, to be specific).

I need to get telnet access into the new switches, however by default there is no password set:

victor:~ # telnet 10.10.10.2
Trying 10.10.10.2...
Connected to 10.10.10.2.
Escape character is '^]'.


Password required, but none set
Connection closed by foreign host.

I need to issue commands over the web interface to modify the default configuration. How do I do so?

(no, I can't use CNA)

share|improve this question

4 Answers 4

up vote 3 down vote accepted

To set the line password and enable secret over http:

http://SWITCH/level/15/line/0/15/-/password/0/PASSW0RD/CR
http://SWITCH/level/15/configure/-/enable/secret/0/yummyfood/CR

With the enable secret set, you now need to enter the secret as a password to use the web interface.


Via HTTP, you can execute arbitrary commands in either exec mode or configure mode via:

http://SWITCH/level/15/exec/-/copy/run/start/CR
http://SWITCH/level/15/configure/-/no/enable/secret/CR

To get assistance executing commands in the web interface, access:

http://SWITCH/level/15/exec/-

This will lead you down the path of finding out how to do various other things. For example, to configure an interface you need to do:

http://SWITCH/level/15/interface/GigabitEthernet0\/1/-/shutdown

(many thanks to @Justin who led me down the right path)

share|improve this answer

Can you log into the web interface with the enable password? if so, you can fix this..

if you click 'monitor' and then 'configure' and then 'line' and then 'vty' and then enter 0 and then click 'password' you should arrive at a link that looks like this:

http://a.b.c.d/level/15/line/1/1/-/password

that form should set the password, at which point telnet will work.

edit: oh, and while this will work, unless there is something preventing you from using the console port, you should really use that.

share|improve this answer
    
Using the console port would be fine for the first 10 or switches, but would get VERY tedious by the time I got to switch number 75... –  MikeyB Jan 4 '10 at 4:29
    
it is trivial to automate a configuration session over the serial port, if that is what you mean by tedious. –  Justin Jan 4 '10 at 5:30

It should be fairly simple to capture the request details that set the password, however that might not help if Cisco have tried to be "smart" about things (which they probably have).

Having a small static text file that sets the password when pasted into a console session is probably your best option.

share|improve this answer
    
That is what I'm currently working on, though I was hoping that someone already had the necessary magic worked out. :) –  MikeyB Jan 4 '10 at 2:12

You have to use console cable. I am not sure about web-interface, but telnet won't let you to enter switch, if you haven't specified enable password. So WUI probably works the same, because it uses enable password for authentification.

share|improve this answer
1  
it's been a while since I tested this, but I'm pretty certain the error above is what you get when the 'line vty' password is not set, and has nothing to do with the enable password –  Justin Jan 4 '10 at 0:21
    
The web interface allows you to set the vty and enable passwords in a default configuration (at least on this switch). –  MikeyB Jan 4 '10 at 2:10

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.