HPE Aruba Networking & ProVision-based
1831232 Members
2582 Online
110021 Solutions
New Discussion

Bash script to change the config of Procurve 4204

 
Sistemas01
Occasional Visitor

Bash script to change the config of Procurve 4204

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!

4 REPLIES 4
paulgear
Esteemed Contributor

Re: Bash script to change the config of Procurve 4204

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.
Regards,
Paul
Sistemas01
Occasional Visitor

Re: Bash script to change the config of Procurve 4204

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.

paulgear
Esteemed Contributor

Re: Bash script to change the config of Procurve 4204

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.
Regards,
Paul
Sistemas01
Occasional Visitor

Re: Bash script to change the config of Procurve 4204

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

Regards.