Wired Intelligent Edge

 View Only
  • 1.  Bash script to change the config of Procurve 4204

    Posted Dec 05, 2012 05:36 AM

    Hello,

     

    currently I have a switch Procurve 4204vl that is routing.

    I need to do a bash script to connect to this router via telnet and change a line of its current configuration. This line is similar to this:

     

    ip route 82.52.253.229 255.255.255.255 192.168.10.325

     

    and it should be changed to

     

    no ip route 82.52.253.229 255.255.255.255 192.168.10.325

     

    My problem is I have not idea how to do it, or even if it is remotely possible to do it.

    So, I will appreciate any kind of help.

     

    Thank you!



  • 2.  RE: Bash script to change the config of Procurve 4204

    Posted Dec 05, 2012 04:08 PM
    If you only need to do this once, the easy way is to simply use the switch CLI via your ssh client (e.g. ssh on Linux & Mac, putty on Windows). Telnet is a bad idea because it is completely unencrypted, including the password.

    If you want to do this as part of a scripted solution, you could use RANCID's hlogin command to send commands to the switch. See http://www.shrubbery.net/rancid/ to download RANCID.

    HP's IMC and ProCurve Manager Plus products should also allow you to do scripting like this, but i'm not sure about their ability to integrate with bash scripting.


  • 3.  RE: Bash script to change the config of Procurve 4204

    Posted Dec 10, 2012 05:01 AM

    Thank Paul.

    And there isn't other software as Rancid, but for Windows?

    I was looking for examples of Rancid script, and I didn't find much... and besides it Rancid needs a CVS and I'm not interesting on install that kind of software.

     

    Regards.

     

    PS: I talked about a bash script, but the only function of it would be ping to an IP, and if the connection is down then just change the route inside the switch.



  • 4.  RE: Bash script to change the config of Procurve 4204

    Posted Dec 10, 2012 05:49 AM
    Because you mentioned bash, i assumed you already had a working Linux server in place. An equivalent to RANCID for Windows might be something like Kiwi CatTools: http://www.kiwisyslog.com/products/kiwi-cattools/product-overview.aspx

    If what you're wanting to do with this is check route availability, a much better solution would be to upgrade to a proper routing switch (e.g. 3500yl, 5400zl, 5500-EI) and use a dynamic routing protocol such as OSPF.


  • 5.  RE: Bash script to change the config of Procurve 4204

    Posted Dec 10, 2012 06:56 AM

    Thank you, but I found a solution using "expect" and "autoexpect" in bash. This is working fine in linux.

    Regards.