[rancid] Re: 'out of band' access script changes?

Ed Ravin eravin at panix.com
Sun Nov 19 05:26:51 UTC 2006


On Fri, Nov 17, 2006 at 11:55:14AM -0500, Sherrill, Justin wrote:
> I tried applying the patch that Ed Ravin posted:
> http://www.shrubbery.net/pipermail/rancid-discuss/2006-May/001490.html
>
> And trying it as mentioned here, to reach a device on a separate
> network:
> 
> http://www.shrubbery.net/pipermail/rancid-discuss/2006-June/001551.html
> 
> (in .clogin)
> add method      192.168.19.10   {usercmd}
> add usercmd     192.168.19.10   {clogin} {-c} {telnet 172.21.121.18}
> {192.168.19.10}
> 
> (at the command line)
> $ ./bin/clogin -c 'show version' 192.168.19.10
> 192.168.19.10
> spawn clogin -c telnet 172.21.121.18 192.168.19.10
> 192.168.19.10
> 
> Error: unknown connection method: usercmd

You didn't make any mistakes with the patches.  It's your cloginrc - you
are using the same router IP (192.168.19.10) for the first and second hop.
clogin thinks the way to get to 192.168.19.10 is to first log into
192.168.19.10 and then telnet to 172.21.121.18, which makes no sense.
Since you're calling the unpatched clogin on the second hop, it sees the
"usercmd" stuff defined for 192.168.19.10 and aborts.

You probably wanted to say that the route to 172.21.121.18 is via logging
into 192.168.19.10 and then issuing the telnet command, like this:

  add method   172.21.121.18  {usercmd}
  add usercmd  172.21.121.18  {clogin} {-noenable} {-c} {telnet 192.168.19.10}

  add method   192.168.19.10  {telnet}
  add password 192.168.19.10  {xxx} {yyy}

The mistake would have been obvious if you had called the patched clogin in
the "usercmd" - it would have understood "usercmd" and started a recursive
infinite loop of clogins.

Let me know if you run into any more trouble with the patch.

	-- Ed



More information about the Rancid-discuss mailing list