[rancid] diff to make rancid work with HP 2810-24G and tacacs+ authentication

Johan Ryberg johan at securit.se
Fri Jul 13 08:59:45 UTC 2012


Hi.

I where having big problems when I enabled tacacs authentication for
HP 2810-24G switches and I found two issues that made rancid
(hpuifilder) to consume 100% cpu and it hang there forever.

First problem, the enable prompt
The switch are using "Login:" and I think this could be changed in the
default userprompt from "(Username|login|user name):" to
"(Username|[Ll]ogin|user name):"
--- /usr/local/bin/hlogin       Fri Jul 13 10:12:12 2012
+++ hlogin      Fri Jul 13 10:58:19 2012
@@ -697,7 +697,7 @@
      # Figure out prompts
      set u_prompt [find userprompt $router]
      if { "$u_prompt" == "" } {
-       set u_prompt "(Username|login|user name):"
+       set u_prompt "(Username|[Ll]ogin|user name):"
      } else {
         set u_prompt [join [lindex $u_prompt 0] ""]
      }



Second problem, hlogin was to fast to enter the enable command after
login. The only letters that where written to the console was "nable".
I could reproduce this every time. The fix was to add a sleep in
hlogin after the "welcome prompt"

--- /usr/local/bin/hlogin  Fri Jul 13 10:40:23 2012
+++ /usr/local/bin/hlogin       Fri Jul 13 10:12:12 2012
@@ -394,6 +394,7 @@
      expect {
         "Press any key to continue" {
             send " "
+            sleep 1
             exp_continue
         }
         "Enter switch number to connect to or <CR>:" {

For the record. I'm using rancid 2.3.8 on OpenBSD 5.1

 Best regards Johan Ryberg


More information about the Rancid-discuss mailing list