Here is how you do it with expect.

 

In the linux windows press ctrl ].  This will give you the telent>  You then
type send Break.  Here is some sample code.

 

            expect "#" { send "" } timeout { TimeOut
$SCRIPT_NAME\_Sending_Break_Sequence_To_Exit_Script_Completed\_$termserv\_$p
ort }

            expect {

                        -re "telnet>" {

                                    send "send Break\r"

                                    }

 

As you can see in the send " " you cannot copy and paste the "ctrl ]" But
that is where it goes.

 

Regards,

 

Tyson Scott - CCIE #13513 R&S and Security

Technical Instructor - IPexpert, Inc.


Telephone: +1.810.326.1444 
Cell: +1.248.504.7309
Fax: +1.810.454.0130
Mailto:  [email protected]

 

Join our free online support and peer group communities:
<http://www.IPexpert.com/communities> http://www.IPexpert.com/communities

 

IPexpert - The Global Leader in Self-Study, Classroom-Based, Video On Demand
and Audio Certification Training Tools for the Cisco CCIE R&S Lab, CCIE
Security Lab, CCIE Service Provider Lab , CCIE Voice Lab and CCIE Storage
Lab Certifications.

 

From: [email protected]
[mailto:[email protected]] On Behalf Of Brandon Carroll
Sent: Tuesday, June 23, 2009 6:07 PM
To: Matt Hill
Cc: CCIE_RS
Subject: Re: [OSL | CCIE_RS] OT: Expect

 

Interesting....

thanks matt.

On Tue, Jun 23, 2009 at 3:00 PM, Matt Hill <[email protected]> wrote:

Good luck there mate....

BREAK from a TTY is actually a signal being sent as opposed to some
ASCII code which ctrl-BRK from a PC sends.

I am guessing you are using expect to connect to some terminal server
which has an async connection to a router's console port?

I know this is hardly using expect (its hardly automated at all), but
what you can do is change the baud rate of the console port to 1200
from the terminal server and hold space bar continually whilst the
receiving router reloads (don't change the speed of the console port
on the router, only the terminal server).  When the screen output
appears "static" after all the out-of-sync symbols etc stop popping
up, you are in rommon.  Go back to 9600 and off you go.

Cheers,
Matt

CCIE #22386
CCSI #31207

2009/6/24 Brandon Carroll <[email protected]>:

> Anyone know how to send a break using expect to get into rommon on a
router?
>
> thanks
>
> BC
>

 

Reply via email to