[rancid] Re: rancid issues with IOS XR
John Jetmore
jj33 at pobox.com
Fri Mar 26 12:05:10 UTC 2010
This looks similar to a problem we had where the '#' symbols in our
banner were being mistaken for the '#' in the enable prompt and
confusing rancid. One of my colleagues applied this patch before I
was involved in our rancid install:
423a428,435
> -re ".+##########.+Verification" {
> # Account for the hosed up banner via telnet
> exp_continue
> }
> -re ".+##########.+" {
> # Account for the hosed up banner via ssh
> exp_continue
> }
This may be a silly patch but it's worked for us and I've never had to
reevaluate it. If you used something like this you might have to
change the number of contiguous hashes based on the output you sent.
--John
2010/3/26 Drikus Brits <Drikus.Brits at vodacom.co.za>:
> Hi,
>
> Find below the debug section
>
>
> <snip>
> 10.117.144.75
> spawn telnet 10.117.144.75
> parent: waiting for sync byte
> parent: telling child to go ahead
> parent: now unsynchronized from child
> spawn: returns {24151}
>
> expect: does "" (spawn_id exp6) match regular expression "(Connection refused|Secure connection [^\n\r]+ refused)"? no
> "(Connection closed by|Connection to [^\n\r]+ closed)"? no
>
> expect: does "" (spawn_id exp6) match glob pattern "unknown host\r"? no
>
> expect: does "" (spawn_id exp6) match glob pattern "Host is unreachable"? no
> "No address associated with name"? no
> "(Host key not found |The authenticity of host .* be established).*(yes/no)?"? no
> "HOST IDENTIFICATION HAS CHANGED.* (yes/no)?"? no
> "Offending key for .* (yes/no)?"? no
> "(denied|Sorry)"? no
> "Login failed"? no
> "% (Bad passwords|Authentication failed)"? no
> "Press any key to continue"? no
> "Enter Selection: "? no
> "Last login:"? no
> "@[^\r\n]+ ([Pp]assword|passwd):"? no
> "(Username|Login|login|user name|User):"? no
> "([Pp]assword|passwd):"? no
> "(#| \(enable\))"? no
> "Login invalid"? no
> Trying 10.117.144.75...
>
> expect: does "Trying 10.117.144.75...\r\n" (spawn_id exp6) match regular expression "(Connection refused|Secure connection [^\n\r]+ refused)"? no
> "(Connection closed by|Connection to [^\n\r]+ closed)"? no
>
> expect: does "Trying 10.117.144.75...\r\n" (spawn_id exp6) match glob pattern "unknown host\r"? no
>
> expect: does "Trying 10.117.144.75...\r\n" (spawn_id exp6) match glob pattern "Host is unreachable"? no
> "No address associated with name"? no
> "(Host key not found |The authenticity of host .* be established).*(yes/no)?"? no
> "HOST IDENTIFICATION HAS CHANGED.* (yes/no)?"? no
> "Offending key for .* (yes/no)?"? no
> "(denied|Sorry)"? no
> "Login failed"? no
> "% (Bad passwords|Authentication failed)"? no
> "Press any key to continue"? no
> "Enter Selection: "? no
> "Last login:"? no
> "@[^\r\n]+ ([Pp]assword|passwd):"? no
> "(Username|Login|login|user name|User):"? no
> "([Pp]assword|passwd):"? no
> "(#| \(enable\))"? no
> "Login invalid"? no
> Connected to 10.117.144.75.
> Escape character is '^]'.
>
> expect: does "Trying 10.117.144.75...\r\nConnected to 10.117.144.75.\r\nEscape character is '^]'.\r\n" (spawn_id exp6) match regular expression "(Connection refused|Secure connection [^\n\r]+ refused)"? no
> "(Connection closed by|Connection to [^\n\r]+ closed)"? no
>
> expect: does "Trying 10.117.144.75...\r\nConnected to 10.117.144.75.\r\nEscape character is '^]'.\r\n" (spawn_id exp6) match glob pattern "unknown host\r"? no
>
> expect: does "Trying 10.117.144.75...\r\nConnected to 10.117.144.75.\r\nEscape character is '^]'.\r\n" (spawn_id exp6) match glob pattern "Host is unreachable"? no
> "No address associated with name"? no
> "(Host key not found |The authenticity of host .* be established).*(yes/no)?"? no
> "HOST IDENTIFICATION HAS CHANGED.* (yes/no)?"? no
> "Offending key for .* (yes/no)?"? no
> "(denied|Sorry)"? no
> "Login failed"? no
> "% (Bad passwords|Authentication failed)"? no
> "Press any key to continue"? no
> "Enter Selection: "? no
> "Last login:"? no
> "@[^\r\n]+ ([Pp]assword|passwd):"? no
> "(Username|Login|login|user name|User):"? no
> "([Pp]assword|passwd):"? no
> "(#| \(enable\))"? no
> "Login invalid"? no
>
>
> expect: does "Trying 10.117.144.75...\r\nConnected to 10.117.144.75.\r\nEscape character is '^]'.\r\n\r\n" (spawn_id exp6) match regular expression "(Connection refused|Secure connection [^\n\r]+ refused)"? no
> "(Connection closed by|Connection to [^\n\r]+ closed)"? no
>
> expect: does "Trying 10.117.144.75...\r\nConnected to 10.117.144.75.\r\nEscape character is '^]'.\r\n\r\n" (spawn_id exp6) match glob pattern "unknown host\r"? no
>
> expect: does "Trying 10.117.144.75...\r\nConnected to 10.117.144.75.\r\nEscape character is '^]'.\r\n\r\n" (spawn_id exp6) match glob pattern "Host is unreachable"? no
> "No address associated with name"? no
> "(Host key not found |The authenticity of host .* be established).*(yes/no)?"? no
> "HOST IDENTIFICATION HAS CHANGED.* (yes/no)?"? no
> "Offending key for .* (yes/no)?"? no
> "(denied|Sorry)"? no
> "Login failed"? no
> "% (Bad passwords|Authentication failed)"? no
> "Press any key to continue"? no
> "Enter Selection: "? no
> "Last login:"? no
> "@[^\r\n]+ ([Pp]assword|passwd):"? no
> "(Username|Login|login|user name|User):"? no
> "([Pp]assword|passwd):"? no
> "(#| \(enable\))"? no
> "Login invalid"? no
> CCC
> ####################################################################################
> ### UNAUTHORISED ACCESS TO THIS NETWORK DEVICE IS PROHIBITED ###
> ### You must have explicit permission to access or configure this device. All
> expect: does "Trying 10.117.144.75...\r\nConnected to 10.117.144.75.\r\nEscape character is '^]'.\r\n\r\nCCC\r\n####################################################################################\r\n### UNAUTHORISED ACCESS TO THIS NETWORK DEVICE IS PROHIBITED ###\r\n### You must have explicit permission to access or configure this device. All " (spawn_id exp6) match regular expression "(Connection refused|Secure connection [^\n\r]+ refused)"? no
> "(Connection closed by|Connection to [^\n\r]+ closed)"? no
>
> expect: does "Trying 10.117.144.75...\r\nConnected to 10.117.144.75.\r\nEscape character is '^]'.\r\n\r\nCCC\r\n####################################################################################\r\n### UNAUTHORISED ACCESS TO THIS NETWORK DEVICE IS PROHIBITED ###\r\n### You must have explicit permission to access or configure this device. All " (spawn_id exp6) match glob pattern "unknown host\r"? no
>
> expect: does "Trying 10.117.144.75...\r\nConnected to 10.117.144.75.\r\nEscape character is '^]'.\r\n\r\nCCC\r\n####################################################################################\r\n### UNAUTHORISED ACCESS TO THIS NETWORK DEVICE IS PROHIBITED ###\r\n### You must have explicit permission to access or configure this device. All " (spawn_id exp6) match glob pattern "Host is unreachable"? no
> "No address associated with name"? no
> "(Host key not found |The authenticity of host .* be established).*(yes/no)?"? no
> "HOST IDENTIFICATION HAS CHANGED.* (yes/no)?"? no
> "Offending key for .* (yes/no)?"? no
> "(denied|Sorry)"? no
> "Login failed"? no
> "% (Bad passwords|Authentication failed)"? no
> "Press any key to continue"? no
> "Enter Selection: "? no
> "Last login:"? no
> "@[^\r\n]+ ([Pp]assword|passwd):"? no
> "(Username|Login|login|user name|User):"? no
> "([Pp]assword|passwd):"? no
> "(#| \(enable\))"? yes
> expect: set expect_out(0,string) "#"
> expect: set expect_out(1,string) "#"
> expect: set expect_out(spawn_id) "exp6"
> expect: set expect_out(buffer) "Trying 10.117.144.75...\r\nConnected to 10.117.144.75.\r\nEscape character is '^]'.\r\n\r\nCCC\r\n#"
> send: sending "\r" to { exp6 }
>
> expect: does "###################################################################################\r\n### UNAUTHORISED ACCESS TO THIS NETWORK DEVICE IS PROHIBITED ###\r\n### You must have explicit permission to access or configure this device. All " (spawn_id exp6) match regular expression "[\r\n]+"? yes
> expect: set expect_out(0,string) "\r\n"
> expect: set expect_out(spawn_id) "exp6"
> expect: set expect_out(buffer) "###################################################################################\r\n"
> expect: continuing expect
>
> expect: does "### UNAUTHORISED ACCESS TO THIS NETWORK DEVICE IS PROHIBITED ###\r\n### You must have explicit permission to access or configure this device. All " (spawn_id exp6) match regular expression "[\r\n]+"? yes
> expect: set expect_out(0,string) "\r\n"
> expect: set expect_out(spawn_id) "exp6"
> expect: set expect_out(buffer) "### UNAUTHORISED ACCESS TO THIS NETWORK DEVICE IS PROHIBITED ###\r\n"
> expect: continuing expect
>
> expect: does "### You must have explicit permission to access or configure this device. All " (spawn_id exp6) match regular expression "[\r\n]+"? no
> "^(.+[:.])1 ((#| \(enable\)))"? no
> "^.+(#| \(enable\))"? yes
> expect: set expect_out(0,string) "###"
> expect: set expect_out(1,string) "#"
> expect: set expect_out(spawn_id) "exp6"
> expect: set expect_out(buffer) "###"
> tty_raw_noecho: was raw = 0 echo = 1
> spawn id exp6 sent < ###\r\n### activities performed on this device may be logged and violations of this ###\r\n### policy may result in disciplinary action and may be reported to law ###\r\n### enforcement agencies. There is no right to privacy on this device. ###\r\n####################################################################################\r\n\r\n MMNM\r\n MMMM\r\n MMNM\r\n MMNNM\r\n MMMM\r\n MMNM\r\n MMMMM\r\n MNMM\r\n MMMMM MMMMM MMMM\r\n MM>
> ###
> ### activities performed on this device may be logged and violations of this ###
> ### policy may result in disciplinary action and may be reported to law ###
> ### enforcement agencies. There is no right to privacy on this device. ###
> ####################################################################################
>
> MMNM
> MMMM
> MMNM
> MMNNM
> MMMM
> MMNM
> MMMMM
> MNMM
> MMMMM MMMMM MMMM
> MMspawn id exp6 sent <MM MM MM MMMMM MMMM\r\n MMNM MM MMM NMNMN MMMM\r\n MMMMMMMMMMMMNMM MNM MMM MMMMN MMMMM\r\n MMMMM MMM MMMN MMMM MMMM MMMM\r\n MMMM MMMM MMMM MMMM MNMMMM>
> MM MM MM MMMMM MMMM
> MMNM MM MMM NMNMN MMMM
> MMMMMMMMMMMMNMM MNM MMM MMMMN MMMMM
> MMMMM MMM MMMN MMMM MMMM MMMM
> MMMM MMMM MMMM MMMM MNMMMMspawn id exp6 sent <MMMM MMM\r\n MMMM NMMM MMMM MMNM MMMMM MMMMMM MMM\r\n MMMNMM MMMM MMMM MNMM MMNMM MMMMMM\r\n MMMMMMMMM MMM MMM MMMMM MMMM\r\n MNMMMMMM MMM MNM MMMMM\r\n MMMM MM MM MMMMM\r\n MNMMM MM M MNMM\r\n MDMM M M NMM\r\n MMMM MMMM\r\n__ __ _ ____ _\r\n\ \ / / | | | _ \ (_)\r\n \ \ / /__ __| | __ _ ___ ___ _ __ ___ | |_) |_ _ ___ _ _ __ ___ ___ ___\r\n \ \/ / _ \ / _` |/ _` |/ __/ _ \| '_ ` _ \ | _ <| | | / __| | '_ \ / _ \/ __/ __|\r\n \ / (_) | (_| | (_| | (_| (_) | | | | | | | |_) | |_| \__ \ | | | | __/\__ \__ \\r\n \/ \___/ \__,_|\__,_|\___\___/|_| |_| |_| |____/ \__,_|___/_|_| |_|\___||___/___/\r\n\r\n#####################################################################################\r\n### Device Hostname ###\r\n### my-ios-xr ###\r\n#####################################################################################\r\n\r\n>
> MMMM MMM
> MMMM NMMM MMMM MMNM MMMMM MMMMMM MMM
> MMMNMM MMMM MMMM MNMM MMNMM MMMMMM
> MMMMMMMMM MMM MMM MMMMM MMMM
> MNMMMMMM MMM MNM MMMMM
> MMMM MM MM MMMMM
> MNMMM MM M MNMM
> MDMM M M NMM
> MMMM MMMM
>
> #####################################################################################
> ### Device Hostname ###
> ### my-ios-xr ###
> #####################################################################################
>
> spawn id exp6 sent <\r\nUser Access Verification\r\n\r\nUsername: >
>
> User Access Verification
>
> Username: spawn id exp6 sent <\r\n>
>
> spawn id exp6 sent <\r\nUser Access Verification\r\n\r\nUsername: >
>
> User Access Verification
>
> Username: spawn id exp0 sent <d> ----- at this point I sent a couple of d's
> spawn id exp0 sent <d>
> spawn id exp6 sent <d>
> dspawn id exp6 sent <d>
> dspawn id exp0 sent <\u001d> ----- and quit the telnet session
> spawn id exp6 sent <\r\ntelnet> >
>
> telnet> spawn id exp0 sent <q>
> spawn id exp6 sent <q>
> qspawn id exp0 sent <u>
> spawn id exp6 sent <u>
> uspawn id exp0 sent <i>
> spawn id exp6 sent <i>
> ispawn id exp0 sent <t>
> spawn id exp6 sent <t>
> tspawn id exp0 sent <\r>
> spawn id exp6 sent <\r\nConnection closed.\r\n>
>
> Connection closed.
> interact: received eof from spawn_id exp6
> write() failed to write anything - will sleep(1) and retry...
> tty_set: raw = 0, echo = 1
> tty_set: raw = 5, echo = 0
> </snip>
>
>
>
> -----Original Message-----
> From: john heasley [mailto:heas at shrubbery.net]
> Sent: Thursday, March 25, 2010 10:17 PM
> To: Drikus Brits
> Cc: Rancid-discuss at shrubbery.net
> Subject: Re: [rancid] rancid issues with IOS XR
>
> Thu, Mar 25, 2010 at 07:55:39PM +0200, Drikus Brits:
>> HI all,
>>
>> Hope someone can help on this issue.
>>
>> I seem to be having an issue logging onto IOS XR routers using clogin, or the xrrancid patch as described by previous forums.
>>
>> the output i get when using -autoenable or configuring the devices in my .cloginrc file returns the same output.
>>
>> It seems to skip the initial expect sequence for Username: and then returns with another auth reques, after the second prompt the expect script appear to have died, as i can then type in my own authentication details.
>>
>> User Access Verification
>>
>> Username:
>>
>> User Access Verification
>>
>> Username:
>> telnet> quit
>
> you'll have to share the o/p of clogin -d hostname with us.
> “This e-mail is sent on the Terms and Conditions that can be accessed by Clicking on this link http://www.vodacom.co.za/legal/email.jsp "
>
> _______________________________________________
> Rancid-discuss mailing list
> Rancid-discuss at shrubbery.net
> http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss
>
More information about the Rancid-discuss
mailing list