NSLU2-Linux
view · edit · print · history

HowTo.TelnetIntoRedBoot History

Hide minor edits - Show changes to markup

April 27, 2008, at 08:44 AM by Tom Harris -- Note on ResetSysConf
Changed lines 5-6 from:

The main reason for accessing the RedBoot bootloader is when you are attempting to Recover From A Bad Flash.

to:

The main reason for accessing the RedBoot bootloader is when you are attempting to Recover From A Bad Flash. It is also useful for Resetting the SysConf area if you have screwed up your non-volatile config settings.

April 22, 2008, at 08:41 PM by Ed Ruinsky --
Changed line 384 from:

Using expect to connect to RedBoot

to:

Using expect to connect to RedBoot

Deleted line 385:
Deleted lines 386-390:

To use, copy the script below into your favorite text editor then save it as redboot.exp. If your device is listening on an IP address other than 192.168.0.1 edit the "set target" statement to set the proper address. The "set port" statement does the same for the port number. Then enter "expect redboot.exp" from the command line, leaving off the quote marks.

Using expect to connect to RedBoot

expect is a Tcl based tool for automating interactive programs. It's available on most - if not all *nix distributions. It may also be available for Windows - perhaps via Cygwin - but I haven't tried to get or run it under Windows. The following is an expect script to ping 192.168.0.1 and drop into a telnet session as soon as there's a response. It will automatically send the ^C and the version command, leaving you at the RedBoot> prompt.

April 22, 2008, at 08:01 PM by Ed Ruinsky --
Changed lines 390-406 from:

set target "192.168.0.1" set port 9000 spawn ping $target set timeout -1 expect {

        -re "time=.*$" close 

} spawn telnet $target $port expect -re "Escape character is.*$" {

  sleep .5 
  send \003 
  expect "RedBoot>" { 
      send "version\r" 
  } 

} interact

to:

Using expect to connect to RedBoot

expect is a Tcl based tool for automating interactive programs. It's available on most - if not all *nix distributions. It may also be available for Windows - perhaps via Cygwin - but I haven't tried to get or run it under Windows. The following is an expect script to ping 192.168.0.1 and drop into a telnet session as soon as there's a response. It will automatically send the ^C and the version command, leaving you at the RedBoot> prompt. To use, copy the script below into your favorite text editor then save it as redboot.exp. Then enter "expect redboot,exp" from the command line, leaving off the quote marks.

  # expect script to connect to the (NSLU2) RedBoot loader.
  # set the IP address and the port for the loader.
  set target "192.168.0.1"
  set port 9000
  # 1. Start ping and wait for a response.
  # 2. When RedBoot is alive, start the telnet session.
  # 3. Allow .5 seconds after the connect for telnet 
  #    to get his act in order.
  # 4. Send the ^C and wait for the RedBoot prompt.
  # 5. Get the version information.
  # 6. Return control to the user.
  spawn ping $target
  set timeout -1
  expect {
    -re "time=.*$" close
  }
  spawn telnet $target $port
  expect -re "Escape character is.*$" {
    sleep .5
    send \003
    expect "RedBoot>" {
      send "version\r"
    }
  }
  interact
April 22, 2008, at 07:59 PM by Ed Ruinsky --
Changed lines 390-406 from:

set target "192.168.0.1" set port 9000 spawn ping $target set timeout -1 expect {

        -re "time=.*$" close

} spawn telnet $target $port expect -re "Escape character is.*$" {

  sleep .5
  send \003
  expect "RedBoot>" {
      send "version\r"
  }

} interact

to:

set target "192.168.0.1" set port 9000 spawn ping $target set timeout -1 expect {

        -re "time=.*$" close 

} spawn telnet $target $port expect -re "Escape character is.*$" {

  sleep .5 
  send \003 
  expect "RedBoot>" { 
      send "version\r" 
  } 

} interact

April 22, 2008, at 07:57 PM by Ed Ruinsky --
April 22, 2008, at 07:54 PM by Ed Ruinsky --
Deleted lines 389-390:
  1. expect script to connect to the (NSLU2) RedBoot loader.
  2. set the IP address and the port for the loader.
Deleted lines 391-397:
  1. 1. Start ping and wait for a response.
  2. 2. When RedBoot is alive, start the telnet session.
  3. 3. Allow .5 seconds after the connect for telnet
  4. to get his act in order.
  5. 4. Send the ^C and wait for the RedBoot prompt.
  6. 5. Get the version information.
  7. 6. Return control to the user.
April 22, 2008, at 07:52 PM by Ed Ruinsky --
Added line 386:
April 22, 2008, at 07:51 PM by Ed Ruinsky -- Expect script for connecting to RedBoot
Changed lines 384-416 from:
to:

Using expect to connect to RedBoot

expect is a Tcl based tool for automating interactive programs. It's available on most - if not all *nix distributions. It may also be available for Windows - perhaps via Cygwin - but I haven't tried to get or run it under Windows. The following is an expect script to ping 192.168.0.1 and drop into a telnet session as soon as there's a response. It will automatically send the ^C and the version command, leaving you at the RedBoot> prompt. To use, copy the script below into your favorite text editor then save it as redboot.exp. If your device is listening on an IP address other than 192.168.0.1 edit the "set target" statement to set the proper address. The "set port" statement does the same for the port number. Then enter "expect redboot.exp" from the command line, leaving off the quote marks.

  1. expect script to connect to the (NSLU2) RedBoot loader.
  2. set the IP address and the port for the loader.

set target "192.168.0.1" set port 9000

  1. 1. Start ping and wait for a response.
  2. 2. When RedBoot is alive, start the telnet session.
  3. 3. Allow .5 seconds after the connect for telnet
  4. to get his act in order.
  5. 4. Send the ^C and wait for the RedBoot prompt.
  6. 5. Get the version information.
  7. 6. Return control to the user.

spawn ping $target set timeout -1 expect {

        -re "time=.*$" close

} spawn telnet $target $port expect -re "Escape character is.*$" {

  sleep .5
  send \003
  expect "RedBoot>" {
      send "version\r"
  }

} interact

-- Ed Rubinsky

Added lines 616-617:
February 14, 2008, at 04:36 PM by Jac Goudsmit -- Add warning about Flash command on NAS200
Changed lines 9-10 from:

NAS200: RedBoot is also used on the NAS200, but there it uses 192.168.21.249 instead of 192.168.0.1.

to:

NAS200: RedBoot is also used on the NAS200, but there it uses 192.168.21.249 instead of 192.168.0.1. The RedBoot on the NAS200 doesn't have the "fconfig" or "fis" commands, but it does have a "flash" command. Don't use the flash command, it will overwrite your RedBoot without warning and brick your NAS200.

January 27, 2008, at 12:51 AM by Jac Goudsmit -- Added NAS200 address
Added lines 9-10:

NAS200: RedBoot is also used on the NAS200, but there it uses 192.168.21.249 instead of 192.168.0.1.

December 27, 2007, at 10:27 PM by bcrowell -- typo
Changed lines 7-8 from:

Although the unslung 6.8 readme states that "You *must* test telnet Redboot access first before you flash the Unslung firmware," recovery from a bad flash can now also be by the easier method of using the reset button to enter upgrade mode.

to:

Although the unslung 6.8 readme states that "You *must* test telnet Redboot access first before you flash the Unslung firmware," recovery from a bad flash can now also be done by the easier method of using the reset button to enter upgrade mode.

December 27, 2007, at 10:27 PM by bcrowell -- note about not necessarily needing to telnet into red boot
Added lines 7-8:

Although the unslung 6.8 readme states that "You *must* test telnet Redboot access first before you flash the Unslung firmware," recovery from a bad flash can now also be by the easier method of using the reset button to enter upgrade mode.

December 27, 2007, at 06:25 PM by bcrowell -- grammar
Changed line 34 from:

Since 192.168.0.1 could conflict with other equipment on many people's LANs, it is often easier to access RedBoot if it is setup either on its own dedicated network or directly to your computer with a crossover cable.\\

to:

Since 192.168.0.1 could conflict with other equipment on many people's LANs, it is often easier to access RedBoot if it is set up either on its own dedicated network or directly to your computer with a crossover cable.\\

December 27, 2007, at 05:14 AM by bcrowell -- punctuation
Changed line 34 from:

Since 192.168.0.1 could conflict with other equipment on many people's LANs, it is often easier to access RedBoot if it is setup either on it's own dedicated network or directly to your computer with a crossover cable.\\

to:

Since 192.168.0.1 could conflict with other equipment on many people's LANs, it is often easier to access RedBoot if it is setup either on its own dedicated network or directly to your computer with a crossover cable.\\

November 07, 2007, at 12:57 AM by Jim DeLaHunt -- More updates to the Mac instructions
Changed line 65 from:
  1. Set the IP Address to 192.168.0.2
to:
  1. Set the IP Address to 192.168.0.2 (the final digit may be any number from 2 to 254 inclusive)
Changed line 69 from:
  • This was unnecessary on one Powerbook G4 running OS 10.3.9. If the IP address wasn't set to 192.168.0.x, the ping command couldn't find the NSLU2. If the IP address was set there, the arp setting was unnecessary.
to:
  • This may not be necessary, depending on what you are trying. On one Powerbook G4 running OS 10.3.9, the ping command could find the NSLU2 without it, but the TCL script (below) required the arp setting. The IP address had to be set to 192.168.0.x in both cases.
November 07, 2007, at 12:43 AM by Jim DeLaHunt -- Mac OS X details
Added line 62:
  1. Optionally, create a new Location to hold these RedBoot-specific network settings. This lets you switch quickly from normal to RedBoot-specific network settings by selecting different Location names.
Changed line 69 from:
  • A good GUI for TFTP is TFTP Server: http://ww2.unime.it/flr/tftpserver/
to:
  • This was unnecessary on one Powerbook G4 running OS 10.3.9. If the IP address wasn't set to 192.168.0.x, the ping command couldn't find the NSLU2. If the IP address was set there, the arp setting was unnecessary.
Changed lines 75-76 from:
to:
  • A good GUI for TFTP is TFTP Server: http://ww2.unime.it/flr/tftpserver/
November 07, 2007, at 12:37 AM by Jim DeLaHunt -- Add help command under RedBoot command list
Changed lines 23-24 from:
  • reset causes RedBoot to reset the NSLU2, in a similar way to the power-on sequence. This is a clean way out of RedBoot if you don't want to change anything.
to:
  • reset causes RedBoot to reset the NSLU2, in a similar way to the power-on sequence. This is a clean way out of RedBoot if you don't want to change anything. After doing this, the telnet session with RedBoot will go silent, and you'll need to interrupt and close it.
  • help prints out a list of RedBoot commands.
November 03, 2007, at 07:43 AM by Jim DeLaHunt -- What to do with RedBoot once you get access
Added lines 19-26:

What to do with RedBoot once you get access

The RedBoot prompt is RedBoot> . Try the following commands:

  • version prints out RedBoot's version information, and a memory map.
  • reset causes RedBoot to reset the NSLU2, in a similar way to the power-on sequence. This is a clean way out of RedBoot if you don't want to change anything.

After you reset RedBoot, or otherwise end your session, you need to end the telnet connection. To do this, type ^] (control-right bracket). A prompt Telnet> appears. Type close. You return to your command prompt.

November 03, 2007, at 07:36 AM by Jim DeLaHunt -- Add a new one-line commands that works on tcsh on Mac OS 10.3.9
Changed lines 61-63 from:
  • The easiest way is to use the TCL script. The ping, perl, and C scripts do not seem to work on OS X.
to:
  • On a Powerbook G4 running OS 10.3.9, the following command worked for me: bash -c 'while ! ping -r -c 1 192.168.0.1 2>&1 >/dev/null ; do true ; done && telnet 192.168.0.1 9000' (The alert student notes that this runs a script under the bash shell which the Mac OS's default tcsh shell can't directly handle.)
  • Some advise that the easiest way is to use the TCL script, though this didn't work on one Powerbook G4 running OS 10.3.9.
  • Some advise the ping, perl, and C scripts do not seem to work on OS X.
November 02, 2007, at 07:01 AM by Jim DeLaHunt -- For Mac OS arp command, remove <> around MAC address
Changed line 58 from:
  1. Open Terminal and type: sudo arp -s 192.168.0.1 <00:a0:c5:45:0b:17> where 00:a0:c5:45:0b:17 is the MAC address of your slug.
to:
  1. Open Terminal and type: sudo arp -s 192.168.0.1 00:a0:c5:45:0b:17 where 00:a0:c5:45:0b:17 is the MAC address of your slug.
October 01, 2007, at 09:21 PM by fcarolo -- formatting
Changed lines 162-163 from:

NOTE: On some systems you should ensure that the "Speed & Duplex" setting of your network card is set to "100 MBit? Full". "Auto" won't work. --cweber

to:

NOTE: On some systems you should ensure that the "Speed & Duplex" setting of your network card is set to "100 Mbps Full". "Auto" won't work. --cweber

September 29, 2007, at 01:27 AM by Jim Gasbarro --
Deleted lines 86-88:
  • My approach was to simply change the IP Subnet Mask on my home router. My network is 192.168.1.xxx with a default mask of 255.255.255.0. I logged in to the router, changed the IP Subnet Mask to 255.255.254.0, saved the settings, rebooted XP, and then used one of the procedures outlined below. The Subnet Mask change can be left in place permanently if you like.
September 29, 2007, at 01:24 AM by Jim Gasbarro --
Changed lines 87-89 from:
  • My approach was to simply change the IP Subnet Mask on my home router. My network is 192.168.1.xxx with a default mask of 255.255.255.0. I logged in to the router, changed the IP Subnet Mask to 255.255.255.254.0, saved the settings, rebooted XP, and then used one of the procedures outlined below. The Subnet Mask change can be left in place permanently if you like.
to:
  • My approach was to simply change the IP Subnet Mask on my home router. My network is 192.168.1.xxx with a default mask of 255.255.255.0. I logged in to the router, changed the IP Subnet Mask to 255.255.254.0, saved the settings, rebooted XP, and then used one of the procedures outlined below. The Subnet Mask change can be left in place permanently if you like.
September 29, 2007, at 01:17 AM by Jim Gasbarro --
Changed lines 87-89 from:
  • My approach was to simply change the IP Subnet Mask on my home router. My network is 192.168.1.xxx with a default mask of 255.255.255.0. I changed the mask to 255.255.255.254.0, rebooted XP, and then used one of the procedures outlined below. The Subnet Mask change can be left in place permanently if you like.
to:
  • My approach was to simply change the IP Subnet Mask on my home router. My network is 192.168.1.xxx with a default mask of 255.255.255.0. I logged in to the router, changed the IP Subnet Mask to 255.255.255.254.0, saved the settings, rebooted XP, and then used one of the procedures outlined below. The Subnet Mask change can be left in place permanently if you like.
September 29, 2007, at 01:16 AM by Jim Gasbarro --
Changed lines 88-90 from:
to:
September 29, 2007, at 01:14 AM by Jim Gasbarro -- A simple way to route packets to redboot
Changed lines 87-90 from:
to:
  • My approach was to simply change the IP Subnet Mask on my home router. My network is 192.168.1.xxx with a default mask of 255.255.255.0. I changed the mask to 255.255.255.254.0, rebooted XP, and then used one of the procedures outlined below. The Subnet Mask change can be left in place permanently if you like.

JimG?

August 08, 2007, at 02:09 PM by fcarolo -- formatting
Changed line 54 from:
  1. On the Configure IPv4? drop-down, select Manual
to:
  1. On the Configure IPv4 drop-down, select Manual
Changed lines 62-65 from:
  • NOTE: Using a newer Mac(confirmed: MacBook? Pro), you don't even need a crossover cable. The Auto-MDI/MDIX is fast enough that you can use a straight-through cable directly from the Mac to the Slug.
  1. Windows XP SP2? (Common to other versions)\\
to:
  • NOTE: Using a newer Mac (confirmed: MacBook Pro), you don't even need a crossover cable. The Auto-MDI/MDIX is fast enough that you can use a straight-through cable directly from the Mac to the Slug.
  1. Windows XP SP2 (Common to other versions)\\
Changed line 79 from:
  • I was unsuccessful with the above WinXP? approach - my machine is dual-ethernet NIC'd with DHCP normally used for both connections to a router. With a crossover (patch) cable connected from one NIC to the slug (while OFF) I was able to determine which NIC was reported by Control Panel => Network Connections as "Network cable unplugged". Then changed the settings for this NIC (click right on the connection entry and select "Properties" (new dialog opens), then select TCP/IP and click on "Properties" in new dialog) to:\\\
to:
  • I was unsuccessful with the above WinXP approach - my machine is dual-ethernet NIC'd with DHCP normally used for both connections to a router. With a crossover (patch) cable connected from one NIC to the slug (while OFF) I was able to determine which NIC was reported by Control Panel => Network Connections as "Network cable unplugged". Then changed the settings for this NIC (click right on the connection entry and select "Properties" (new dialog opens), then select TCP/IP and click on "Properties" in new dialog) to:\\\
Changed lines 88-90 from:
  1. FreeBSD?
    To add an alias, try ifconfig XX0? alias 192.168.0.2 192.168.0.255, where XX0? is the interface to add the alias to.
to:
  1. FreeBSD
    To add an alias, try ifconfig XX0 alias 192.168.0.2 192.168.0.255, where XX0 is the interface to add the alias to.
Changed lines 150-151 from:
  1. Hit enter when you see the ping reply. You will only get about three lines of ping replies, and if you miss them you will have to power off your slug and try again. When the telnet window opens, hit ctrl+c as fast as you can - RedBoot is available for only a short window of time. If you miss it, the slug will continue to load and you'll have missed your opportunity to get into RedBoot. --CatMarieS?)
to:
  1. Hit enter when you see the ping reply. You will only get about three lines of ping replies, and if you miss them you will have to power off your slug and try again. When the telnet window opens, hit ctrl+c as fast as you can - RedBoot is available for only a short window of time. If you miss it, the slug will continue to load and you'll have missed your opportunity to get into RedBoot. --CatMarieS)
Changed line 154 from:
to:
  1. WindowsKey+R
Changed lines 171-172 from:

sets the time in milliseconds the script should wait for the before sending the ^C. You may have to change this if the RedBoot is not catching the SendKey?.

to:

sets the time in milliseconds the script should wait for the before sending the ^C. You may have to change this if the RedBoot is not catching the SendKey.

Changed line 208 from:

Just a note for localized non-English WinXP? versions:

to:

Just a note for localized non-English WinXP versions:

Changed lines 211-212 from:

the script given above waits for the word "Reply" to come. In non-English WinXP? this will not happen, so you have to replace the word "Reply" by the corresponding word of your localized WinXP?, e.g. "Antwort" in German (look at your command line window). BTW, I had to use an old hub because my VAIO notebook LAN card did not want to connect directly via cross over cable :( -- Anguel Stankov

to:

the script given above waits for the word "Reply" to come. In non-English WinXP this will not happen, so you have to replace the word "Reply" by the corresponding word of your localized WinXP, e.g. "Antwort" in German (look at your command line window). BTW, I had to use an old hub because my VAIO notebook LAN card did not want to connect directly via cross over cable :( -- Anguel Stankov

Changed lines 216-217 from:

Vista Compatiable

to:

Vista Compatible

Changed line 223 from:
  1. Go Start Run and Type in "putty" and hit enter. - In Windows version XP SP2? and higher(Includes vista)you will get an Open File - Security Warning, Please ensure that the box that says "Always ask before opening this file" is not checked off and hit "Run"
to:
  1. Go Start Run and Type in "putty" and hit enter. - In Windows version XP SP2 and higher(Includes vista)you will get an Open File - Security Warning, Please ensure that the box that says "Always ask before opening this file" is not checked off and hit "Run"
Changed lines 256-259 from:

Accessing RedBoot from FreeBSD?

A small variation on the OSX instructions worked under FreeBSD?:

to:

Accessing RedBoot from FreeBSD

A small variation on the OSX instructions worked under FreeBSD:

Changed lines 270-271 from:

This is a fully automated one-liner from the shell. I created it using the manual method and Ethereal, using netcat to mimick the codes (for CTRL-C) being sent. Somehow, root and -vvv seems needed to netcat for this to work (timing issue??). Tested from FC5?. I could not further automate input to RedBoot (yet), which would be a very nice feature.

to:

This is a fully automated one-liner from the shell. I created it using the manual method and Ethereal, using netcat to mimick the codes (for CTRL-C) being sent. Somehow, root and -vvv seems needed to netcat for this to work (timing issue??). Tested from FC5. I could not further automate input to RedBoot (yet), which would be a very nice feature.

August 01, 2007, at 04:01 PM by lithiumc --
Changed line 223 from:
  1. Go Start Run and Type in putty and hit enter. - In Windows version XP SP2? and higher(Includes vista)you will get an Open File - Security Warning, Please ensure you check off the box that says "Always ask before opening this file" and hit "Run"
to:
  1. Go Start Run and Type in "putty" and hit enter. - In Windows version XP SP2? and higher(Includes vista)you will get an Open File - Security Warning, Please ensure that the box that says "Always ask before opening this file" is not checked off and hit "Run"
August 01, 2007, at 03:59 PM by lithiumc --
Changed lines 216-217 from:
  • Vista Compatiable
to:

Vista Compatiable

August 01, 2007, at 03:57 PM by lithiumc -- Alternative automatic Windows Method With Putty
Added lines 215-255:

Alternative automatic Windows Method With Putty

  • Vista Compatiable

For whatever reason the above method did not work for me, so I decided to use Putty since Putty by default send "^C" upon establishing a telnet connection.

  1. Download Putty. You can find putty at the following link http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html.
    • Ensure you download the Telnet and SSH client itself.
  2. Copy Putty to "C:\Windows\System32\" - This assumes "C" is your default windows drive.
  3. Go Start Run and Type in putty and hit enter. - In Windows version XP SP2? and higher(Includes vista)you will get an Open File - Security Warning, Please ensure you check off the box that says "Always ask before opening this file" and hit "Run"
  4. Close putty and run it again and ensure the security warning does not come up again.
  5. With putty open type in all the telnet information for Redboot found above. Host Name(192.168.0.1), Port(9000) and Connection Type(Telnet). Save the session settings as "red".
  6. Once you have saved the settings, close putty and start notepad, copy the code below and paste it into the Notepad window you just opened. Save the file as "redBootSlug.bat". Ensure the extension is ".bat"
  7. Run the batch file.
    • Note in Vista you will need to run the command prompt as administrator. Then change to the directory where you have the batch file saved. At the prompt type in "redBootSlug.bat" and hit enter.
    • Enusre that you run bat file with the slug turned off and that you turn on the slug only when ping timeout notices start. After a few seconds you will be in RedBoot mode. I have yet to see the following script fail, that is probably due to the fact that putty sends the "^C" command upon immediatley establishing telnet connection. --lithiumc

The batch code follows:

echo off
echo Set objShell = WScript.CreateObject("WScript.Shell") > redbootSlug.vbs
echo Set objExecObject = objShell.Exec("cmd /c ping -t -w 1 192.168.0.1") >> redbootSlug.vbs
echo Wscript.Echo "Start slug after first ping timeout..." >> redbootSlug.vbs
echo Do While Not objExecObject.StdOut.AtEndOfStream >> redbootSlug.vbs
echo     strText = objExecObject.StdOut.ReadLine() >> redbootSlug.vbs
echo     Wscript.Echo strText >> redbootSlug.vbs
echo     If Instr(strText, "Reply") > 0 Then >> redbootSlug.vbs
echo         Exit Do >> redbootSlug.vbs
echo     End If >> redbootSlug.vbs
echo Loop >> redbootSlug.vbs
echo objShell.Run("putty -load red") >> redbootSlug.vbs
echo Do Until Success = True >> redbootSlug.vbs
echo     Success = objShell.AppActivate("putty") >> redbootSlug.vbs
echo 	 Wscript.Sleep 200 >> redbootSlug.vbs
echo Loop >> redbootSlug.vbs
echo objShell.SendKeys "version" >> redbootSlug.vbs
echo objShell.SendKeys "{ENTER}" >> redbootSlug.vbs
echo Wscript.Echo "Done... You can close this command window." >> redbootSlug.vbs
echo Wscript.Quit >> redbootSlug.vbs

CALL CScript redbootSlug.vbs
del redbootSlug.vbs
July 13, 2007, at 11:18 PM by Dave Lane -- Added comments about using Hyper Terminal and Telnet under Vista
Changed lines 142-143 from:
to:

Comment: Microsoft have seen fit to remove Hyper Terminal from Windows Vista. -- Dave Lane

Changed lines 213-214 from:
to:

Comment: Users of Windows Vista will need to manually add Telnet support using the "Turn Windows Features on or off" link in Control Panel. -- Dave Lane

July 11, 2007, at 09:52 PM by pedxing -- Smaller mask is better
Changed lines 95-96 from:

Changing your subnet may be an easy option if you already use a router which doles out IP addresses to your PC (via DHCP). Many home routers default to IP addresses of the form 192.168.1.xxx, subnet mask of 255.255.255.0 If this is you, telling the router (via its web or telnet interface) to use a subnet mask of 255.255.0.0 may be all that's required.

to:

Changing your subnet may be an easy option if you already use a router which doles out IP addresses to your PC (via DHCP). Many home routers default to IP addresses of the form 192.168.1.xxx or 192.168.2.xxx, subnet mask of 255.255.255.0 If this is you, telling the router (via its web or telnet interface) to use a subnet mask of 255.255.252.0 may be all that's required, since this mask includes all addresses from 192.168.0.1 through 192.168.3.254.

June 11, 2007, at 02:48 PM by mwester -- remove spam
Changed lines 1-525 from:

BB3NEM? http://daddelnews.de/news_details.php3 cheap loan [url=http://tramtramaadol.forumlivre.com/index.php]loan rate[/url] loan rate <a href="http://myblog.es/blade/gb">loan rate</a> loan rate

to:

Purpose

The purpose of this page is to help you get access to the RedBoot bootloader.

The main reason for accessing the RedBoot bootloader is when you are attempting to Recover From A Bad Flash.

About RedBoot

RedBoot is a bootloader. The bootloader's job is to load things into the computer's memory and start up the OS, in this case Linux or the original NSLU2 firmware (which is Linux based, as well).

RedBoot is quite sophisticated, and has a user interface that you can access by telnet or serial. You can use it to load things into memory by TFTP, write to flash, and similar tasks. You should also be cautious when accessing RedBoot, as you can muck up the basic behaviour of the slug if you're not careful.

For more information about RedBoot in general, consult Red Hat's website or use Google.

How does RedBoot access work on the NSLU2?

When the slug starts up, for a few seconds RedBoot will listen for telnet connections on port 9000. RedBoot will insist on being 192.168.0.1 for this window, regardless of what you've set the address of the normal Linux portion of your slug to be. If it doesn't receive a telnet connection during that window, it will attempt to load the Linux kernel into main memory from flash and execute it.

Preparation for RedBoot access

Before attempting to access RedBoot, there are some problem that you may need to sort out first.

  1. Ethernet Cable Linkage

    Since 192.168.0.1 could conflict with other equipment on many people's LANs, it is often easier to access RedBoot if it is setup either on it's own dedicated network or directly to your computer with a crossover cable.

    However, if you have a fancy network card with auto-MDI/MDIX (i.e. you don't need to worry about whether to use a straight through or a crossover cable, as with all new Macs for instance) you may end up missing the brief telnet window as your computer's Ethernet card tries to work out what sex it should be.

    An easy way to get around this is by connecting via a cheap hub which doesn't have such hangups. Be aware that an Ethernet switch with spanning tree enabled will cause you to miss the window of opportunity too. The port will not enter forwarding state fast enough. Some vendors have features to override this (Eg. Cisco has PortFast).

    You could also try to set your Ethernet card to disable auto-MDI/MDIX, but this may be hard to do and may complicate your life in the future if you forget to turn it back on.
  2. IP Address Setup

    Your computer might not also be setup to talk on the 192.168.0.x network.

    If your computer is not on the 192.168.0.x subnet, you can either change its address temporarily or add a new route.

    1. Linux
      su to root and execute the command route add 192.168.0.1 eth0

      Alternately, set up an alias interface, like so:
      ifconfig eth0:1 inet 192.168.0.2 broadcast 192.168.0.255 netmask 255.255.255.0
      Adding an alias will also automatically add a subnet route.
    2. OS X
    • Determine the MAC address of your slug. arp -a
      • For example: ? (192.168.1.1) at 00:a0:c5:45:0b:17 on en0 [ethernet]
    • Setup en0 (or another port) to work with the slug
      1. Go to System Preferences >> Network
      2. Select Built-in Ethernet (or your Network Adapter Choice)
      3. On the Configure IPv4? drop-down, select Manual
      4. Set the IP Address to 192.168.0.2
      5. Set the Subnet Mask to 255.255.255.0
    • Setup an route
      1. Open Terminal and type: sudo arp -s 192.168.0.1 <00:a0:c5:45:0b:17> where 00:a0:c5:45:0b:17 is the MAC address of your slug.
    • A good GUI for TFTP is TFTP Server: http://ww2.unime.it/flr/tftpserver/
    • Continue following this guide.
      • The easiest way is to use the TCL script. The ping, perl, and C scripts do not seem to work on OS X.
      • NOTE: Using a newer Mac(confirmed: MacBook? Pro), you don't even need a crossover cable. The Auto-MDI/MDIX is fast enough that you can use a straight-through cable directly from the Mac to the Slug.
    1. Windows XP SP2? (Common to other versions)
      Your computer must have a fixed IP address.
      Goto Network Connections on the Control Panel.
      Choose your Network card that it's connected to the NSLU2 via a crossover cable or via network switch (I have this and it worked)
      Select Properties
      Select TCP/IP Protocol on the List and again the button properties. Again make sure that you have a FIXED IP.
      Select Advanced
      Add a SECONDARY IP by selecting the ADD button on below the box that shows the current fixed IP.
      Input 192.168.0.2
      Exit all windows with Apply and Ok.
      Open an MS-DOS windows.
      Try to ping the new IP 192.168.0.2. It should work.
      Proceed to the next steps.
      • I was unsuccessful with the above WinXP? approach - my machine is dual-ethernet NIC'd with DHCP normally used for both connections to a router. With a crossover (patch) cable connected from one NIC to the slug (while OFF) I was able to determine which NIC was reported by Control Panel => Network Connections as "Network cable unplugged". Then changed the settings for this NIC (click right on the connection entry and select "Properties" (new dialog opens), then select TCP/IP and click on "Properties" in new dialog) to:

        Select radio button for "Use the following IP address:" and set the following values:
        IP Address: 192.168.0.100
        Subnet: 255.255.255.0
        Default gateway: 192.168.0.1

        Note that at command prompt a 'ping 192.168.0.100' or 'ping 192.168.0.1' w/the slug OFF will NOT get a reply, but when you move to the next step (I used the 'An automatic Windows method' {using WSH} below) it will succeed. Don't forget to change the network connection back to using DHCP when you're done if you need to...

        DonV
    2. FreeBSD?
      To add an alias, try ifconfig XX0? alias 192.168.0.2 192.168.0.255, where XX0? is the interface to add the alias to.
  3. Hosts setup (to prevent Telnet RDNS timeout)

    If it takes a long time (~30 seconds) for telnet to display the Trying 192.168.0.1... message, it may be that telnet is trying to do a Reverse DNS lookup, and timing out (this happened on my fresh install of Fedora Core 4). To get into RedBoot, telnet needs to execute immediately, so try adding 192.168.0.1 to your /etc/hosts (or c:\WINDOWS\system32\drivers\etc\hosts) file. For example, call it 'slug' and then use telnet slug 9000 instead of the IP address.


Changing your subnet may be an easy option if you already use a router which doles out IP addresses to your PC (via DHCP). Many home routers default to IP addresses of the form 192.168.1.xxx, subnet mask of 255.255.255.0 If this is you, telling the router (via its web or telnet interface) to use a subnet mask of 255.255.0.0 may be all that's required.

Trying To Access RedBoot

The main trick with accessing RedBoot is the shortness of the telnet window. Since the telnet port is only alive for 2 seconds, it can be a bit of a challenge to do everything required within that time frame. You must:

  1. Recognise when the telnet session is available
  2. Start your telnet client talking to 192.168.0.1 9000
  3. Once telnet connects, press Ctrl-C to tell RedBoot you want access (try telnet in vt100 mode, if you receive strange characters instead of a readable prompt)

We will first describe basic manual methods of accessing RedBoot and then delve into more automated methods.

Accessing RedBoot from *nix

Manual Methods

  • sudo arping -f 192.168.0.1; telnet 192.168.0.1 9000
    • The telnet starts trying as soon as the IP address on the slug will respond, and all you have to do is remember to press Ctrl+C. :)
    • NOTE: If your arping doesn't understand -f, you probably have the standalone "arping" package. Install the version from iputils instead. (For Debian: apt-get install iputils-arping)
  • ping -f 192.168.0.1; telnet 192.168.0.1 9000
    • This will display a continous set of points (one for each packet that didn't had a response). When you see the points stopping from filling your screen, then you have to press Ctrl+C twice (once to stop the ping and one for the RedBoot prompt).
  • ping -c 1 -f 192.168.0.1; telnet 192.168.0.1 9000
    • This is a minor variation that will save you one Ctrl+C:
  • while ! ping -W 1 -c 1 192.168.0.1 2>&1 >/dev/null; do true; done && telnet 192.168.0.1 9000
    • This method is the variation of the previous two methods, with the advantage that it does not require root privileges to run.
    • This command will keep pinging RedBoot's IP address until first success, and then open into RedBoot where you'll have to press Ctrl+C to stop it form auto booting.

Accessing RedBoot from Windows

This worked for me. You can use similar ideas for any other graphical environment.

  1. Open a Windows command prompt (ie by typing cmd at the start and run prompt)
  2. At the command prompt type ping -t -w 1 192.168.0.1
  3. Do this process a couple more times and arrange the windows so that they're all visible.
    • This increases the number of pings and gives you a better chance of seeing the very short reply window you have to work with.
  4. Open hyper terminal and set this to connect via winsocks to 192.168.0.1 on port 9000.
  5. Set both windows so you can see them, set the ping running and have hyperterminal in the foreground.
  6. With your left hand on the mouse button and the mouse cursor over the connect buttonin hyperterminal, turn on the NSLU.
    • Move your other hand ready to hit Ctrl+C
  7. Watch the CMD windows. In about 5 seconds with the Ready light coloured amber, you should see a ping from 192.168.0.1
  8. Hit the mouse button with one hand and then Ctrl+C with the other.
    • If the Ready light starts to flash green it means you missed the window so try again. You will need to power cycle (by pressing ON button) the NSLU2 and reconnect it to reset it.

With newer versions (2007) the LED colour scheme is different. Just power cycle the slug and watch how many pings get lost until the redboot time-window opens after powering up. Use a Ethernet switch if your NIC takes too long to link up with a crossover cable.

Another option:

  1. Open a command window by typing "cmd" into the run window.
  2. Type "ping -t -w 1 192.168.0.1" and let it run.
  3. Open a second command window and type "telnet 192.168.0.1 9000" but don't hit enter.
  4. Turn on the slug. Have the second command window be your focus, but watch the pings from the first window.
  5. Hit enter when you see the ping reply. You will only get about three lines of ping replies, and if you miss them you will have to power off your slug and try again. When the telnet window opens, hit ctrl+c as fast as you can - RedBoot is available for only a short window of time. If you miss it, the slug will continue to load and you'll have missed your opportunity to get into RedBoot. --CatMarieS?)

A mouseless option:

  1. WindowsKey?+R
  2. Type cmd
  3. Repeat Steps 1-2
  4. Type ping -t -w 1 192.168.0.1 in the first command-window
  5. Type telnet 192.168.0.1 9000 in the second command-window
  6. Power the slug
  7. Push <ENTER> in the second command-window as soon as you see the ping reply
  8. Push <Ctrl+C> in the second command-window as soon as the telnet window opens

NOTE: On some systems you should ensure that the "Speed & Duplex" setting of your network card is set to "100 MBit? Full". "Auto" won't work. --cweber

An automatic Windows method:

As long as the steps have been followed in the “Preparation for RedBoot access” section of this Wiki, and if Windows Script Host is installed on your system (It should be on 2000 and XP systems. If not it can be d/l’ed from the Microsoft website.) the following batch file should boot the slug into RedBoot, if it does not try it again. Sometimes the ping is not caught. Also, the line:

echo Wscript.Sleep 500 >> redbootSlug.vbs

sets the time in milliseconds the script should wait for the before sending the ^C. You may have to change this if the RedBoot is not catching the SendKey?.

For those who do not know how to create a batch file:

Open up Notepad and copy the code below and paste it into the Notepad window you just opened. Save the contents of the Notepad window to a file; it should end in “.txt”. In Windows Explorer, find the file you just saved and rename it “redBootSlug.bat”. You may get a message about changing the extension; if you do, just click yes.

With the slug turned off, run the batch file. When the ping timeout notices start, turn on the slug, and with any luck in a few seconds you should be in RedBoot mode. Again, if the slug boots up normally, try the batch file again. To end a script that has not caught the ping message, just close the command window.

The batch code follows:

echo off
echo Set objShell = WScript.CreateObject("WScript.Shell") > redbootSlug.vbs
echo Set objExecObject = objShell.Exec("cmd /c ping -t -w 1 192.168.0.1") >> redbootSlug.vbs
echo Wscript.Echo "Start slug after first ping timeout..." >> redbootSlug.vbs
echo Do While Not objExecObject.StdOut.AtEndOfStream >> redbootSlug.vbs
echo     strText = objExecObject.StdOut.ReadLine() >> redbootSlug.vbs
echo     Wscript.Echo strText >> redbootSlug.vbs
echo     If Instr(strText, "Reply") > 0 Then >> redbootSlug.vbs
echo         Exit Do >> redbootSlug.vbs
echo     End If >> redbootSlug.vbs
echo Loop >> redbootSlug.vbs
echo objShell.Run("Telnet 192.168.0.1 9000") >> redbootSlug.vbs
echo Do Until Success = True >> redbootSlug.vbs
echo     Success = objShell.AppActivate("Telnet") >> redbootSlug.vbs
echo Loop >> redbootSlug.vbs
echo Wscript.Sleep 500 >> redbootSlug.vbs
echo objShell.SendKeys "^C" >> redbootSlug.vbs
echo Wscript.Echo "Done... You can close this command window." >> redbootSlug.vbs
echo Wscript.Quit >> redbootSlug.vbs

CALL CScript redbootSlug.vbs
del redbootSlug.vbs

This line is not part of the batch code… I hope this helps. --dmbaker

Comment: Thanks a lot, this nice script really does the job automatically :) Just a note for localized non-English WinXP? versions: In the following line echo If Instr(strText, "Reply") > 0 Then >> redbootSlug.vbs the script given above waits for the word "Reply" to come. In non-English WinXP? this will not happen, so you have to replace the word "Reply" by the corresponding word of your localized WinXP?, e.g. "Antwort" in German (look at your command line window). BTW, I had to use an old hub because my VAIO notebook LAN card did not want to connect directly via cross over cable :( -- Anguel Stankov

Accessing RedBoot from FreeBSD?

A small variation on the OSX instructions worked under FreeBSD?:

 # Ping using a fraction of a second (must be root to do so)
 # Turn off name lookup on telnet
 sudo ping -i .3 -o 192.168.0.1 ;  telnet -N 192.168.0.1 9000

Automated Methods

Note: Once you succeed in connecting to 192.168.0.1 port 9000 and sending in a control-C to halt the automatic boot process, RedBoot will keep listening on 192.168.0.1:9000 until the next reboot. This means you that if you can automate catching the telnet you'll subsequently be able to telnet in manually.

Netcat

This is a fully automated one-liner from the shell. I created it using the manual method and Ethereal, using netcat to mimick the codes (for CTRL-C) being sent. Somehow, root and -vvv seems needed to netcat for this to work (timing issue??). Tested from FC5?. I could not further automate input to RedBoot (yet), which would be a very nice feature.

This one-liner has been reformatted on to several lines, but should be executed on a single line. As root:

 echo -e "\0377\0364\0377\0375\0006" >break.bin; sudo /sbin/arping -f 192.
 168.0.1; sudo nc -D -vvv 192.168.0.1 9000 <break.bin; telnet 192.168.0.1 9000

-- Leon Woestenberg (likewise @IRC).

TCL Script

The following TCL script automates the process of telnet-ing in and issuing the control-C (and also dumps the RedBoot version info). Once the script has done the time-sensitive work you can telnet in at your leisure using your favorite telnet client.

The script was written on Windows. Tested on Windows, OS X. Should Work: Linux, Unix.

Preconditions: You need to run this from a machine can see the slug's 192.168.0.1 address.

 set done  0
 set state START

 proc on_nslu_writable { sock } {

     global state
     fileevent $sock writable ""
     if { $state == "START" } {

         puts "Connected to NSLU2..."
         set state CONN
         fileevent $sock readable [ list on_nslu_readable $sock ]
         after 1000 [list puts $sock ""]
     }
 }

 proc on_nslu_readable { sock } {

     global done state
     set data [read $sock]
     if { [eof $sock] } { puts "Got EOF - Failed."; exit }
     puts $data

     if { [string first "enter ^C to abort" $data] > 0 } {

         puts -nonewline $sock [format "%c" 3]

     } elseif { [string first "RedBoot>" $data] >= 0 } {

         if { $state == "SENTVER" } {
             set done 1
             puts ""
             puts -nonewline " Success - You should now be able"
             puts " to telnet to 192.168.0.1:9000"
         } else {
             puts $sock "version"
             set state SENTVER
         }
     }
 }

 proc try_nslu { } {

     global state
     if { $state == "START" } {
         set sock [socket -async "192.168.0.1" 9000]
         fileevent $sock writable [ list on_nslu_writable $sock ]
         fconfigure $sock -blocking false -buffering none
         after 500 try_nslu
     }
 }

 try_nslu
 vwait done

Example Usage:

  1. Save the script into a file (we'll assume you call it RedBoot.tcl).
  2. Run the script (e.g. tclsh RedBoot.tcl)
  3. Power up the slug.
  4. If everything works you should see:
 Connected to NSLU2...
 == Executing boot script in 1.800 seconds - enter ^C to abort

 ^C
 RedBoot>

 RedBoot(tm) bootstrap and debug environment [ROMRAM]
 Red Hat certified release, version 1.92 - built 15:16:07, Feb  3 2004

 Platform: IXDP425 Development Platform (XScale) 
 Copyright (C) 2000, 2001, 2002, Red Hat, Inc.

 RAM: 0x00000000-0x02000000, 0x000723a0-0x01ff3000 available
 FLASH: 0x50000000 - 0x50800000, 64 blocks of 0x00020000 bytes each.
 RedBoot>

 Success - You should now be able to telnet to 192.168.0.1:9000

-- Adrian Shotton

Perl Script

Here is a Perl script to automate the entire process.

  • Uses upslug (installed in /usr/local/bin) to reset the slug.
  • Assumes you have done ifconfig eth0:1 192.168.0.2 or something similar so you can reach the 192.168.0 net.
  • Assumes you are running as root.
  • Assumes you have Net::Telnet installed (OS X doesn't by default)
  • Tosses you into a telnet session after aborting the boot sequence.
 #!/usr/bin/perl -w
 # telnet_redboot.pl - ./upslug --reset;arping -f 192.168.0.1;telnet 192.168.0.1 9000

 use Net::Telnet ();

 my $host = '192.168.0.1';

 system("/usr/local/bin/upslug -r");
 printf("NSLU2 reset\n");
 system("/sbin/arping -f $host");
 printf("NSLU2 arping response\n");

 my $t = new Net::Telnet (Port => 9000, Timeout => 30);
 if(!defined($t)){
     print "new Net::Telnet failed\n";
     exit(1);
 } # if
 my $ok;
 $ok = $t->errmode("return");
 $ok = $t->open($host);
 if(!defined($ok)){
     print "open('$host') failed\n";
     $t->close();
     exit(1);
 } # if

 # == Executing boot script in 1.930 seconds - enter ^C to abort

 my $line;
 while($line = $t->getline()){
        $line =~ s/[\r\n]//;
        print "-> $line\n";
        if($line =~ m/enter \^C to abort/){
                $t->put(chr(3)); # send ^C
                print "<- \^C\n";
                $t->close();
                sleep(1);
                system("telnet $host 9000");
                exit(0);
        } # if
 } # while
 $t->close();

C program using Berkeley Sockets

The following C program will attempt a connection 10 times/second. After it successed it will send the control-C character, wait for a response, and then drop you into a telnet session. It's trivial to modify this program to run an arbitrary program with stdin/stdout connected to the slug instead of your terminal.

The telnet session has the tilde '~' character as the escape code. That can be very useful if the connection isn't dropped after a reset!

As always you can subsequently reconnect with telnet until the next reboot.

Tested on Debian linux (2006-02-12).

Preconditions: You need to run this from a machine can see the slug's 192.168.0.1 address.

#include <stdio.h>
 #include <unistd.h>
 #include <errno.h>
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <sys/time.h>
 #include <netdb.h>

 #define SLUG_IP     "192.168.0.1" 
 #define SLUG_PORT   "9000"

 #define TELNET      "/usr/bin/telnet"

 char * const telnet_args[] = { "telnet", "-e", "~", SLUG_IP, SLUG_PORT, NULL };

 int main()
 {
    struct sockaddr_in sin;
    fd_set rfds, wfds;
    struct timeval timeout;
    int n;
    char buffer[1024];
    time_t stoptime = time(NULL);
    char outbound[] = { 0x03, 0x00 };
    char *out = outbound;

    int s = socket(PF_INET, SOCK_STREAM, 0);

    // set up socket address for port 9000 at 192.168.0.1
    struct hostent *h = gethostbyname(SLUG_IP);
    sin.sin_family = h->h_addrtype;
    sin.sin_port = htons(atoi(SLUG_PORT));
    memcpy(&sin.sin_addr, h->h_addr_list[0], h->h_length);

    // attempt to connect to remote system.
    while (connect(s, (struct sockaddr *) &sin, sizeof sin) == -1) {
        switch (errno) {
            case ECONNREFUSED:
            case ENETUNREACH:
            case EHOSTUNREACH:
                timeout.tv_sec = 0;
                timeout.tv_usec = 100000;  // every 100 ms
                select(1, NULL, NULL, NULL, &timeout);
                continue;
            default:
                fprintf(stderr, "connect error: %s (%s)\n",
                        strerror(errno), h->h_name);
                return errno;
        }
    }

    FD_ZERO(&rfds);
    FD_ZERO(&wfds);
    stoptime = time(NULL) + 15;
    while (difftime(stoptime, time(NULL)) > 0) {
        FD_SET(s, &rfds);
        FD_SET(s, &wfds);
        timeout.tv_sec = 0;
        timeout.tv_usec = 10000;  // every 10 ms
        n = select(s+1, &rfds, &wfds, NULL, &timeout);
        if (n == -1) {
            fprintf(stderr, "select error: %s\n", strerror(errno));
            return errno;
        }

        if (n == 0) { continue; }

        if (*out != 0 && FD_ISSET(s, &wfds)) { write(s, out++, 1); }

        if (FD_ISSET(s, &rfds)) {
            n = read(s, buffer, sizeof buffer);
            write(1, buffer, n);
            close(s);
            execv(TELNET, telnet_args);
            fprintf(stderr, "exec (%s): %s\n", TELNET, strerror(errno));
            exit(0); // just in case
        }
    }

    fprintf(stderr, "could not capture telnet port");
    close(s);

    return 0;
 }

-- Bear

Example using Red Hat Linux

You have to do the Ctrl+C really really quick.

 [root@dual root]# arping -f 192.168.0.1;telnet 192.168.0.1 9000
 ARPING 192.168.0.1 from 192.168.1.253 eth0
 Unicast reply from 192.168.0.1 [00:0F:66:7B:FE:96]  9.641ms
 Sent 7 probes (7 broadcast(s))
 Received 1 response(s)
 Trying 192.168.0.1...
 Connected to 192.168.0.1 (192.168.0.1).
 Escape character is '^]'.
 == Executing boot script in 1.820 seconds - enter ^C to abort
 ^C
 RedBoot>

The animated version.

Sources: [http://groups.yahoo.com/group/nslu2-linux/message/1096][http://groups.yahoo.com/group/nslu2-linux/message/1106]

Example using Ubuntu

I open a terminal and use the following command to get a root prompt:

 sudo su

I then use the following command to be able to access the NSLU2. My network is otherwise the typical 192.168.1.x:

 route add 192.168.0.1 eth0

My WRT54G router subnet is 255.255.255.0, and my NSLU2 is connected through a network switch, but this worked fine anyway.

  • Then I make sure my NSLU2 is powered _off_.

This is so I have all the time in the world to hit Ctrl-C when arping gets a reply. Now I use the following command to wait for telnet contact:

 arping -f 192.168.0.1; telnet 192.168.0.1 9000

The terminal now shows the following and waits for the NSLU2 to respond, which of course it won't do until I power it on:

 ARPING 192.168.0.1 from 192.168.1.102 eth0
  • Now I power _on_ the NSLU2.

Then I watch the terminal for a reply, such as the following:

 Unicast reply from 192.168.0.1 [00:18:39:31:64:A4]  6.125ms
 Sent 103 probes (103 broadcast(s))
 Received 1 response(s)
 Trying 192.168.0.1...
 Connected to 192.168.0.1.
 Escape character is '^]'.
 == Executing boot script in 1.910 seconds - enter ^C to abort

Finally, I immediately hit Ctrl-C and receive the RedBoot prompt in the terminal as shown below:

 ^C
 RedBoot>
June 11, 2007, at 07:11 AM by loan rate -- loan rate
Changed line 1 from:

8TXPB http://otyanoma.net/~raiden/ragn/htdocs/mt/archives/000140.html mortgage refinance rate [url=http://gaestebuch4u.de/gb/levitablog.html]cheap loan[/url] cheap loan <a href="http://blog.livedoor.jp/strategic_keiba/archives/51946388.html">cheap loan</a> cheap loan

to:

BB3NEM? http://daddelnews.de/news_details.php3 cheap loan [url=http://tramtramaadol.forumlivre.com/index.php]loan rate[/url] loan rate <a href="http://myblog.es/blade/gb">loan rate</a> loan rate

June 11, 2007, at 07:11 AM by mortgage refinance -- mortgage refinance
Changed line 1 from:

UF8SIU? http://otyanoma.net/~raiden/ragn/mtcgi/mt-comments.cgi mortgage [url=http://gaestebuch4u.de/gb/Edirewan.html]mortgage refinance[/url] mortgage refinance <a href="http://shellbutton.net/cp-bin/blog/index.php">loan rate</a> loan rate

to:

8TXPB http://otyanoma.net/~raiden/ragn/htdocs/mt/archives/000140.html mortgage refinance rate [url=http://gaestebuch4u.de/gb/levitablog.html]cheap loan[/url] cheap loan <a href="http://blog.livedoor.jp/strategic_keiba/archives/51946388.html">cheap loan</a> cheap loan

June 11, 2007, at 07:11 AM by loan rate -- loan rate
Changed lines 1-525 from:

Purpose

The purpose of this page is to help you get access to the RedBoot bootloader.

The main reason for accessing the RedBoot bootloader is when you are attempting to Recover From A Bad Flash.

About RedBoot

RedBoot is a bootloader. The bootloader's job is to load things into the computer's memory and start up the OS, in this case Linux or the original NSLU2 firmware (which is Linux based, as well).

RedBoot is quite sophisticated, and has a user interface that you can access by telnet or serial. You can use it to load things into memory by TFTP, write to flash, and similar tasks. You should also be cautious when accessing RedBoot, as you can muck up the basic behaviour of the slug if you're not careful.

For more information about RedBoot in general, consult Red Hat's website or use Google.

How does RedBoot access work on the NSLU2?

When the slug starts up, for a few seconds RedBoot will listen for telnet connections on port 9000. RedBoot will insist on being 192.168.0.1 for this window, regardless of what you've set the address of the normal Linux portion of your slug to be. If it doesn't receive a telnet connection during that window, it will attempt to load the Linux kernel into main memory from flash and execute it.

Preparation for RedBoot access

Before attempting to access RedBoot, there are some problem that you may need to sort out first.

  1. Ethernet Cable Linkage

    Since 192.168.0.1 could conflict with other equipment on many people's LANs, it is often easier to access RedBoot if it is setup either on it's own dedicated network or directly to your computer with a crossover cable.

    However, if you have a fancy network card with auto-MDI/MDIX (i.e. you don't need to worry about whether to use a straight through or a crossover cable, as with all new Macs for instance) you may end up missing the brief telnet window as your computer's Ethernet card tries to work out what sex it should be.

    An easy way to get around this is by connecting via a cheap hub which doesn't have such hangups. Be aware that an Ethernet switch with spanning tree enabled will cause you to miss the window of opportunity too. The port will not enter forwarding state fast enough. Some vendors have features to override this (Eg. Cisco has PortFast).

    You could also try to set your Ethernet card to disable auto-MDI/MDIX, but this may be hard to do and may complicate your life in the future if you forget to turn it back on.
  2. IP Address Setup

    Your computer might not also be setup to talk on the 192.168.0.x network.

    If your computer is not on the 192.168.0.x subnet, you can either change its address temporarily or add a new route.

    1. Linux
      su to root and execute the command route add 192.168.0.1 eth0

      Alternately, set up an alias interface, like so:
      ifconfig eth0:1 inet 192.168.0.2 broadcast 192.168.0.255 netmask 255.255.255.0
      Adding an alias will also automatically add a subnet route.
    2. OS X
    • Determine the MAC address of your slug. arp -a
      • For example: ? (192.168.1.1) at 00:a0:c5:45:0b:17 on en0 [ethernet]
    • Setup en0 (or another port) to work with the slug
      1. Go to System Preferences >> Network
      2. Select Built-in Ethernet (or your Network Adapter Choice)
      3. On the Configure IPv4? drop-down, select Manual
      4. Set the IP Address to 192.168.0.2
      5. Set the Subnet Mask to 255.255.255.0
    • Setup an route
      1. Open Terminal and type: sudo arp -s 192.168.0.1 <00:a0:c5:45:0b:17> where 00:a0:c5:45:0b:17 is the MAC address of your slug.
    • A good GUI for TFTP is TFTP Server: http://ww2.unime.it/flr/tftpserver/
    • Continue following this guide.
      • The easiest way is to use the TCL script. The ping, perl, and C scripts do not seem to work on OS X.
      • NOTE: Using a newer Mac(confirmed: MacBook? Pro), you don't even need a crossover cable. The Auto-MDI/MDIX is fast enough that you can use a straight-through cable directly from the Mac to the Slug.
    1. Windows XP SP2? (Common to other versions)
      Your computer must have a fixed IP address.
      Goto Network Connections on the Control Panel.
      Choose your Network card that it's connected to the NSLU2 via a crossover cable or via network switch (I have this and it worked)
      Select Properties
      Select TCP/IP Protocol on the List and again the button properties. Again make sure that you have a FIXED IP.
      Select Advanced
      Add a SECONDARY IP by selecting the ADD button on below the box that shows the current fixed IP.
      Input 192.168.0.2
      Exit all windows with Apply and Ok.
      Open an MS-DOS windows.
      Try to ping the new IP 192.168.0.2. It should work.
      Proceed to the next steps.
      • I was unsuccessful with the above WinXP? approach - my machine is dual-ethernet NIC'd with DHCP normally used for both connections to a router. With a crossover (patch) cable connected from one NIC to the slug (while OFF) I was able to determine which NIC was reported by Control Panel => Network Connections as "Network cable unplugged". Then changed the settings for this NIC (click right on the connection entry and select "Properties" (new dialog opens), then select TCP/IP and click on "Properties" in new dialog) to:

        Select radio button for "Use the following IP address:" and set the following values:
        IP Address: 192.168.0.100
        Subnet: 255.255.255.0
        Default gateway: 192.168.0.1

        Note that at command prompt a 'ping 192.168.0.100' or 'ping 192.168.0.1' w/the slug OFF will NOT get a reply, but when you move to the next step (I used the 'An automatic Windows method' {using WSH} below) it will succeed. Don't forget to change the network connection back to using DHCP when you're done if you need to...

        DonV
    2. FreeBSD?
      To add an alias, try ifconfig XX0? alias 192.168.0.2 192.168.0.255, where XX0? is the interface to add the alias to.
  3. Hosts setup (to prevent Telnet RDNS timeout)

    If it takes a long time (~30 seconds) for telnet to display the Trying 192.168.0.1... message, it may be that telnet is trying to do a Reverse DNS lookup, and timing out (this happened on my fresh install of Fedora Core 4). To get into RedBoot, telnet needs to execute immediately, so try adding 192.168.0.1 to your /etc/hosts (or c:\WINDOWS\system32\drivers\etc\hosts) file. For example, call it 'slug' and then use telnet slug 9000 instead of the IP address.


Changing your subnet may be an easy option if you already use a router which doles out IP addresses to your PC (via DHCP). Many home routers default to IP addresses of the form 192.168.1.xxx, subnet mask of 255.255.255.0 If this is you, telling the router (via its web or telnet interface) to use a subnet mask of 255.255.0.0 may be all that's required.

Trying To Access RedBoot

The main trick with accessing RedBoot is the shortness of the telnet window. Since the telnet port is only alive for 2 seconds, it can be a bit of a challenge to do everything required within that time frame. You must:

  1. Recognise when the telnet session is available
  2. Start your telnet client talking to 192.168.0.1 9000
  3. Once telnet connects, press Ctrl-C to tell RedBoot you want access (try telnet in vt100 mode, if you receive strange characters instead of a readable prompt)

We will first describe basic manual methods of accessing RedBoot and then delve into more automated methods.

Accessing RedBoot from *nix

Manual Methods

  • sudo arping -f 192.168.0.1; telnet 192.168.0.1 9000
    • The telnet starts trying as soon as the IP address on the slug will respond, and all you have to do is remember to press Ctrl+C. :)
    • NOTE: If your arping doesn't understand -f, you probably have the standalone "arping" package. Install the version from iputils instead. (For Debian: apt-get install iputils-arping)
  • ping -f 192.168.0.1; telnet 192.168.0.1 9000
    • This will display a continous set of points (one for each packet that didn't had a response). When you see the points stopping from filling your screen, then you have to press Ctrl+C twice (once to stop the ping and one for the RedBoot prompt).
  • ping -c 1 -f 192.168.0.1; telnet 192.168.0.1 9000
    • This is a minor variation that will save you one Ctrl+C:
  • while ! ping -W 1 -c 1 192.168.0.1 2>&1 >/dev/null; do true; done && telnet 192.168.0.1 9000
    • This method is the variation of the previous two methods, with the advantage that it does not require root privileges to run.
    • This command will keep pinging RedBoot's IP address until first success, and then open into RedBoot where you'll have to press Ctrl+C to stop it form auto booting.

Accessing RedBoot from Windows

This worked for me. You can use similar ideas for any other graphical environment.

  1. Open a Windows command prompt (ie by typing cmd at the start and run prompt)
  2. At the command prompt type ping -t -w 1 192.168.0.1
  3. Do this process a couple more times and arrange the windows so that they're all visible.
    • This increases the number of pings and gives you a better chance of seeing the very short reply window you have to work with.
  4. Open hyper terminal and set this to connect via winsocks to 192.168.0.1 on port 9000.
  5. Set both windows so you can see them, set the ping running and have hyperterminal in the foreground.
  6. With your left hand on the mouse button and the mouse cursor over the connect buttonin hyperterminal, turn on the NSLU.
    • Move your other hand ready to hit Ctrl+C
  7. Watch the CMD windows. In about 5 seconds with the Ready light coloured amber, you should see a ping from 192.168.0.1
  8. Hit the mouse button with one hand and then Ctrl+C with the other.
    • If the Ready light starts to flash green it means you missed the window so try again. You will need to power cycle (by pressing ON button) the NSLU2 and reconnect it to reset it.

With newer versions (2007) the LED colour scheme is different. Just power cycle the slug and watch how many pings get lost until the redboot time-window opens after powering up. Use a Ethernet switch if your NIC takes too long to link up with a crossover cable.

Another option:

  1. Open a command window by typing "cmd" into the run window.
  2. Type "ping -t -w 1 192.168.0.1" and let it run.
  3. Open a second command window and type "telnet 192.168.0.1 9000" but don't hit enter.
  4. Turn on the slug. Have the second command window be your focus, but watch the pings from the first window.
  5. Hit enter when you see the ping reply. You will only get about three lines of ping replies, and if you miss them you will have to power off your slug and try again. When the telnet window opens, hit ctrl+c as fast as you can - RedBoot is available for only a short window of time. If you miss it, the slug will continue to load and you'll have missed your opportunity to get into RedBoot. --CatMarieS?)

A mouseless option:

  1. WindowsKey?+R
  2. Type cmd
  3. Repeat Steps 1-2
  4. Type ping -t -w 1 192.168.0.1 in the first command-window
  5. Type telnet 192.168.0.1 9000 in the second command-window
  6. Power the slug
  7. Push <ENTER> in the second command-window as soon as you see the ping reply
  8. Push <Ctrl+C> in the second command-window as soon as the telnet window opens

NOTE: On some systems you should ensure that the "Speed & Duplex" setting of your network card is set to "100 MBit? Full". "Auto" won't work. --cweber

An automatic Windows method:

As long as the steps have been followed in the “Preparation for RedBoot access” section of this Wiki, and if Windows Script Host is installed on your system (It should be on 2000 and XP systems. If not it can be d/l’ed from the Microsoft website.) the following batch file should boot the slug into RedBoot, if it does not try it again. Sometimes the ping is not caught. Also, the line:

echo Wscript.Sleep 500 >> redbootSlug.vbs

sets the time in milliseconds the script should wait for the before sending the ^C. You may have to change this if the RedBoot is not catching the SendKey?.

For those who do not know how to create a batch file:

Open up Notepad and copy the code below and paste it into the Notepad window you just opened. Save the contents of the Notepad window to a file; it should end in “.txt”. In Windows Explorer, find the file you just saved and rename it “redBootSlug.bat”. You may get a message about changing the extension; if you do, just click yes.

With the slug turned off, run the batch file. When the ping timeout notices start, turn on the slug, and with any luck in a few seconds you should be in RedBoot mode. Again, if the slug boots up normally, try the batch file again. To end a script that has not caught the ping message, just close the command window.

The batch code follows:

echo off
echo Set objShell = WScript.CreateObject("WScript.Shell") > redbootSlug.vbs
echo Set objExecObject = objShell.Exec("cmd /c ping -t -w 1 192.168.0.1") >> redbootSlug.vbs
echo Wscript.Echo "Start slug after first ping timeout..." >> redbootSlug.vbs
echo Do While Not objExecObject.StdOut.AtEndOfStream >> redbootSlug.vbs
echo     strText = objExecObject.StdOut.ReadLine() >> redbootSlug.vbs
echo     Wscript.Echo strText >> redbootSlug.vbs
echo     If Instr(strText, "Reply") > 0 Then >> redbootSlug.vbs
echo         Exit Do >> redbootSlug.vbs
echo     End If >> redbootSlug.vbs
echo Loop >> redbootSlug.vbs
echo objShell.Run("Telnet 192.168.0.1 9000") >> redbootSlug.vbs
echo Do Until Success = True >> redbootSlug.vbs
echo     Success = objShell.AppActivate("Telnet") >> redbootSlug.vbs
echo Loop >> redbootSlug.vbs
echo Wscript.Sleep 500 >> redbootSlug.vbs
echo objShell.SendKeys "^C" >> redbootSlug.vbs
echo Wscript.Echo "Done... You can close this command window." >> redbootSlug.vbs
echo Wscript.Quit >> redbootSlug.vbs

CALL CScript redbootSlug.vbs
del redbootSlug.vbs

This line is not part of the batch code… I hope this helps. --dmbaker

Comment: Thanks a lot, this nice script really does the job automatically :) Just a note for localized non-English WinXP? versions: In the following line echo If Instr(strText, "Reply") > 0 Then >> redbootSlug.vbs the script given above waits for the word "Reply" to come. In non-English WinXP? this will not happen, so you have to replace the word "Reply" by the corresponding word of your localized WinXP?, e.g. "Antwort" in German (look at your command line window). BTW, I had to use an old hub because my VAIO notebook LAN card did not want to connect directly via cross over cable :( -- Anguel Stankov

Accessing RedBoot from FreeBSD?

A small variation on the OSX instructions worked under FreeBSD?:

 # Ping using a fraction of a second (must be root to do so)
 # Turn off name lookup on telnet
 sudo ping -i .3 -o 192.168.0.1 ;  telnet -N 192.168.0.1 9000

Automated Methods

Note: Once you succeed in connecting to 192.168.0.1 port 9000 and sending in a control-C to halt the automatic boot process, RedBoot will keep listening on 192.168.0.1:9000 until the next reboot. This means you that if you can automate catching the telnet you'll subsequently be able to telnet in manually.

Netcat

This is a fully automated one-liner from the shell. I created it using the manual method and Ethereal, using netcat to mimick the codes (for CTRL-C) being sent. Somehow, root and -vvv seems needed to netcat for this to work (timing issue??). Tested from FC5?. I could not further automate input to RedBoot (yet), which would be a very nice feature.

This one-liner has been reformatted on to several lines, but should be executed on a single line. As root:

 echo -e "\0377\0364\0377\0375\0006" >break.bin; sudo /sbin/arping -f 192.
 168.0.1; sudo nc -D -vvv 192.168.0.1 9000 <break.bin; telnet 192.168.0.1 9000

-- Leon Woestenberg (likewise @IRC).

TCL Script

The following TCL script automates the process of telnet-ing in and issuing the control-C (and also dumps the RedBoot version info). Once the script has done the time-sensitive work you can telnet in at your leisure using your favorite telnet client.

The script was written on Windows. Tested on Windows, OS X. Should Work: Linux, Unix.

Preconditions: You need to run this from a machine can see the slug's 192.168.0.1 address.

 set done  0
 set state START

 proc on_nslu_writable { sock } {

     global state
     fileevent $sock writable ""
     if { $state == "START" } {

         puts "Connected to NSLU2..."
         set state CONN
         fileevent $sock readable [ list on_nslu_readable $sock ]
         after 1000 [list puts $sock ""]
     }
 }

 proc on_nslu_readable { sock } {

     global done state
     set data [read $sock]
     if { [eof $sock] } { puts "Got EOF - Failed."; exit }
     puts $data

     if { [string first "enter ^C to abort" $data] > 0 } {

         puts -nonewline $sock [format "%c" 3]

     } elseif { [string first "RedBoot>" $data] >= 0 } {

         if { $state == "SENTVER" } {
             set done 1
             puts ""
             puts -nonewline " Success - You should now be able"
             puts " to telnet to 192.168.0.1:9000"
         } else {
             puts $sock "version"
             set state SENTVER
         }
     }
 }

 proc try_nslu { } {

     global state
     if { $state == "START" } {
         set sock [socket -async "192.168.0.1" 9000]
         fileevent $sock writable [ list on_nslu_writable $sock ]
         fconfigure $sock -blocking false -buffering none
         after 500 try_nslu
     }
 }

 try_nslu
 vwait done

Example Usage:

  1. Save the script into a file (we'll assume you call it RedBoot.tcl).
  2. Run the script (e.g. tclsh RedBoot.tcl)
  3. Power up the slug.
  4. If everything works you should see:
 Connected to NSLU2...
 == Executing boot script in 1.800 seconds - enter ^C to abort

 ^C
 RedBoot>

 RedBoot(tm) bootstrap and debug environment [ROMRAM]
 Red Hat certified release, version 1.92 - built 15:16:07, Feb  3 2004

 Platform: IXDP425 Development Platform (XScale) 
 Copyright (C) 2000, 2001, 2002, Red Hat, Inc.

 RAM: 0x00000000-0x02000000, 0x000723a0-0x01ff3000 available
 FLASH: 0x50000000 - 0x50800000, 64 blocks of 0x00020000 bytes each.
 RedBoot>

 Success - You should now be able to telnet to 192.168.0.1:9000

-- Adrian Shotton

Perl Script

Here is a Perl script to automate the entire process.

  • Uses upslug (installed in /usr/local/bin) to reset the slug.
  • Assumes you have done ifconfig eth0:1 192.168.0.2 or something similar so you can reach the 192.168.0 net.
  • Assumes you are running as root.
  • Assumes you have Net::Telnet installed (OS X doesn't by default)
  • Tosses you into a telnet session after aborting the boot sequence.
 #!/usr/bin/perl -w
 # telnet_redboot.pl - ./upslug --reset;arping -f 192.168.0.1;telnet 192.168.0.1 9000

 use Net::Telnet ();

 my $host = '192.168.0.1';

 system("/usr/local/bin/upslug -r");
 printf("NSLU2 reset\n");
 system("/sbin/arping -f $host");
 printf("NSLU2 arping response\n");

 my $t = new Net::Telnet (Port => 9000, Timeout => 30);
 if(!defined($t)){
     print "new Net::Telnet failed\n";
     exit(1);
 } # if
 my $ok;
 $ok = $t->errmode("return");
 $ok = $t->open($host);
 if(!defined($ok)){
     print "open('$host') failed\n";
     $t->close();
     exit(1);
 } # if

 # == Executing boot script in 1.930 seconds - enter ^C to abort

 my $line;
 while($line = $t->getline()){
        $line =~ s/[\r\n]//;
        print "-> $line\n";
        if($line =~ m/enter \^C to abort/){
                $t->put(chr(3)); # send ^C
                print "<- \^C\n";
                $t->close();
                sleep(1);
                system("telnet $host 9000");
                exit(0);
        } # if
 } # while
 $t->close();

C program using Berkeley Sockets

The following C program will attempt a connection 10 times/second. After it successed it will send the control-C character, wait for a response, and then drop you into a telnet session. It's trivial to modify this program to run an arbitrary program with stdin/stdout connected to the slug instead of your terminal.

The telnet session has the tilde '~' character as the escape code. That can be very useful if the connection isn't dropped after a reset!

As always you can subsequently reconnect with telnet until the next reboot.

Tested on Debian linux (2006-02-12).

Preconditions: You need to run this from a machine can see the slug's 192.168.0.1 address.

#include <stdio.h>
 #include <unistd.h>
 #include <errno.h>
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <sys/time.h>
 #include <netdb.h>

 #define SLUG_IP     "192.168.0.1" 
 #define SLUG_PORT   "9000"

 #define TELNET      "/usr/bin/telnet"

 char * const telnet_args[] = { "telnet", "-e", "~", SLUG_IP, SLUG_PORT, NULL };

 int main()
 {
    struct sockaddr_in sin;
    fd_set rfds, wfds;
    struct timeval timeout;
    int n;
    char buffer[1024];
    time_t stoptime = time(NULL);
    char outbound[] = { 0x03, 0x00 };
    char *out = outbound;

    int s = socket(PF_INET, SOCK_STREAM, 0);

    // set up socket address for port 9000 at 192.168.0.1
    struct hostent *h = gethostbyname(SLUG_IP);
    sin.sin_family = h->h_addrtype;
    sin.sin_port = htons(atoi(SLUG_PORT));
    memcpy(&sin.sin_addr, h->h_addr_list[0], h->h_length);

    // attempt to connect to remote system.
    while (connect(s, (struct sockaddr *) &sin, sizeof sin) == -1) {
        switch (errno) {
            case ECONNREFUSED:
            case ENETUNREACH:
            case EHOSTUNREACH:
                timeout.tv_sec = 0;
                timeout.tv_usec = 100000;  // every 100 ms
                select(1, NULL, NULL, NULL, &timeout);
                continue;
            default:
                fprintf(stderr, "connect error: %s (%s)\n",
                        strerror(errno), h->h_name);
                return errno;
        }
    }

    FD_ZERO(&rfds);
    FD_ZERO(&wfds);
    stoptime = time(NULL) + 15;
    while (difftime(stoptime, time(NULL)) > 0) {
        FD_SET(s, &rfds);
        FD_SET(s, &wfds);
        timeout.tv_sec = 0;
        timeout.tv_usec = 10000;  // every 10 ms
        n = select(s+1, &rfds, &wfds, NULL, &timeout);
        if (n == -1) {
            fprintf(stderr, "select error: %s\n", strerror(errno));
            return errno;
        }

        if (n == 0) { continue; }

        if (*out != 0 && FD_ISSET(s, &wfds)) { write(s, out++, 1); }

        if (FD_ISSET(s, &rfds)) {
            n = read(s, buffer, sizeof buffer);
            write(1, buffer, n);
            close(s);
            execv(TELNET, telnet_args);
            fprintf(stderr, "exec (%s): %s\n", TELNET, strerror(errno));
            exit(0); // just in case
        }
    }

    fprintf(stderr, "could not capture telnet port");
    close(s);

    return 0;
 }

-- Bear

Example using Red Hat Linux

You have to do the Ctrl+C really really quick.

 [root@dual root]# arping -f 192.168.0.1;telnet 192.168.0.1 9000
 ARPING 192.168.0.1 from 192.168.1.253 eth0
 Unicast reply from 192.168.0.1 [00:0F:66:7B:FE:96]  9.641ms
 Sent 7 probes (7 broadcast(s))
 Received 1 response(s)
 Trying 192.168.0.1...
 Connected to 192.168.0.1 (192.168.0.1).
 Escape character is '^]'.
 == Executing boot script in 1.820 seconds - enter ^C to abort
 ^C
 RedBoot>

The animated version.

Sources: [http://groups.yahoo.com/group/nslu2-linux/message/1096][http://groups.yahoo.com/group/nslu2-linux/message/1106]

Example using Ubuntu

I open a terminal and use the following command to get a root prompt:

 sudo su

I then use the following command to be able to access the NSLU2. My network is otherwise the typical 192.168.1.x:

 route add 192.168.0.1 eth0

My WRT54G router subnet is 255.255.255.0, and my NSLU2 is connected through a network switch, but this worked fine anyway.

  • Then I make sure my NSLU2 is powered _off_.

This is so I have all the time in the world to hit Ctrl-C when arping gets a reply. Now I use the following command to wait for telnet contact:

 arping -f 192.168.0.1; telnet 192.168.0.1 9000

The terminal now shows the following and waits for the NSLU2 to respond, which of course it won't do until I power it on:

 ARPING 192.168.0.1 from 192.168.1.102 eth0
  • Now I power _on_ the NSLU2.

Then I watch the terminal for a reply, such as the following:

 Unicast reply from 192.168.0.1 [00:18:39:31:64:A4]  6.125ms
 Sent 103 probes (103 broadcast(s))
 Received 1 response(s)
 Trying 192.168.0.1...
 Connected to 192.168.0.1.
 Escape character is '^]'.
 == Executing boot script in 1.910 seconds - enter ^C to abort

Finally, I immediately hit Ctrl-C and receive the RedBoot prompt in the terminal as shown below:

 ^C
 RedBoot>
to:

UF8SIU? http://otyanoma.net/~raiden/ragn/mtcgi/mt-comments.cgi mortgage [url=http://gaestebuch4u.de/gb/Edirewan.html]mortgage refinance[/url] mortgage refinance <a href="http://shellbutton.net/cp-bin/blog/index.php">loan rate</a> loan rate

April 01, 2007, at 12:58 PM by marceln --
Changed lines 496-497 from:

The http://pion.xs4all.nl/~marceln/slug/redboot.html animated version.

to:

The animated version.

April 01, 2007, at 12:55 PM by marceln --
Changed lines 496-497 from:

The [http://pion.xs4all.nl/~marceln/slug/redboot.html animated version].

to:

The http://pion.xs4all.nl/~marceln/slug/redboot.html animated version.

April 01, 2007, at 12:53 PM by marceln -- Added reference to demo
Added lines 496-497:

The [http://pion.xs4all.nl/~marceln/slug/redboot.html animated version].

April 01, 2007, at 03:32 AM by jimbaker --
Changed line 506 from:
  • Then I make sure my NSLU2 is powered _off_***.
to:
  • Then I make sure my NSLU2 is powered _off_.
Changed line 512 from:
  • Now I power _on_ the NSLU2.***
to:
  • Now I power _on_ the NSLU2.
April 01, 2007, at 03:31 AM by jimbaker -- No need for a fast Ctrl-C this way. (Ubuntu FWIW)
Changed lines 17-18 from:

When the slug starts up, for a few seconds RedBoot will listen for telnet connections on port 9000. RedBoot will insist on being 192.168.0.1 for this window, regardless of what you've set the address of the normal Linux portion of your slug to be. If it doesn't receive a telnet connection during that window, it will attempt to load the Linux kernel into main memory from flash and execute it.

to:

When the slug starts up, for a few seconds RedBoot will listen for telnet connections on port 9000. RedBoot will insist on being 192.168.0.1 for this window, regardless of what you've set the address of the normal Linux portion of your slug to be. If it doesn't receive a telnet connection during that window, it will attempt to load the Linux kernel into main memory from flash and execute it.

Added lines 498-523:

Example using Ubuntu

I open a terminal and use the following command to get a root prompt:

 sudo su

I then use the following command to be able to access the NSLU2. My network is otherwise the typical 192.168.1.x:

 route add 192.168.0.1 eth0

My WRT54G router subnet is 255.255.255.0, and my NSLU2 is connected through a network switch, but this worked fine anyway.

  • Then I make sure my NSLU2 is powered _off_***.

This is so I have all the time in the world to hit Ctrl-C when arping gets a reply. Now I use the following command to wait for telnet contact:

 arping -f 192.168.0.1; telnet 192.168.0.1 9000

The terminal now shows the following and waits for the NSLU2 to respond, which of course it won't do until I power it on:

 ARPING 192.168.0.1 from 192.168.1.102 eth0
  • Now I power _on_ the NSLU2.***

Then I watch the terminal for a reply, such as the following:

 Unicast reply from 192.168.0.1 [00:18:39:31:64:A4]  6.125ms
 Sent 103 probes (103 broadcast(s))
 Received 1 response(s)
 Trying 192.168.0.1...
 Connected to 192.168.0.1.
 Escape character is '^]'.
 == Executing boot script in 1.910 seconds - enter ^C to abort

Finally, I immediately hit Ctrl-C and receive the RedBoot prompt in the terminal as shown below:

 ^C
 RedBoot>
February 20, 2007, at 06:03 AM by Al -- no red LED anymore lately
Changed lines 138-139 from:
  • If the Ready light starts to flash green it means you missed the window so try again. You will need to disconnect the NSLU2 and reconnect it to reset it.
to:
  • If the Ready light starts to flash green it means you missed the window so try again. You will need to power cycle (by pressing ON button) the NSLU2 and reconnect it to reset it.

With newer versions (2007) the LED colour scheme is different. Just power cycle the slug and watch how many pings get lost until the redboot time-window opens after powering up. Use a Ethernet switch if your NIC takes too long to link up with a crossover cable.

February 07, 2007, at 04:29 PM by YvonneM -- 192.168.0.1 9000 in stead of 192.168.0.1:9000
Changed line 102 from:
  1. Start your telnet client talking to 192.168.0.1:9000
to:
  1. Start your telnet client talking to 192.168.0.1 9000
February 07, 2007, at 08:25 AM by Mannkind --
Added line 149:
February 07, 2007, at 08:25 AM by Mannkind -- Some minor Windows formatting adjustments.
Changed lines 140-141 from:

(I found this method to be the easiest:

to:

Another option:

Changed lines 148-151 from:

(A "mouseless" option is: type "telnet 192.168.0.1 9000" in another command line window, power on the slug, hit <Enter> as soon as you see a ping reply and hit <ctrl-C> as soon as the telnet Window opens. <Worked easily for me, --MSchnell?>)

(On some systems you should ensure that the "Speed & Duplex" setting of your network card is set to "100 MBit? Full". "Auto" won't work. --cweber)

to:

A mouseless option:

  1. WindowsKey?+R
  2. Type cmd
  3. Repeat Steps 1-2
  4. Type ping -t -w 1 192.168.0.1 in the first command-window
  5. Type telnet 192.168.0.1 9000 in the second command-window
  6. Power the slug
  7. Push <ENTER> in the second command-window as soon as you see the ping reply
  8. Push <Ctrl+C> in the second command-window as soon as the telnet window opens

NOTE: On some systems you should ensure that the "Speed & Duplex" setting of your network card is set to "100 MBit? Full". "Auto" won't work. --cweber

February 07, 2007, at 08:20 AM by Mannkind --
Changed lines 127-131 from:
  1. Open a Windows command prompt (ie by typing cmd at the start and run prompt)
  2. At the command prompt type ping -t -w 1 192.168.0.1
  3. Do this process a couple more times and arrange the windows so that they're all visible.
    • This increases the number of pings and gives you a better chance of seeing the very short

reply window you have to work with.

to:
  1. Open a Windows command prompt (ie by typing cmd at the start and run prompt)
  2. At the command prompt type ping -t -w 1 192.168.0.1
  3. Do this process a couple more times and arrange the windows so that they're all visible.
    • This increases the number of pings and gives you a better chance of seeing the very short reply window you have to work with.
February 07, 2007, at 08:18 AM by Mannkind --
Deleted line 127:
Changed lines 129-132 from:
  1. Do this process a couple more times and arrange the windows so that they're all visible.

    This increases the number of pings and gives you a better chance of seeing the very short\
to:
  1. Do this process a couple more times and arrange the windows so that they're all visible.
    • This increases the number of pings and gives you a better chance of seeing the very short
Deleted line 131:
Deleted line 132:
Deleted line 133:
Changed lines 135-138 from:

in hyperterminal, turn on the NSLU.

Move your other hand ready to hit Ctrl+C

to:

in hyperterminal, turn on the NSLU.

  • Move your other hand ready to hit Ctrl+C
Changed lines 138-142 from:
  1. Hit the mouse button with one hand and then Ctrl+C with the other.

    If the Ready light starts to flash green it means you missed the window so try again. You will need to disconnect the NSLU2 and reconnect it to reset it.
to:
  1. Hit the mouse button with one hand and then Ctrl+C with the other.
    • If the Ready light starts to flash green it means you missed the window so try again. You will need to disconnect the NSLU2 and reconnect it to reset it.
Deleted line 143:
Deleted line 144:
Deleted line 145:
Deleted line 146:
Deleted lines 481-529:
 RedBoot> help 
 go to assign mode 
    assign 
 Set/Query the system console baud rate 
    baudrate [-b <rate>] 
 sercomm boot flow 
    boot 
 Manage machine caches 
    cache [ON | OFF] 
 Display/switch console channel 
    channel [-1|<channel number>] 
 Compute a 32bit checksum [POSIX algorithm] for a range of memory 
    cksum -b <location> -l <length> 
 Display (hex dump) a range of memory 
    dump -b <location> [-l <length>] [-s] [-1|2|4] 
 Execute an image - with MMU off 
    exec [-w timeout] [-b <load addr> [-l <length>]] 
         [-r <ramdisk addr> [-s <ramdisk length>]] 
         [-c "kernel command line"] [<entry_point>] 
 Manage FLASH images 
    fis {cmds} 
 Execute code at a location 
    go [-w <timeout>] [entry] 
 Help about help? 
    help [<topic>]
 Set/change IP addresses
    ip_address [-l <local_ip_address>] [-h <server_address>]
 Load a file
    load [-r] [-v] [-d] [-h <host>] [-m <varies>] [-c <channel_number>]
         [-b <base_address>] <file_name>
 Compare two blocks of memory
    mcmp -s <location> -d <location> -l <length> [-1|-2|-4]
 Fill a block of memory with a pattern
    mfill -b <location> -l <length> -p <pattern> [-1|-2|-4]
 move kernel&ramdisk to ram
    move
 Network connectivity test
    ping [-v] [-n <count>] [-l <length>] [-t <timeout>] [-r <rate>]
         [-i <IP_addr>] -h <IP_addr>
 Reset the system
    reset
 Set/Read MAC address for NPE ethernet ports
    set_npe_mac [-p <portnum>] [xx:xx:xx:xx:xx:xx]
 go to upgrade mode
    upgrade
 Display RedBoot version information
    version
 Display (hex dump) a range of memory
    x -b <location> [-l <length>] [-s] [-1|2|4]
February 07, 2007, at 08:14 AM by Mannkind -- Trying again to make the OS X section look nice. Sorry for so many edits. I wish I had preview!
Changed lines 49-64 from:
  • Determine the MAC address of your slug. arp -a
    • For example: ? (192.168.1.1) at 00:a0:c5:45:0b:17 on en0 [ethernet]
  • Setup en0 (or another port) to work with the slug
    1. Go to System Preferences >> Network
    2. Select Built-in Ethernet (or your Network Adapter Choice)
    3. On the Configure IPv4? drop-down, select Manual
    4. Set the IP Address to 192.168.0.2
    5. Set the Subnet Mask to 255.255.255.0
  • Setup an route
    1. Open Terminal and type: sudo arp -s 192.168.0.1 <00:a0:c5:45:0b:17> where 00:a0:c5:45:0b:17 is the MAC address of your slug.
  • A good GUI for TFTP is TFTP Server: http://ww2.unime.it/flr/tftpserver/
  • Continue following this guide.
    • The easiest way is to use the TCL script. The ping, perl, and C scripts do not seem to work on OS X.
    • NOTE: Using a newer Mac(confirmed: MacBook? Pro), you don't even need a crossover cable. The Auto-MDI/MDIX is fast enough that you can use a straight-through cable directly from the Mac to the Slug.
to:
  • Determine the MAC address of your slug. arp -a
    • For example: ? (192.168.1.1) at 00:a0:c5:45:0b:17 on en0 [ethernet]
  • Setup en0 (or another port) to work with the slug
    1. Go to System Preferences >> Network
    2. Select Built-in Ethernet (or your Network Adapter Choice)
    3. On the Configure IPv4? drop-down, select Manual
    4. Set the IP Address to 192.168.0.2
    5. Set the Subnet Mask to 255.255.255.0
  • Setup an route
    1. Open Terminal and type: sudo arp -s 192.168.0.1 <00:a0:c5:45:0b:17> where 00:a0:c5:45:0b:17 is the MAC address of your slug.
  • A good GUI for TFTP is TFTP Server: http://ww2.unime.it/flr/tftpserver/
  • Continue following this guide.
    • The easiest way is to use the TCL script. The ping, perl, and C scripts do not seem to work on OS X.
    • NOTE: Using a newer Mac(confirmed: MacBook? Pro), you don't even need a crossover cable. The Auto-MDI/MDIX is fast enough that you can use a straight-through cable directly from the Mac to the Slug.
February 07, 2007, at 08:12 AM by Mannkind -- Argh, the OS X section looks stupid.
Added line 48:
February 07, 2007, at 08:11 AM by Mannkind -- Update Mac OS X information, removed stuff that didn\'t work for OS X. Bit of cleanup. Boy I wish Preview worked.
Changed lines 48-56 from:

try sudo route add 192.168.0.1 -interface en0 on an OS X box.

In my case the previous method didn't work, so here's mine:
- Get the mac address of your slug. One way to do that is to connect to the web interface of the slug, then open a terminal and then type arp -a and jot down the 12 digit number. For example the MAC address of the device 192.168.1.1 shown here
? (192.168.1.1) at 0:a0:c5:45:b:17 on en0 [ethernet] is 00:A0:C5:45:0B:17 (if there is a single digit between colums add a leading 0).
- Duplicate your main internet connection port. Go in System Preferences in network, in the second popup list called Show display the Network Port Configurations, select your main internet port then hit the button duplicate. Once done, select your newly created port in the second popup list and clic the TCP/IP tab. In the Configure IP v4: select Using DHCP with manual address, then, just under, enter any IP of the form 192.168.0.x, where x is anything between 2 and 254. An alternative to that is just to set your main internet port to 192.168.0.1, but in this case you will no longer be able to connect to internet during the RedBoot operation, and do not forget to revert back your configuration once finished with RedBoot.
- Now you need to create the route to the 192.168.0.1 address. Do so by entering in a terminal the fellowing command: sudo arp -s 192.168.0.1 the_mac_address_from_point_1. You can then check that the route exist with the command arp -a.
- From now on you can contimue to read from the 'Trying To Access RedBoot' of this page. However I advise you to use the tcl script wich is working great on the absence of arping on OS X.

to:
  • Determine the MAC address of your slug. arp -a
    • For example: ? (192.168.1.1) at 00:a0:c5:45:0b:17 on en0 [ethernet]
  • Setup en0 (or another port) to work with the slug
    1. Go to System Preferences >> Network
    2. Select Built-in Ethernet (or your Network Adapter Choice)
    3. On the Configure IPv4? drop-down, select Manual
    4. Set the IP Address to 192.168.0.2
    5. Set the Subnet Mask to 255.255.255.0
  • Setup an route
    1. Open Terminal and type: sudo arp -s 192.168.0.1 <00:a0:c5:45:0b:17> where 00:a0:c5:45:0b:17 is the MAC address of your slug.
  • A good GUI for TFTP is TFTP Server: http://ww2.unime.it/flr/tftpserver/
  • Continue following this guide.
    • The easiest way is to use the TCL script. The ping, perl, and C scripts do not seem to work on OS X.
    • NOTE: Using a newer Mac(confirmed: MacBook? Pro), you don't even need a crossover cable. The Auto-MDI/MDIX is fast enough that you can use a straight-through cable directly from the Mac to the Slug.
Changed lines 108-172 from:

First manual method

An easy way to "catch" the telnet window is:

sudo arping -f 192.168.0.1; telnet 192.168.0.1 9000

then, the telnet starts trying as soon as the IP address on the slug will respond, and all you have to do is remember to press Ctrl+C. :)

If your arping doesn't understand -f, you probably have the standalone "arping" package. Install the version from iputils instead. (For Debian: apt-get install iputils-arping)

What you do need to be ready with is your fingers to type Ctrl-C, as when the RedBoot prompt appears you will have between 2 and 0.1 of a second to hit it. It's something of a reaction test - hold down control after you start the above command, and be ready to mash C as soon as anything appears on the screen.

If you're successful, you should then get a RedBoot> prompt that you can type at.

If you miss it, simply pull the power on the slug and try again.

Second manual method

This is a variation on the same theme, but can help you if you don't want/have arping installed. it has the disadvantage of being "more" manual than the previous. The command you must type is:

ping -f 192.168.0.1; telnet 192.168.0.1 9000

This will display a continous set of points (one for each packet that didn't had a response). When you see the points stopping from filling your screen, then you have to press Ctrl+C twice (once to stop the ping and one for the RedBoot prompt).

Probably this second method will work better if you connect the NSLU2 directly to your computer, but I am not sure (I did it this way from the start).

--EddyP?

There is a minor variation that will save you one Ctrl+C:

ping -c 1 -f 192.168.0.1; telnet 192.168.0.1 9000

--dean

Third manual method

This method is the variation of the previous two methods, with the advantage that it does not require root privileges to run.

while ! ping -W 1 -c 1 192.168.0.1 2>&1 >/dev/null; do true; done && telnet 192.168.0.1 9000

This command will keep pinging RedBoot's IP address until first success, and then open into RedBoot where you'll have to press Ctrl+C to stop it form auto booting.

--yvasilev?

Accessing RedBoot from OSX

Again, a small variant of *Nix seemed to help getting through from OSX:

@

 # For a direct connection, turning off autoselect may help
 sudo ifconfig <myifc-probably-en0> mediaopt full-duplex

 # Ping using a fraction of a second (must be root to do so)
 sudo ping -i .3 -c 1 192.168.0.1 ;  telnet 192.168.0.1 9000

 # don't forget to turn autoselect when finished, and note it's "media autoselect" 
 #  and "mediaopt full-duplex"
 # sudo ifconfig <myifc-probably-en0> media autoselect

@

-Doug

I've changed the ping command, the syntax wasn't correct for OSX (-c 1) - Pacharest

to:

Manual Methods

  • sudo arping -f 192.168.0.1; telnet 192.168.0.1 9000
    • The telnet starts trying as soon as the IP address on the slug will respond, and all you have to do is remember to press Ctrl+C. :)
    • NOTE: If your arping doesn't understand -f, you probably have the standalone "arping" package. Install the version from iputils instead. (For Debian: apt-get install iputils-arping)
  • ping -f 192.168.0.1; telnet 192.168.0.1 9000
    • This will display a continous set of points (one for each packet that didn't had a response). When you see the points stopping from filling your screen, then you have to press Ctrl+C twice (once to stop the ping and one for the RedBoot prompt).
  • ping -c 1 -f 192.168.0.1; telnet 192.168.0.1 9000
    • This is a minor variation that will save you one Ctrl+C:
  • while ! ping -W 1 -c 1 192.168.0.1 2>&1 >/dev/null; do true; done && telnet 192.168.0.1 9000
    • This method is the variation of the previous two methods, with the advantage that it does not require root privileges to run.
    • This command will keep pinging RedBoot's IP address until first success, and then open into RedBoot where you'll have to press Ctrl+C to stop it form auto booting.
Changed lines 242-243 from:

The script was written and tested under windows but should work equally well on Unix or Linux.

to:

The script was written on Windows. Tested on Windows, OS X. Should Work: Linux, Unix.

Changed lines 302-310 from:

1. Save the script into a file (we'll assume you call it RedBoot.tcl).

2. Run the script (e.g. tclsh RedBoot.tcl)

3. Power up the slug.

4. If everything works you should see:

to:
  1. Save the script into a file (we'll assume you call it RedBoot.tcl).
  2. Run the script (e.g. tclsh RedBoot.tcl)
  3. Power up the slug.
  4. If everything works you should see:
Added line 335:
  • Assumes you have Net::Telnet installed (OS X doesn't by default)
Deleted lines 337-338:

NOTE: Looks like the parameter for upslug has changed from --reset to -r (repvik)

November 23, 2006, at 04:44 AM by DonV -- formatting fixes
Changed line 71 from:
  • I was unsuccessful with the above WinXP? approach - my machine is dual-ethernet NIC'd with DHCP normally used for both connections to a router. With a crossover (patch) cable connected from one NIC to the slug I was able to determine which NIC was reported by Control Panel => Network Connections as "Network cable unplugged". Then changed the settings for this NIC (click right on the connection entry and select "Properties" (new dialog opens), then select TCP/IP and click on "Properties" in new dialog) to:\\\
to:
  • I was unsuccessful with the above WinXP? approach - my machine is dual-ethernet NIC'd with DHCP normally used for both connections to a router. With a crossover (patch) cable connected from one NIC to the slug (while OFF) I was able to determine which NIC was reported by Control Panel => Network Connections as "Network cable unplugged". Then changed the settings for this NIC (click right on the connection entry and select "Properties" (new dialog opens), then select TCP/IP and click on "Properties" in new dialog) to:\\\
November 23, 2006, at 04:42 AM by DonV -- formatting fixes
Changed lines 71-80 from:
I was unsuccessful with the above WinXP? approach - my machine is dual-ethernet NIC'd with DHCP normally used for both connections to a router.

->With a crossover (patch) cable connected from one NIC to the slug I was able to determine which NIC was reported by Control Panel => Network Connections as "Network cable unplugged". Then changed the settings for this NIC (click right on the connection entry and select "Properties" (new dialog opens), then select TCP/IP and click on "Properties" in that dialog) to:

->Select radio button for "Use the following IP address:"
and set the following values:
->IP Address: 192.168.0.100
->Subnet: 255.255.255.0 (set by default after entering IP address and clicking in this field)
->Default gateway: 192.168.0.1
Note that a command prompt 'ping 192.168.0.100' will NOT get a reply, but when you move to the next step (I used the 'An automatic Windows method' {using WSH} below) it will succeed. Don't forget to change the network connection back to using DHCP when you're done if you need to...
-DonV?
to:
  • I was unsuccessful with the above WinXP? approach - my machine is dual-ethernet NIC'd with DHCP normally used for both connections to a router. With a crossover (patch) cable connected from one NIC to the slug I was able to determine which NIC was reported by Control Panel => Network Connections as "Network cable unplugged". Then changed the settings for this NIC (click right on the connection entry and select "Properties" (new dialog opens), then select TCP/IP and click on "Properties" in new dialog) to:

    Select radio button for "Use the following IP address:" and set the following values:
    IP Address: 192.168.0.100
    Subnet: 255.255.255.0
    Default gateway: 192.168.0.1

    Note that at command prompt a 'ping 192.168.0.100' or 'ping 192.168.0.1' w/the slug OFF will NOT get a reply, but when you move to the next step (I used the 'An automatic Windows method' {using WSH} below) it will succeed. Don't forget to change the network connection back to using DHCP when you're done if you need to...

    DonV
November 23, 2006, at 04:23 AM by DonV -- formatting fixes
Changed lines 71-73 from:
  1. I was unsuccessful with the above WinXP? approach - my machine is dual-ethernet NIC'd with DHCP normally used for both connections to a router.
    With a crossover (patch) cable connected from one NIC to the slug I was able to determine which NIC was reported by Control Panel => Network Connections as "Network cable unplugged". Then changed the settings for this NIC (click right on the connection entry and select "Properties" (new dialog opens), then select TCP/IP and click on "Properties" in that dialog) to:
    Select radio button for "Use the following IP address:"\\
to:
I was unsuccessful with the above WinXP? approach - my machine is dual-ethernet NIC'd with DHCP normally used for both connections to a router.

->With a crossover (patch) cable connected from one NIC to the slug I was able to determine which NIC was reported by Control Panel => Network Connections as "Network cable unplugged". Then changed the settings for this NIC (click right on the connection entry and select "Properties" (new dialog opens), then select TCP/IP and click on "Properties" in that dialog) to:

->Select radio button for "Use the following IP address:"\\
Changed lines 75-80 from:

IP Address: 192.168.0.100
Subnet: 255.255.255.0 (set by default after entering IP address and clicking in this field)
Default gateway: 192.168.0.1
Note that a 'ping 192.168.0.100' will NOT get a reply, but when you move to the next step below (I used the WSH totally automatic solution) it will succeed. Don't forget to change the network connection back to using DHCP when you're done if you need to...

to:
IP Address: 192.168.0.100
->Subnet: 255.255.255.0 (set by default after entering IP address and clicking in this field)
->Default gateway: 192.168.0.1
Note that a command prompt 'ping 192.168.0.100' will NOT get a reply, but when you move to the next step (I used the 'An automatic Windows method' {using WSH} below) it will succeed. Don't forget to change the network connection back to using DHCP when you're done if you need to...
-DonV?
November 23, 2006, at 04:17 AM by DonV --
Changed line 71 from:

I was unsuccessful with the above WinXP? approach - my machine is dual-ethernet NIC'd with DHCP normally used for both connections to a router.\\

to:
  1. I was unsuccessful with the above WinXP? approach - my machine is dual-ethernet NIC'd with DHCP normally used for both connections to a router.\\
November 23, 2006, at 04:15 AM by DonV -- Add NIC config directions for WinXP when normally using DHCP
Added lines 71-80:

I was unsuccessful with the above WinXP? approach - my machine is dual-ethernet NIC'd with DHCP normally used for both connections to a router.
With a crossover (patch) cable connected from one NIC to the slug I was able to determine which NIC was reported by Control Panel => Network Connections as "Network cable unplugged". Then changed the settings for this NIC (click right on the connection entry and select "Properties" (new dialog opens), then select TCP/IP and click on "Properties" in that dialog) to:
Select radio button for "Use the following IP address:"
and set the following values:
IP Address: 192.168.0.100
Subnet: 255.255.255.0 (set by default after entering IP address and clicking in this field)
Default gateway: 192.168.0.1
Note that a 'ping 192.168.0.100' will NOT get a reply, but when you move to the next step below (I used the WSH totally automatic solution) it will succeed. Don't forget to change the network connection back to using DHCP when you're done if you need to...

November 21, 2006, at 07:46 PM by Anguel Stankov -- Automatic windows script modification for non-English WinXP
Changed lines 243-249 from:
to:

Comment: Thanks a lot, this nice script really does the job automatically :) Just a note for localized non-English WinXP? versions: In the following line echo If Instr(strText, "Reply") > 0 Then >> redbootSlug.vbs the script given above waits for the word "Reply" to come. In non-English WinXP? this will not happen, so you have to replace the word "Reply" by the corresponding word of your localized WinXP?, e.g. "Antwort" in German (look at your command line window). BTW, I had to use an old hub because my VAIO notebook LAN card did not want to connect directly via cross over cable :( -- Anguel Stankov

October 26, 2006, at 09:41 AM by heinz -- added hint to vt100 mode in case of strage characters
Changed lines 86-87 from:
  1. Once telnet connects, press Ctrl-C to tell RedBoot you want access
to:
  1. Once telnet connects, press Ctrl-C to tell RedBoot you want access (try telnet in vt100 mode, if you receive strange characters instead of a readable prompt)
October 22, 2006, at 09:21 PM by dmbaker --
Changed lines 205-206 from:

echo Wscript.Sleep 500 >> redbootSlug.vbs

to:

echo Wscript.Sleep 500 >> redbootSlug.vbs

October 22, 2006, at 09:20 PM by dmbaker --
Changed lines 217-240 from:

@@echo off
echo Set objShell = WScript?.CreateObject?("WScript?.Shell") > redbootSlug.vbs
echo Set objExecObject = objShell.Exec("cmd /c ping -t -w 1 192.168.0.1") >> redbootSlug.vbs
echo Wscript.Echo "Start slug after first ping timeout..." >> redbootSlug.vbs
echo Do While Not objExecObject.StdOut?.AtEndOfStream? >> redbootSlug.vbs
echo strText = objExecObject.StdOut?.ReadLine?() >> redbootSlug.vbs
echo Wscript.Echo strText >> redbootSlug.vbs
echo If Instr(strText, "Reply") > 0 Then >> redbootSlug.vbs
echo Exit Do >> redbootSlug.vbs
echo End If >> redbootSlug.vbs
echo Loop >> redbootSlug.vbs
echo objShell.Run("Telnet 192.168.0.1 9000") >> redbootSlug.vbs
echo Do Until Success = True >> redbootSlug.vbs
echo Success = objShell.AppActivate?("Telnet") >> redbootSlug.vbs
echo Loop >> redbootSlug.vbs
echo Wscript.Sleep 500 >> redbootSlug.vbs
echo objShell.SendKeys? "^C" >> redbootSlug.vbs
echo Wscript.Echo "Done... You can close this command window." >> redbootSlug.vbs
echo Wscript.Quit >> redbootSlug.vbs
CALL CScript? redbootSlug.vbs
del redbootSlug.vbs\\@@

to:
echo off
echo Set objShell = WScript.CreateObject("WScript.Shell") > redbootSlug.vbs
echo Set objExecObject = objShell.Exec("cmd /c ping -t -w 1 192.168.0.1") >> redbootSlug.vbs
echo Wscript.Echo "Start slug after first ping timeout..." >> redbootSlug.vbs
echo Do While Not objExecObject.StdOut.AtEndOfStream >> redbootSlug.vbs
echo     strText = objExecObject.StdOut.ReadLine() >> redbootSlug.vbs
echo     Wscript.Echo strText >> redbootSlug.vbs
echo     If Instr(strText, "Reply") > 0 Then >> redbootSlug.vbs
echo         Exit Do >> redbootSlug.vbs
echo     End If >> redbootSlug.vbs
echo Loop >> redbootSlug.vbs
echo objShell.Run("Telnet 192.168.0.1 9000") >> redbootSlug.vbs
echo Do Until Success = True >> redbootSlug.vbs
echo     Success = objShell.AppActivate("Telnet") >> redbootSlug.vbs
echo Loop >> redbootSlug.vbs
echo Wscript.Sleep 500 >> redbootSlug.vbs
echo objShell.SendKeys "^C" >> redbootSlug.vbs
echo Wscript.Echo "Done... You can close this command window." >> redbootSlug.vbs
echo Wscript.Quit >> redbootSlug.vbs

CALL CScript redbootSlug.vbs
del redbootSlug.vbs
October 22, 2006, at 09:14 PM by dmbaker --
Changed line 217 from:

echo off\\

to:

@@echo off\\

Changed lines 238-240 from:

del redbootSlug.vbs

to:

del redbootSlug.vbs\\@@

October 22, 2006, at 09:08 PM by dmbaker --
Added line 240:
October 22, 2006, at 09:06 PM by dmbaker --
Changed lines 217-239 from:

echo off echo Set objShell = WScript?.CreateObject?("WScript?.Shell") > redbootSlug.vbs echo Set objExecObject = objShell.Exec("cmd /c ping -t -w 1 192.168.0.1") >> redbootSlug.vbs echo Wscript.Echo "Start slug after first ping timeout..." >> redbootSlug.vbs echo Do While Not objExecObject.StdOut?.AtEndOfStream? >> redbootSlug.vbs echo strText = objExecObject.StdOut?.ReadLine?() >> redbootSlug.vbs echo Wscript.Echo strText >> redbootSlug.vbs echo If Instr(strText, "Reply") > 0 Then >> redbootSlug.vbs echo Exit Do >> redbootSlug.vbs echo End If >> redbootSlug.vbs echo Loop >> redbootSlug.vbs echo objShell.Run("Telnet 192.168.0.1 9000") >> redbootSlug.vbs echo Do Until Success = True >> redbootSlug.vbs echo Success = objShell.AppActivate?("Telnet") >> redbootSlug.vbs echo Loop >> redbootSlug.vbs echo Wscript.Sleep 500 >> redbootSlug.vbs echo objShell.SendKeys? "^C" >> redbootSlug.vbs echo Wscript.Echo "Done... You can close this command window." >> redbootSlug.vbs echo Wscript.Quit >> redbootSlug.vbs

CALL CScript? redbootSlug.vbs del redbootSlug.vbs

to:

echo off
echo Set objShell = WScript?.CreateObject?("WScript?.Shell") > redbootSlug.vbs
echo Set objExecObject = objShell.Exec("cmd /c ping -t -w 1 192.168.0.1") >> redbootSlug.vbs
echo Wscript.Echo "Start slug after first ping timeout..." >> redbootSlug.vbs
echo Do While Not objExecObject.StdOut?.AtEndOfStream? >> redbootSlug.vbs
echo strText = objExecObject.StdOut?.ReadLine?() >> redbootSlug.vbs
echo Wscript.Echo strText >> redbootSlug.vbs
echo If Instr(strText, "Reply") > 0 Then >> redbootSlug.vbs
echo Exit Do >> redbootSlug.vbs
echo End If >> redbootSlug.vbs
echo Loop >> redbootSlug.vbs
echo objShell.Run("Telnet 192.168.0.1 9000") >> redbootSlug.vbs
echo Do Until Success = True >> redbootSlug.vbs
echo Success = objShell.AppActivate?("Telnet") >> redbootSlug.vbs
echo Loop >> redbootSlug.vbs
echo Wscript.Sleep 500 >> redbootSlug.vbs
echo objShell.SendKeys? "^C" >> redbootSlug.vbs
echo Wscript.Echo "Done... You can close this command window." >> redbootSlug.vbs
echo Wscript.Quit >> redbootSlug.vbs
CALL CScript? redbootSlug.vbs
del redbootSlug.vbs

October 22, 2006, at 09:02 PM by dmbaker --
Changed lines 201-202 from:

An automatic Windows method:

to:

An automatic Windows method:

Changed lines 240-242 from:

This line is not part of the batch code… dmbaker

to:

This line is not part of the batch code… I hope this helps. --dmbaker

October 22, 2006, at 09:00 PM by dmbaker --
October 22, 2006, at 08:58 PM by dmbaker -- An automatic Windows TelnetIntoRedBoot method.
Added lines 201-242:

An automatic Windows method:

As long as the steps have been followed in the “Preparation for RedBoot access” section of this Wiki, and if Windows Script Host is installed on your system (It should be on 2000 and XP systems. If not it can be d/l’ed from the Microsoft website.) the following batch file should boot the slug into RedBoot, if it does not try it again. Sometimes the ping is not caught. Also, the line:

echo Wscript.Sleep 500 >> redbootSlug.vbs

sets the time in milliseconds the script should wait for the before sending the ^C. You may have to change this if the RedBoot is not catching the SendKey?.

For those who do not know how to create a batch file:

Open up Notepad and copy the code below and paste it into the Notepad window you just opened. Save the contents of the Notepad window to a file; it should end in “.txt”. In Windows Explorer, find the file you just saved and rename it “redBootSlug.bat”. You may get a message about changing the extension; if you do, just click yes.

With the slug turned off, run the batch file. When the ping timeout notices start, turn on the slug, and with any luck in a few seconds you should be in RedBoot mode. Again, if the slug boots up normally, try the batch file again. To end a script that has not caught the ping message, just close the command window.

The batch code follows:

echo off echo Set objShell = WScript?.CreateObject?("WScript?.Shell") > redbootSlug.vbs echo Set objExecObject = objShell.Exec("cmd /c ping -t -w 1 192.168.0.1") >> redbootSlug.vbs echo Wscript.Echo "Start slug after first ping timeout..." >> redbootSlug.vbs echo Do While Not objExecObject.StdOut?.AtEndOfStream? >> redbootSlug.vbs echo strText = objExecObject.StdOut?.ReadLine?() >> redbootSlug.vbs echo Wscript.Echo strText >> redbootSlug.vbs echo If Instr(strText, "Reply") > 0 Then >> redbootSlug.vbs echo Exit Do >> redbootSlug.vbs echo End If >> redbootSlug.vbs echo Loop >> redbootSlug.vbs echo objShell.Run("Telnet 192.168.0.1 9000") >> redbootSlug.vbs echo Do Until Success = True >> redbootSlug.vbs echo Success = objShell.AppActivate?("Telnet") >> redbootSlug.vbs echo Loop >> redbootSlug.vbs echo Wscript.Sleep 500 >> redbootSlug.vbs echo objShell.SendKeys? "^C" >> redbootSlug.vbs echo Wscript.Echo "Done... You can close this command window." >> redbootSlug.vbs echo Wscript.Quit >> redbootSlug.vbs

CALL CScript? redbootSlug.vbs del redbootSlug.vbs

This line is not part of the batch code… dmbaker

September 20, 2006, at 07:36 PM by dean -- Minor variation for Redboot access
Added lines 120-125:

There is a minor variation that will save you one Ctrl+C:

ping -c 1 -f 192.168.0.1; telnet 192.168.0.1 9000

--dean

August 11, 2006, at 08:10 PM by CatMarieS --
Changed lines 189-190 from:
  1. Hit enter when you see the ping reply. You will only get about three lines of ping replies, and if you miss them you will have to power off your slug and try again. When the telnet window opens, hit ctrl+c as fast as you can - RedBoot is available for only a short window of time. If you miss it, the slug will continue to load and you'll have missed your opportunity to get into RedBoot. You will only get about three lines of ping replies, and if you miss them you will have to power off your slug and try again. --CatMarieS?)
to:
  1. Hit enter when you see the ping reply. You will only get about three lines of ping replies, and if you miss them you will have to power off your slug and try again. When the telnet window opens, hit ctrl+c as fast as you can - RedBoot is available for only a short window of time. If you miss it, the slug will continue to load and you'll have missed your opportunity to get into RedBoot. --CatMarieS?)
July 28, 2006, at 07:42 PM by CatMarieS --
Changed lines 181-190 from:
  1. 1. Open a command window by typing "cmd" into the run window.
  2. 2. Type "ping -t -w 1 192.168.0.1" and let it run.
  3. 3. Open a second command window and type "telnet 192.168.0.1 9000" but don't hit enter.
  4. 4. Turn on the slug. Have the second command window be your focus, but watch the pings from the first window.
  5. 5. Hit enter when you see the ping reply. You will only get about three lines of ping replies, and if you miss them you will have to power off your slug and try again. When the telnet window opens, hit ctrl+c as fast as you can - RedBoot is available for only a short window of time. If you miss it, the slug will continue to load and you'll have missed your opportunity to get into RedBoot. You will only get about three lines of ping replies, and if you miss them you will have to power off your slug and try again. --CatMarieS?)
to:
  1. Open a command window by typing "cmd" into the run window.
  2. Type "ping -t -w 1 192.168.0.1" and let it run.
  3. Open a second command window and type "telnet 192.168.0.1 9000" but don't hit enter.
  4. Turn on the slug. Have the second command window be your focus, but watch the pings from the first window.
  5. Hit enter when you see the ping reply. You will only get about three lines of ping replies, and if you miss them you will have to power off your slug and try again. When the telnet window opens, hit ctrl+c as fast as you can - RedBoot is available for only a short window of time. If you miss it, the slug will continue to load and you'll have missed your opportunity to get into RedBoot. You will only get about three lines of ping replies, and if you miss them you will have to power off your slug and try again. --CatMarieS?)
July 28, 2006, at 07:42 PM by CatMarieS --
Changed lines 179-190 from:
to:

(I found this method to be the easiest:

  1. 1. Open a command window by typing "cmd" into the run window.
  2. 2. Type "ping -t -w 1 192.168.0.1" and let it run.
  3. 3. Open a second command window and type "telnet 192.168.0.1 9000" but don't hit enter.
  4. 4. Turn on the slug. Have the second command window be your focus, but watch the pings from the first window.
  5. 5. Hit enter when you see the ping reply. You will only get about three lines of ping replies, and if you miss them you will have to power off your slug and try again. When the telnet window opens, hit ctrl+c as fast as you can - RedBoot is available for only a short window of time. If you miss it, the slug will continue to load and you'll have missed your opportunity to get into RedBoot. You will only get about three lines of ping replies, and if you miss them you will have to power off your slug and try again. --CatMarieS?)
Deleted lines 192-203:

(I found the above mouseless option to be the easiest. Here's how I did it:

1. Open a command window by typing "cmd" into the run window.

2. Type "ping -t -w 1 192.168.0.1" and let it run.

3. Open a second command window and type "telnet 192.168.0.1 9000" but don't hit enter.

4. Turn on the slug. Have the second command window be your focus, but watch the pings from the first window.

5. Hit enter when you see the ping reply. You will only get about three lines of ping replies, and if you miss them you will have to power off your slug and try again. When the telnet window opens, hit ctrl+c as fast as you can - RedBoot is available for only a short window of time. If you miss it, the slug will continue to load and you'll have missed your opportunity to get into RedBoot. You will only get about three lines of ping replies, and if you miss them you will have to power off your slug and try again. --CatMarieS?)

July 28, 2006, at 07:38 PM by CatMarieS -- easier way to get redboot from windows
Added lines 182-193:

(I found the above mouseless option to be the easiest. Here's how I did it:

1. Open a command window by typing "cmd" into the run window.

2. Type "ping -t -w 1 192.168.0.1" and let it run.

3. Open a second command window and type "telnet 192.168.0.1 9000" but don't hit enter.

4. Turn on the slug. Have the second command window be your focus, but watch the pings from the first window.

5. Hit enter when you see the ping reply. You will only get about three lines of ping replies, and if you miss them you will have to power off your slug and try again. When the telnet window opens, hit ctrl+c as fast as you can - RedBoot is available for only a short window of time. If you miss it, the slug will continue to load and you'll have missed your opportunity to get into RedBoot. You will only get about three lines of ping replies, and if you miss them you will have to power off your slug and try again. --CatMarieS?)

June 26, 2006, at 03:27 PM by Reedy Boy --
Changed lines 157-158 from:
  1. At the command prompt type ping -t -w 1 10 192.168.0.1
to:
  1. At the command prompt type ping -t -w 1 192.168.0.1
June 26, 2006, at 03:23 PM by Reedy Boy --
Changed lines 114-115 from:

This will display a continous set of points (one for each packet that didn't had a response). When you will see the points stopping from filling your screen, then you have to press Ctrl+C twice (once to stop the ping and one for the RedBoot prompt).

to:

This will display a continous set of points (one for each packet that didn't had a response). When you see the points stopping from filling your screen, then you have to press Ctrl+C twice (once to stop the ping and one for the RedBoot prompt).

Deleted lines 521-522:

Problems With Ethernet Switch

June 24, 2006, at 09:55 AM by Reedy Boy -- Added ms timing to ping -t -w on windows
Changed lines 157-158 from:
  1. At the command prompt type ping -t -w 10 192.168.0.1
to:
  1. At the command prompt type ping -t -w 1 10 192.168.0.1
June 11, 2006, at 02:02 AM by Rob Lockhart -- change ect to etc in C:\\WINDOWS\\system32\\drivers\\ect\\hosts
Changed line 76 from:

If it takes a long time (~30 seconds) for telnet to display the Trying 192.168.0.1... message, it may be that telnet is trying to do a Reverse DNS lookup, and timing out (this happened on my fresh install of Fedora Core 4). To get into RedBoot, telnet needs to execute immediately, so try adding 192.168.0.1 to your /etc/hosts (or c:\windows\system32\drivers\ect\hosts) file. For example, call it 'slug' and then use telnet slug 9000 instead of the IP address.

to:

If it takes a long time (~30 seconds) for telnet to display the Trying 192.168.0.1... message, it may be that telnet is trying to do a Reverse DNS lookup, and timing out (this happened on my fresh install of Fedora Core 4). To get into RedBoot, telnet needs to execute immediately, so try adding 192.168.0.1 to your /etc/hosts (or c:\WINDOWS\system32\drivers\etc\hosts) file. For example, call it 'slug' and then use telnet slug 9000 instead of the IP address.

May 31, 2006, at 02:19 PM by Jerome Paschoud -- Add an other way to route the 192.168.0.1 address on a Mac
Changed lines 48-49 from:

try sudo route add 192.168.0.1 -interface en0 on an OS X box.

to:

try sudo route add 192.168.0.1 -interface en0 on an OS X box.

In my case the previous method didn't work, so here's mine:
- Get the mac address of your slug. One way to do that is to connect to the web interface of the slug, then open a terminal and then type arp -a and jot down the 12 digit number. For example the MAC address of the device 192.168.1.1 shown here
? (192.168.1.1) at 0:a0:c5:45:b:17 on en0 [ethernet] is 00:A0:C5:45:0B:17 (if there is a single digit between colums add a leading 0).
- Duplicate your main internet connection port. Go in System Preferences in network, in the second popup list called Show display the Network Port Configurations, select your main internet port then hit the button duplicate. Once done, select your newly created port in the second popup list and clic the TCP/IP tab. In the Configure IP v4: select Using DHCP with manual address, then, just under, enter any IP of the form 192.168.0.x, where x is anything between 2 and 254. An alternative to that is just to set your main internet port to 192.168.0.1, but in this case you will no longer be able to connect to internet during the RedBoot operation, and do not forget to revert back your configuration once finished with RedBoot.
- Now you need to create the route to the 192.168.0.1 address. Do so by entering in a terminal the fellowing command: sudo arp -s 192.168.0.1 the_mac_address_from_point_1. You can then check that the route exist with the command arp -a.
- From now on you can contimue to read from the 'Trying To Access RedBoot' of this page. However I advise you to use the tcl script wich is working great on the absence of arping on OS X.

May 18, 2006, at 11:01 PM by ckl -- Split a couple of long lines that were upsetting formatting
Changed lines 135-136 from:
 # don't forget to turn autoselect when finished, and note it's "media autoselect" and "mediaopt full-duplex"
to:
 # don't forget to turn autoselect when finished, and note it's "media autoselect" 
 #  and "mediaopt full-duplex"
Changed lines 193-196 from:

As root:

 echo -e "\0377\0364\0377\0375\0006" >break.bin; sudo /sbin/arping -f 192.168.0.1; sudo nc -D -vvv 192.168.0.1 9000 <break.bin; telnet 192.168.0.1 9000
to:

This one-liner has been reformatted on to several lines, but should be executed on a single line. As root:

 echo -e "\0377\0364\0377\0375\0006" >break.bin; sudo /sbin/arping -f 192.
 168.0.1; sudo nc -D -vvv 192.168.0.1 9000 <break.bin; telnet 192.168.0.1 9000
May 14, 2006, at 01:29 AM by Leon 'likewise' Woestenberg --
Deleted lines 193-195:
 eecho -e "\0377\0364\0377\0375\0006" >break.bin; /sbin/arping -f 192.168.0.1; nc -vvv 192.168.0.1 9000 <break.bin; nc 192.168.0.1 9000
May 14, 2006, at 01:28 AM by Leon 'likewise' Woestenberg -- replaced last telnet with netcat in my automated solution
Changed lines 190-191 from:

This is a fully automated one-liner from the shell. I created it using the manual method and Ethereal, using netcat to mimick the codes (for CTRL-C) being sent. Somehow, sudo and -D is needed to netcat for this to work. Tested from FC5?.

to:

This is a fully automated one-liner from the shell. I created it using the manual method and Ethereal, using netcat to mimick the codes (for CTRL-C) being sent. Somehow, root and -vvv seems needed to netcat for this to work (timing issue??). Tested from FC5?. I could not further automate input to RedBoot (yet), which would be a very nice feature.

As root:

 eecho -e "\0377\0364\0377\0375\0006" >break.bin; /sbin/arping -f 192.168.0.1; nc -vvv 192.168.0.1 9000 <break.bin; nc 192.168.0.1 9000
May 14, 2006, at 01:10 AM by Leon 'likewise' Woestenberg -- New simple automated method using netcat for RedBoot CTRL-C
Added lines 188-195:

Netcat

This is a fully automated one-liner from the shell. I created it using the manual method and Ethereal, using netcat to mimick the codes (for CTRL-C) being sent. Somehow, sudo and -D is needed to netcat for this to work. Tested from FC5?.

 echo -e "\0377\0364\0377\0375\0006" >break.bin; sudo /sbin/arping -f 192.168.0.1; sudo nc -D -vvv 192.168.0.1 9000 <break.bin; telnet 192.168.0.1 9000

-- Leon Woestenberg (likewise @IRC).

April 24, 2006, at 04:56 AM by Pascal Charest -- Changed the syntax of ping command for OSX
Changed lines 133-134 from:
 sudo ping -i .3 -c 192.168.0.1 ;  telnet 192.168.0.1 9000
to:
 sudo ping -i .3 -c 1 192.168.0.1 ;  telnet 192.168.0.1 9000
Added lines 141-142:

I've changed the ping command, the syntax wasn't correct for OSX (-c 1) - Pacharest

March 09, 2006, at 02:33 AM by JH -- args for difftime were swapped and telnet was never started
Changed line 400 from:
    while (difftime(time(NULL), stoptime) > 0) {
to:
    while (difftime(stoptime, time(NULL)) > 0) {
February 19, 2006, at 01:20 AM by cStyle -- fix windows path
Changed line 69 from:

If it takes a long time (~30 seconds) for telnet to display the Trying 192.168.0.1... message, it may be that telnet is trying to do a Reverse DNS lookup, and timing out (this happened on my fresh install of Fedora Core 4). To get into RedBoot, telnet needs to execute immediately, so try adding 192.168.0.1 to your /etc/hosts (or c:\windows\system32\etc\drivers\hosts) file. For example, call it 'slug' and then use telnet slug 9000 instead of the IP address.

to:

If it takes a long time (~30 seconds) for telnet to display the Trying 192.168.0.1... message, it may be that telnet is trying to do a Reverse DNS lookup, and timing out (this happened on my fresh install of Fedora Core 4). To get into RedBoot, telnet needs to execute immediately, so try adding 192.168.0.1 to your /etc/hosts (or c:\windows\system32\drivers\ect\hosts) file. For example, call it 'slug' and then use telnet slug 9000 instead of the IP address.

February 17, 2006, at 03:23 PM by Phil S-J -- Formatting edits and Windows hosts file location
Changed lines 9-10 from:

RedBoot is a bootloader. The bootloaders job is to load things into the computer's memory and start up the OS, in this case Linux or the original NSLU2 firmware (which is Linux based, as well).

to:

RedBoot is a bootloader. The bootloader's job is to load things into the computer's memory and start up the OS, in this case Linux or the original NSLU2 firmware (which is Linux based, as well).

Changed lines 62-67 from:

Proceed to the next steps.\\

to:

Proceed to the next steps.

  1. FreeBSD?
    To add an alias, try ifconfig XX0? alias 192.168.0.2 192.168.0.255, where XX0? is the interface to add the alias to.
  1. Hosts setup (to prevent Telnet RDNS timeout)\\
Changed line 69 from:
  1. Hosts setup (to prevent Telnet RDNS timeout)\\
to:

If it takes a long time (~30 seconds) for telnet to display the Trying 192.168.0.1... message, it may be that telnet is trying to do a Reverse DNS lookup, and timing out (this happened on my fresh install of Fedora Core 4). To get into RedBoot, telnet needs to execute immediately, so try adding 192.168.0.1 to your /etc/hosts (or c:\windows\system32\etc\drivers\hosts) file. For example, call it 'slug' and then use telnet slug 9000 instead of the IP address.

Changed lines 71-78 from:

If it takes a long time (~30 seconds) for telnet to display the Trying 192.168.0.1... message, it may be that telnet is trying to do a Reverse DNS lookup, and timing out (this happened on my fresh install of Fedora Core 4). To get into RedBoot, telnet needs to execute immediately, so try adding 192.168.0.1 to your /etc/hosts file. For example, call it 'slug' and then use telnet slug 9000 instead of the IP address.

  1. FreeBSD?
    To add an alias, try ifconfig XX0? alias 192.168.0.2 192.168.0.255, where XX0? is the interface to add the alias to.
Changing your subnet may be an easy option if you already use a router which doles out IP addresses to your PC (via DHCP). Many home routers default to IP addresses of the form 192.168.1.xxx, subnet mask of 255.255.255.0 If this is you, telling the router (via its web or telnet interface) to use a subnet mask of 255.255.0.0 may be all that's required.
to:

Changing your subnet may be an easy option if you already use a router which doles out IP addresses to your PC (via DHCP). Many home routers default to IP addresses of the form 192.168.1.xxx, subnet mask of 255.255.255.0 If this is you, telling the router (via its web or telnet interface) to use a subnet mask of 255.255.0.0 may be all that's required.

February 12, 2006, at 06:57 PM by Bear -- C program for automatic redboot connection -- fixed formatting
Changed line 347 from:
 #include <stdio.h>
to:

[@#include <stdio.h>

Changed lines 431-432 from:
to:

@]

February 12, 2006, at 06:49 PM by Bear --
Changed lines 281-282 from:

Perl Script

to:

Perl Script

Changed lines 335-433 from:
to:

C program using Berkeley Sockets

The following C program will attempt a connection 10 times/second. After it successed it will send the control-C character, wait for a response, and then drop you into a telnet session. It's trivial to modify this program to run an arbitrary program with stdin/stdout connected to the slug instead of your terminal.

The telnet session has the tilde '~' character as the escape code. That can be very useful if the connection isn't dropped after a reset!

As always you can subsequently reconnect with telnet until the next reboot.

Tested on Debian linux (2006-02-12).

Preconditions: You need to run this from a machine can see the slug's 192.168.0.1 address.

 #include <stdio.h>
 #include <unistd.h>
 #include <errno.h>
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <sys/time.h>
 #include <netdb.h>

 #define SLUG_IP     "192.168.0.1" 
 #define SLUG_PORT   "9000"

 #define TELNET      "/usr/bin/telnet"

 char * const telnet_args[] = { "telnet", "-e", "~", SLUG_IP, SLUG_PORT, NULL };

 int main()
 {
    struct sockaddr_in sin;
    fd_set rfds, wfds;
    struct timeval timeout;
    int n;
    char buffer[1024];
    time_t stoptime = time(NULL);
    char outbound[] = { 0x03, 0x00 };
    char *out = outbound;

    int s = socket(PF_INET, SOCK_STREAM, 0);

    // set up socket address for port 9000 at 192.168.0.1
    struct hostent *h = gethostbyname(SLUG_IP);
    sin.sin_family = h->h_addrtype;
    sin.sin_port = htons(atoi(SLUG_PORT));
    memcpy(&sin.sin_addr, h->h_addr_list[0], h->h_length);

    // attempt to connect to remote system.
    while (connect(s, (struct sockaddr *) &sin, sizeof sin) == -1) {
        switch (errno) {
            case ECONNREFUSED:
            case ENETUNREACH:
            case EHOSTUNREACH:
                timeout.tv_sec = 0;
                timeout.tv_usec = 100000;  // every 100 ms
                select(1, NULL, NULL, NULL, &timeout);
                continue;
            default:
                fprintf(stderr, "connect error: s)\n",
                        strerror(errno), h->h_name);
                return errno;
        }
    }

    FD_ZERO(&rfds);
    FD_ZERO(&wfds);
    stoptime = time(NULL) + 15;
    while (difftime(time(NULL), stoptime) > 0) {
        FD_SET(s, &rfds);
        FD_SET(s, &wfds);
        timeout.tv_sec = 0;
        timeout.tv_usec = 10000;  // every 10 ms
        n = select(s+1, &rfds, &wfds, NULL, &timeout);
        if (n == -1) {
            fprintf(stderr, "select error: %s\n", strerror(errno));
            return errno;
        }

        if (n == 0) { continue; }

        if (*out != 0 && FD_ISSET(s, &wfds)) { write(s, out++, 1); }

        if (FD_ISSET(s, &rfds)) {
            n = read(s, buffer, sizeof buffer);
            write(1, buffer, n);
            close(s);
            execv(TELNET, telnet_args);
            fprintf(stderr, "exec (s\n", TELNET, strerror(errno));
            exit(0); // just in case
        }
    }

    fprintf(stderr, "could not capture telnet port");
    close(s);

    return 0;
 }

-- Bear

January 26, 2006, at 01:55 PM by dharple -- Cleaned up formatting around FreeBSD connection example
Deleted line 178:

@

Changed lines 182-183 from:

@

to:
January 26, 2006, at 01:34 PM by dharple -- Add notes on connecting to RedBoot from a FreeBSD box
Added lines 69-71:
  1. FreeBSD?
    To add an alias, try ifconfig XX0? alias 192.168.0.2 192.168.0.255, where XX0? is the interface to add the alias to.
Changed lines 175-184 from:
to:

Accessing RedBoot from FreeBSD?

A small variation on the OSX instructions worked under FreeBSD?:

@

 # Ping using a fraction of a second (must be root to do so)
 # Turn off name lookup on telnet
 sudo ping -i .3 -o 192.168.0.1 ;  telnet -N 192.168.0.1 9000

@

January 16, 2006, at 11:24 PM by frankvh -- Added comment about changing router subnet to 255.255.0.0
Changed lines 69-70 from:
to:
Changing your subnet may be an easy option if you already use a router which doles out IP addresses to your PC (via DHCP). Many home routers default to IP addresses of the form 192.168.1.xxx, subnet mask of 255.255.255.0 If this is you, telling the router (via its web or telnet interface) to use a subnet mask of 255.255.0.0 may be all that's required.
January 12, 2006, at 07:13 PM by dougbo -- screwing around with formatting
Changed lines 125-134 from:
  1. For a direct connection, turning off autoselect may help

sudo ifconfig <myifc-probably-en0> mediaopt full-duplex

  1. Ping using a fraction of a second (must be root to do so)

sudo ping -i .3 -c 192.168.0.1 ; telnet 192.168.0.1 9000

  1. don't forget to turn autoselect when finished, and note it's "media autoselect" and "mediaopt
  2. full-duplex"
  3. sudo ifconfig <myifc-probably-en0> media autoselect
to:

@

 # For a direct connection, turning off autoselect may help
 sudo ifconfig <myifc-probably-en0> mediaopt full-duplex

 # Ping using a fraction of a second (must be root to do so)
 sudo ping -i .3 -c 192.168.0.1 ;  telnet 192.168.0.1 9000

 # don't forget to turn autoselect when finished, and note it's "media autoselect" and "mediaopt full-duplex"
 # sudo ifconfig <myifc-probably-en0> media autoselect

@

January 12, 2006, at 07:06 PM by dougbo -- add osx hints
Added lines 120-136:

Accessing RedBoot from OSX

Again, a small variant of *Nix seemed to help getting through from OSX:

  1. For a direct connection, turning off autoselect may help

sudo ifconfig <myifc-probably-en0> mediaopt full-duplex

  1. Ping using a fraction of a second (must be root to do so)

sudo ping -i .3 -c 192.168.0.1 ; telnet 192.168.0.1 9000

  1. don't forget to turn autoselect when finished, and note it's "media autoselect" and "mediaopt
  2. full-duplex"
  3. sudo ifconfig <myifc-probably-en0> media autoselect

-Doug

December 08, 2005, at 12:48 PM by thx1011 -- Added Windows TCP/IP configuration
Added lines 50-63:
  1. Windows XP SP2? (Common to other versions)
    Your computer must have a fixed IP address.
    Goto Network Connections on the Control Panel.
    Choose your Network card that it's connected to the NSLU2 via a crossover cable or via network switch (I have this and it worked)
    Select Properties
    Select TCP/IP Protocol on the List and again the button properties. Again make sure that you have a FIXED IP.
    Select Advanced
    Add a SECONDARY IP by selecting the ADD button on below the box that shows the current fixed IP.
    Input 192.168.0.2
    Exit all windows with Apply and Ok.
    Open an MS-DOS windows.
    Try to ping the new IP 192.168.0.2. It should work.
    Proceed to the next steps.
    \\
November 07, 2005, at 01:29 PM by cweber -- Ensure Speed & Duplex setting of network card on windows systems
Changed lines 137-139 from:
to:

(On some systems you should ensure that the "Speed & Duplex" setting of your network card is set to "100 MBit? Full". "Auto" won't work. --cweber)

November 06, 2005, at 01:22 PM by Phil S-J -- Added Telnet RDNS tip
Added lines 50-55:
  1. Hosts setup (to prevent Telnet RDNS timeout)

    If it takes a long time (~30 seconds) for telnet to display the Trying 192.168.0.1... message, it may be that telnet is trying to do a Reverse DNS lookup, and timing out (this happened on my fresh install of Fedora Core 4). To get into RedBoot, telnet needs to execute immediately, so try adding 192.168.0.1 to your /etc/hosts file. For example, call it 'slug' and then use telnet slug 9000 instead of the IP address.


October 17, 2005, at 11:07 AM by Adrian Shotton --
Changed lines 199-200 from:

Example run:

to:

Example Usage:

1. Save the script into a file (we'll assume you call it RedBoot.tcl).

2. Run the script (e.g. tclsh RedBoot.tcl)

3. Power up the slug.

4. If everything works you should see:

Changed lines 225-226 from:
 Success!! - You should now be able to telnet to 192.168.0.1:9000
to:
 Success - You should now be able to telnet to 192.168.0.1:9000
October 17, 2005, at 10:38 AM by Adrian Shotton -- Adding details of a TCL script to help access RedBoot
Changed lines 132-221 from:
to:

Automated Methods

Note: Once you succeed in connecting to 192.168.0.1 port 9000 and sending in a control-C to halt the automatic boot process, RedBoot will keep listening on 192.168.0.1:9000 until the next reboot. This means you that if you can automate catching the telnet you'll subsequently be able to telnet in manually.

TCL Script

The following TCL script automates the process of telnet-ing in and issuing the control-C (and also dumps the RedBoot version info). Once the script has done the time-sensitive work you can telnet in at your leisure using your favorite telnet client.

The script was written and tested under windows but should work equally well on Unix or Linux.

Preconditions: You need to run this from a machine can see the slug's 192.168.0.1 address.

 set done  0
 set state START

 proc on_nslu_writable { sock } {

     global state
     fileevent $sock writable ""
     if { $state == "START" } {

         puts "Connected to NSLU2..."
         set state CONN
         fileevent $sock readable [ list on_nslu_readable $sock ]
         after 1000 [list puts $sock ""]
     }
 }

 proc on_nslu_readable { sock } {

     global done state
     set data [read $sock]
     if { [eof $sock] } { puts "Got EOF - Failed."; exit }
     puts $data

     if { [string first "enter ^C to abort" $data] > 0 } {

         puts -nonewline $sock [format "%c" 3]

     } elseif { [string first "RedBoot>" $data] >= 0 } {

         if { $state == "SENTVER" } {
             set done 1
             puts ""
             puts -nonewline " Success - You should now be able"
             puts " to telnet to 192.168.0.1:9000"
         } else {
             puts $sock "version"
             set state SENTVER
         }
     }
 }

 proc try_nslu { } {

     global state
     if { $state == "START" } {
         set sock [socket -async "192.168.0.1" 9000]
         fileevent $sock writable [ list on_nslu_writable $sock ]
         fconfigure $sock -blocking false -buffering none
         after 500 try_nslu
     }
 }

 try_nslu
 vwait done

Example run:

 Connected to NSLU2...
 == Executing boot script in 1.800 seconds - enter ^C to abort

 ^C
 RedBoot>

 RedBoot(tm) bootstrap and debug environment [ROMRAM]
 Red Hat certified release, version 1.92 - built 15:16:07, Feb  3 2004

 Platform: IXDP425 Development Platform (XScale) 
 Copyright (C) 2000, 2001, 2002, Red Hat, Inc.

 RAM: 0x00000000-0x02000000, 0x000723a0-0x01ff3000 available
 FLASH: 0x50000000 - 0x50800000, 64 blocks of 0x00020000 bytes each.
 RedBoot>

 Success!! - You should now be able to telnet to 192.168.0.1:9000

-- Adrian Shotton

October 03, 2005, at 10:22 AM by mschnell --
Changed lines 9-10 from:

RedBoot is a bootloader. The bootloaders job is to load things into the computer's memory and start up the OS, in this case Linux or the original NSLU2 firmware.

to:

RedBoot is a bootloader. The bootloaders job is to load things into the computer's memory and start up the OS, in this case Linux or the original NSLU2 firmware (which is Linux based, as well).

October 01, 2005, at 07:51 AM by mschnell --
Changed lines 9-10 from:

RedBoot is a bootloader. The bootloaders job is to load things into the computer's memory and start up the OS, in this case Linux.

to:

RedBoot is a bootloader. The bootloaders job is to load things into the computer's memory and start up the OS, in this case Linux or the original NSLU2 firmware.

October 01, 2005, at 07:48 AM by mschnell --
Changed lines 129-132 from:

(A "mouseless" option is: type "telnet 192.168.0.1 9000" in another command line window, power on the slug, hit <Enter> as soon as you see a ping reply and hit <ctrl-C> as soon as the telnet Window opens. <Worked easily for me, MSchnell?>)

to:

(A "mouseless" option is: type "telnet 192.168.0.1 9000" in another command line window, power on the slug, hit <Enter> as soon as you see a ping reply and hit <ctrl-C> as soon as the telnet Window opens. <Worked easily for me, --MSchnell?>)

October 01, 2005, at 07:47 AM by mschnell --
Changed lines 129-132 from:

(Another option is: type "telnet 192.168.0.1 9000" in another command line window, power on the slug, hit <Enter> as soon as you see a ping reply and hit <ctrl-C> as soon as the telnet Window opens. <Worked easily for me, MSchnell?>)

to:

(A "mouseless" option is: type "telnet 192.168.0.1 9000" in another command line window, power on the slug, hit <Enter> as soon as you see a ping reply and hit <ctrl-C> as soon as the telnet Window opens. <Worked easily for me, MSchnell?>)

October 01, 2005, at 07:45 AM by mschnell --
Changed lines 129-132 from:

(Another option is: type "telnet 192.168.0.1 9000" in another command line window, power on the slug, hit <Enter> as soon as you see a ping reply and hit <ctrl-C> as soon as the telnet Window opens. <MSchnell?)

to:

(Another option is: type "telnet 192.168.0.1 9000" in another command line window, power on the slug, hit <Enter> as soon as you see a ping reply and hit <ctrl-C> as soon as the telnet Window opens. <Worked easily for me, MSchnell?>)

October 01, 2005, at 07:43 AM by mschnell --
Changed lines 113-114 from:
  1. Open hyper terminal and set this to connect via winsocks to 192.168.0.1 on port 9000 (Another option is doing "telnet 192.168.0.1 9000" from another command line window. <MSchnell?)
to:
  1. Open hyper terminal and set this to connect via winsocks to 192.168.0.1 on port 9000.
Added lines 128-132:

(Another option is: type "telnet 192.168.0.1 9000" in another command line window, power on the slug, hit <Enter> as soon as you see a ping reply and hit <ctrl-C> as soon as the telnet Window opens. <MSchnell?)

October 01, 2005, at 07:38 AM by mschnell --
Changed lines 113-114 from:
  1. Open hyper terminal and set this to connect via winsocks to 192.168.0.1 on port 9000
to:
  1. Open hyper terminal and set this to connect via winsocks to 192.168.0.1 on port 9000 (Another option is doing "telnet 192.168.0.1 9000" from another command line window. <MSchnell?)
September 19, 2005, at 02:55 PM by jerobins -- add warning re: ethernet switches and spanning-tree
Changed line 29 from:

An easy way to get around this is by connecting via a cheap hub which doesn't have such hangups.\\

to:

An easy way to get around this is by connecting via a cheap hub which doesn't have such hangups. Be aware that an Ethernet switch with spanning tree enabled will cause you to miss the window of opportunity too. The port will not enter forwarding state fast enough. Some vendors have features to override this (Eg. Cisco has PortFast).\\

Added lines 250-251:

Problems With Ethernet Switch

August 21, 2005, at 03:30 PM by yvasilev -- Third manual method without root privileges
Added lines 90-99:

Third manual method

This method is the variation of the previous two methods, with the advantage that it does not require root privileges to run.

while ! ping -W 1 -c 1 192.168.0.1 2>&1 >/dev/null; do true; done && telnet 192.168.0.1 9000

This command will keep pinging RedBoot's IP address until first success, and then open into RedBoot where you'll have to press Ctrl+C to stop it form auto booting.

--yvasilev?

August 15, 2005, at 06:54 PM by tman --
Changed lines 90-91 from:

Accessing Redboot from Windows

to:

Accessing RedBoot from Windows

August 15, 2005, at 06:54 PM by tman --
Changed lines 82-87 from:

ping -f 192.168.0.1; telnet 192.168.0.1 900

This will display a continuos set of points (one for each packet that didn't had a response). When you will see the points stopping from filling your screen, then you have to press Ctrl+C twice (once to stop the ping and one for the RedBoot propmt).

Probably this second method will work better if you connect the NLSU2? directly to your computer, but I am not sure (I did it this way from the start).

to:

ping -f 192.168.0.1; telnet 192.168.0.1 9000

This will display a continous set of points (one for each packet that didn't had a response). When you will see the points stopping from filling your screen, then you have to press Ctrl+C twice (once to stop the ping and one for the RedBoot prompt).

Probably this second method will work better if you connect the NSLU2 directly to your computer, but I am not sure (I did it this way from the start).

--EddyP?

August 15, 2005, at 04:44 PM by EddyP --
Changed lines 84-85 from:

This will display a continuos set of points (one for each packet that didn't had a response). When you will see the points stopping from filling your scree, then you have to press Ctrl+C twice (once to stop the ping and one for the RedBoot propmt).

to:

This will display a continuos set of points (one for each packet that didn't had a response). When you will see the points stopping from filling your screen, then you have to press Ctrl+C twice (once to stop the ping and one for the RedBoot propmt).

August 15, 2005, at 04:43 PM by EddyP --
Added lines 62-63:

First manual method

Added lines 78-87:

Second manual method

This is a variation on the same theme, but can help you if you don't want/have arping installed. it has the disadvantage of being "more" manual than the previous. The command you must type is:

ping -f 192.168.0.1; telnet 192.168.0.1 900

This will display a continuos set of points (one for each packet that didn't had a response). When you will see the points stopping from filling your scree, then you have to press Ctrl+C twice (once to stop the ping and one for the RedBoot propmt).

Probably this second method will work better if you connect the NLSU2? directly to your computer, but I am not sure (I did it this way from the start).

June 19, 2005, at 02:35 PM by tman --
Deleted lines 37-39:
  1. Linux
    su to root and execute the command route add 192.168.0.1 eth0\\
Added lines 39-42:
  1. Linux
    su to root and execute the command route add 192.168.0.1 eth0
    \\
Changed lines 56-57 from:
  1. Once telnet connects, issue a Ctrl-C to tell RedBoot you want access
to:
  1. Once telnet connects, press Ctrl-C to tell RedBoot you want access
Deleted line 75:
June 18, 2005, at 09:41 PM by crh -- Adding an alias interface creates a new route and also provides an IP address for the local host on the subnet.
Changed lines 40-41 from:

su to root and execute the command route add 192.168.0.1 eth0

to:

su to root and execute the command route add 192.168.0.1 eth0

Alternately, set up an alias interface, like so:
ifconfig eth0:1 inet 192.168.0.2 broadcast 192.168.0.255 netmask 255.255.255.0
Adding an alias will also automatically add a subnet route.

June 13, 2005, at 09:00 PM by tman --
Changed lines 3-23 from:

The purpose of this page is to help you get access to the Redboot bootloader.

The main reason for accessing the Reboot bootloader is when you are attempting to Recover From A Bad Flash.

About Redboot

Redboot is a bootloader. The bootloader's job is to load things into the computer's memory and start up Linux.

RedBoot is quite sophisticated, and has a user interface that you can access by telnet or serial. You can use it to load things into memory by TFTP, write to flash, and similar tasks. You should also be cautious when accessing Redboot, as you can muck up the basic behaviour of the slug if you're not careful.

For more information about Redboot in general, consult Redhat's website or use Google.

How does Redboot access work on the NSLU2?

When the slug starts up, for a few seconds Redboot will listen for telnet connections on port 9000. Redboot will insist on being 192.168.0.1 for this window, regardless of what you've set the normal Linux portion of your slug to be. If it doesn't receive a telnet connection during that window, it will attempt to load the Linux code into main memory and start executing it.

Preparation for Redboot access

Before attempting to access Redboot, there are some problem that you may need to sort out first.

to:

The purpose of this page is to help you get access to the RedBoot bootloader.

The main reason for accessing the RedBoot bootloader is when you are attempting to Recover From A Bad Flash.

About RedBoot

RedBoot is a bootloader. The bootloaders job is to load things into the computer's memory and start up the OS, in this case Linux.

RedBoot is quite sophisticated, and has a user interface that you can access by telnet or serial. You can use it to load things into memory by TFTP, write to flash, and similar tasks. You should also be cautious when accessing RedBoot, as you can muck up the basic behaviour of the slug if you're not careful.

For more information about RedBoot in general, consult Red Hat's website or use Google.

How does RedBoot access work on the NSLU2?

When the slug starts up, for a few seconds RedBoot will listen for telnet connections on port 9000. RedBoot will insist on being 192.168.0.1 for this window, regardless of what you've set the address of the normal Linux portion of your slug to be. If it doesn't receive a telnet connection during that window, it will attempt to load the Linux kernel into main memory from flash and execute it.

Preparation for RedBoot access

Before attempting to access RedBoot, there are some problem that you may need to sort out first.

Changed line 25 from:

Since 192.168.0.1 could conflict with other equipment on many people's LANs, it is often easier to access Redboot if it is setup either on it's own dedicaed network or directly to your computer with a crossover cable.\\

to:

Since 192.168.0.1 could conflict with other equipment on many people's LANs, it is often easier to access RedBoot if it is setup either on it's own dedicated network or directly to your computer with a crossover cable.\\

Changed line 27 from:

However, if you have a fancy network card with auto-MDI (i.e. you don't need to worry about your Ethernet cable wiring, as with all new Macs, for instance) you may end up missing the brief telnet window as your computer's Ethernet card tries to work out what sex it should be.\\

to:

However, if you have a fancy network card with auto-MDI/MDIX (i.e. you don't need to worry about whether to use a straight through or a crossover cable, as with all new Macs for instance) you may end up missing the brief telnet window as your computer's Ethernet card tries to work out what sex it should be.\\

Changed lines 31-33 from:

If you try to use an Ethernet switch, make sure that it can appear as any other device in the subnet other than 192.168.0.1.\\

to:

You could also try to set your Ethernet card to disable auto-MDI/MDIX, but this may be hard to do and may complicate your life in the future if you forget to turn it back on.

  1. IP Address Setup\\
Deleted lines 34-37:

You could also try to force your Ethernet card to not allow auto-MDI, but this may be hard to do and may complicate your life in the future if you forget to turn it back on.

  1. IP Address Setup
    \\
Changed lines 45-52 from:
  1. Windows
    (similar route commands)

Trying To Access Redboot

The main trick with accessing Redboot is the shortness of the telnet window. Since the telnet port is only alive for 2 seconds, it can be a bit of a challenge to do everything required within that time frame. You must:

to:

Trying To Access RedBoot

The main trick with accessing RedBoot is the shortness of the telnet window. Since the telnet port is only alive for 2 seconds, it can be a bit of a challenge to do everything required within that time frame. You must:

Changed lines 51-58 from:
  1. Once telnet connects, issue a Ctrl-C to tell Redboot you want access

We will first describe basic manual methods of accessing Redboot and then delve into more automated methods.

Accessing Redboot from *nix

to:
  1. Once telnet connects, issue a Ctrl-C to tell RedBoot you want access

We will first describe basic manual methods of accessing RedBoot and then delve into more automated methods.

Accessing RedBoot from *nix

Changed lines 61-63 from:

then, the telnet starts trying as soon as the IP address on the slug will respond, and all you have to do is remember to press Ctrl+C. :)

to:

then, the telnet starts trying as soon as the IP address on the slug will respond, and all you have to do is remember to press Ctrl+C. :)

Changed lines 65-66 from:

What you do need to be ready with is your fingers to type Ctrl-C, as when the RedBoot prompt appears you will have between 2 and 0.1 of a second to hit it. It's something of a reaction test - hold down control after you start the above command, and be ready to mash C as soon as anything appears on the screen.

to:

What you do need to be ready with is your fingers to type Ctrl-C, as when the RedBoot prompt appears you will have between 2 and 0.1 of a second to hit it. It's something of a reaction test - hold down control after you start the above command, and be ready to mash C as soon as anything appears on the screen.

Deleted line 75:
Changed lines 83-85 from:

reply window you have to work with.

to:

reply window you have to work with.

Changed lines 92-98 from:

Move your other hand ready to hit CTRL C

  1. Watch the CMD windows. In about 5 seconds with the Ready light coloured Amber, youshould see a ping from 192.168.0.1
  2. Hit the mouse button with one hand and then ctrl C with the other.\\
to:

Move your other hand ready to hit Ctrl+C

  1. Watch the CMD windows. In about 5 seconds with the Ready light coloured amber, you should see a ping from 192.168.0.1
  2. Hit the mouse button with one hand and then Ctrl+C with the other.\\
Changed lines 98-100 from:

If the Ready light starts to flash Green, try again from the NSLU2 power-up.

to:

If the Ready light starts to flash green it means you missed the window so try again. You will need to disconnect the NSLU2 and reconnect it to reset it.

Changed lines 102-103 from:

Here is a perl script to automate the entire process.

to:

Here is a Perl script to automate the entire process.

Changed lines 155-158 from:

Example using RH Linux

You have to do the "control+C" really really quick.

to:

Example using Red Hat Linux

You have to do the Ctrl+C really really quick.

Deleted line 219:
Deleted line 221:
May 19, 2005, at 03:44 PM by barrym -- Cleanup for readability
Changed lines 1-40 from:

When the slug starts up, for a few seconds it listens for a telnet connection on port 9000. Redboot will insist on being 192.168.0.1 for this, whatever you've set the Linux portion of your slug to be. Since this will conflict with other equipment on many people's LANs, you may like to connect directly with a crossover cable and ignore the network for the moment. NB: If you have a fancy network card with auto-MDI (ie you don't need to worry about crossover or straight-through, as with all new Macs, for instance) you may end up missing the brief telnet window as the card tries to work out what sex it should be today. Consider connecting via a cheap hub which doesn't have such hangups. If your computer is not on the 192.168.0.x subnet, you can either change its address temporarily or add a new route. (For Linux, su to root and execute the command route add 192.168.0.1 eth0)

... or in Panther, a mask of 255.255.0.0 seems to work just fine You can also try sudo route add 192.168.0.1 -interface en0 on an OS X box.

Type the command telnet 192.168.0.1 9000 into a terminal window, but don't press return just yet. Turn off the slug (pulling out the power if need be, then plugging it in) and be ready to turn it on with the power button. Press the button, then press return on your computer to start the telnet connection. Some people report that they have to start telnet at just the right moment to "catch it" - I find mine will sit there with "trying 192.168.0.1..." as long as necessary until the slug starts listening.

If you're still having difficulty, try opening two terminal windows: In the first window, ping 192.168.0.1 until stopped. Then in the second window, have the telnet 192.168.0.1 9000 command typed out but don't execute it yet. When you see a reply from 192.168.0.1 in the first window, hit enter in the second window to start telnet.

What you do need to be ready with is a finger on Ctrl-C, as when the RedBoot prompt appears you will have between 2 and 0.1 of a second to hit it. It's something of a reaction test - hold down control when you start telnet, and be ready to mash C as soon as anything appears on the screen. You should then get a RedBoot> prompt that you can type at. If you miss it, simply cycle the slug and try again.

Once you have the RedBoot> Prompt, type help to see which commands you now have at your fingertips.

An easier way to "catch" the telnet window is:

to:

Purpose

The purpose of this page is to help you get access to the Redboot bootloader.

The main reason for accessing the Reboot bootloader is when you are attempting to Recover From A Bad Flash.

About Redboot

Redboot is a bootloader. The bootloader's job is to load things into the computer's memory and start up Linux.

RedBoot is quite sophisticated, and has a user interface that you can access by telnet or serial. You can use it to load things into memory by TFTP, write to flash, and similar tasks. You should also be cautious when accessing Redboot, as you can muck up the basic behaviour of the slug if you're not careful.

For more information about Redboot in general, consult Redhat's website or use Google.

How does Redboot access work on the NSLU2?

When the slug starts up, for a few seconds Redboot will listen for telnet connections on port 9000. Redboot will insist on being 192.168.0.1 for this window, regardless of what you've set the normal Linux portion of your slug to be. If it doesn't receive a telnet connection during that window, it will attempt to load the Linux code into main memory and start executing it.

Preparation for Redboot access

Before attempting to access Redboot, there are some problem that you may need to sort out first.

  1. Ethernet Cable Linkage

    Since 192.168.0.1 could conflict with other equipment on many people's LANs, it is often easier to access Redboot if it is setup either on it's own dedicaed network or directly to your computer with a crossover cable.

    However, if you have a fancy network card with auto-MDI (i.e. you don't need to worry about your Ethernet cable wiring, as with all new Macs, for instance) you may end up missing the brief telnet window as your computer's Ethernet card tries to work out what sex it should be.

    An easy way to get around this is by connecting via a cheap hub which doesn't have such hangups.

    If you try to use an Ethernet switch, make sure that it can appear as any other device in the subnet other than 192.168.0.1.

    You could also try to force your Ethernet card to not allow auto-MDI, but this may be hard to do and may complicate your life in the future if you forget to turn it back on.
  2. IP Address Setup

    Your computer might not also be setup to talk on the 192.168.0.x network.

    If your computer is not on the 192.168.0.x subnet, you can either change its address temporarily or add a new route.
    1. Linux
      su to root and execute the command route add 192.168.0.1 eth0
    2. OS X
      try sudo route add 192.168.0.1 -interface en0 on an OS X box.
    3. Windows
      (similar route commands)

Trying To Access Redboot

The main trick with accessing Redboot is the shortness of the telnet window. Since the telnet port is only alive for 2 seconds, it can be a bit of a challenge to do everything required within that time frame. You must:

  1. Recognise when the telnet session is available
  2. Start your telnet client talking to 192.168.0.1:9000
  3. Once telnet connects, issue a Ctrl-C to tell Redboot you want access

We will first describe basic manual methods of accessing Redboot and then delve into more automated methods.

Accessing Redboot from *nix

An easy way to "catch" the telnet window is:

Added lines 75-116:

What you do need to be ready with is your fingers to type Ctrl-C, as when the RedBoot prompt appears you will have between 2 and 0.1 of a second to hit it. It's something of a reaction test - hold down control after you start the above command, and be ready to mash C as soon as anything appears on the screen.

If you're successful, you should then get a RedBoot> prompt that you can type at.

If you miss it, simply pull the power on the slug and try again.

Accessing Redboot from Windows

This worked for me. You can use similar ideas for any other graphical environment.

  1. Open a Windows command prompt (ie by typing cmd at the start and run prompt)
  2. At the command prompt type ping -t -w 10 192.168.0.1
  3. Do this process a couple more times and arrange the windows so that they're all visible.

    This increases the number of pings and gives you a better chance of seeing the very shortreply window you have to work with.
  4. Open hyper terminal and set this to connect via winsocks to 192.168.0.1 on port 9000
  5. Set both windows so you can see them, set the ping running and have hyperterminal in the foreground.
  6. With your left hand on the mouse button and the mouse cursor over the connect buttonin hyperterminal, turn on the NSLU.

    Move your other hand ready to hit CTRL C
  7. Watch the CMD windows. In about 5 seconds with the Ready light coloured Amber, youshould see a ping from 192.168.0.1
  8. Hit the mouse button with one hand and then ctrl C with the other.

    If the Ready light starts to flash Green, try again from the NSLU2 power-up.

Perl Script

Changed lines 169-170 from:

A successful example on RH Linux:

to:

Example using RH Linux

Changed lines 236-275 from:

Accessing Redboot from Windows

This worked for me.

  1. Open a Windows command prompt (ie by typing cmd at the start and run prompt)
  2. At the command prompt type ping -t -w 10 192.168.0.1
  3. Do this process a couple more times and arrange the windows so that they're all visible.

    This increases the number of pings and gives you a better chance of seeing the very shortreply window you have to work with.
  4. Open hyper terminal and set this to connect via winsocks to 192.168.0.1 on port 9000
  5. Set both windows so you can see them, set the ping running and have hyperterminal in the\ foreground.
  6. With your left hand on the mouse button and the mouse cursor over the connect buttonin hyperterminal, turn on the NSLU.

    Move your other hand ready to hit CTRL C
  7. Watch the CMD windows. In about 5 seconds with the Ready light coloured Amber, youshould see a ping from 192.168.0.1
  8. hit the mouse button with one hand and then ctrl C with the other.

    If the Ready light starts to flash Green, try again from the NSLU2 power-up.

Worked for me every time!!

to:

Sources:

May 05, 2005, at 06:18 PM by willpost -- Moving my addition up two paragraphs
Added lines 27-29:

If you're still having difficulty, try opening two terminal windows: In the first window, ping 192.168.0.1 until stopped. Then in the second window, have the telnet 192.168.0.1 9000 command typed out but don't execute it yet. When you see a reply from 192.168.0.1 in the first window, hit enter in the second window to start telnet.

Deleted lines 36-38:

If you're still having difficulty, try opening two terminal windows: In the first window, ping 192.168.0.1 until stopped. Then in the second window, have telnet 192.168.0.1 9000 command typed out but don't execute it yet. When you see a reply from 192.168.0.1 in the first window, hit enter in the second window to start telnet.

May 05, 2005, at 06:16 PM by willpost -- Using a second terminal with ping to catch Telnet window
Added lines 34-36:

If you're still having difficulty, try opening two terminal windows: In the first window, ping 192.168.0.1 until stopped. Then in the second window, have telnet 192.168.0.1 9000 command typed out but don't execute it yet. When you see a reply from 192.168.0.1 in the first window, hit enter in the second window to start telnet.

April 14, 2005, at 06:33 PM by repvik --
Added lines 52-53:

NOTE: Looks like the parameter for upslug has changed from --reset to -r (repvik)

Changed line 61 from:
 system("/usr/local/bin/upslug --reset");
to:
 system("/usr/local/bin/upslug -r");
April 04, 2005, at 08:29 AM by barrym --
Changed line 166 from:

Open a command prompt Window (ie by typing cmd at the start and run prompt)

to:
  1. Open a Windows command prompt (ie by typing cmd at the start and run prompt)
Changed line 168 from:

in this type ping -t 192.168.0.1

to:
  1. At the command prompt type ping -t -w 10 192.168.0.1
Changed lines 170-173 from:

open hyper terminal and set this to connect via winsocks to 192.168.0.1 on port 9000

to:
  1. Do this process a couple more times and arrange the windows so that they're all visible.

    This increases the number of pings and gives you a better chance of seeing the very shortreply window you have to work with.\\
Deleted line 174:

set both windows so you can see them, set the ping running and have hyperterminal in the foreground.

Changed lines 176-177 from:

with your left hand on the mouse button and the mouse cursor over the connect button in hyperterminal turn on the NSLU. Move your other hand ready to hit CTRL C

to:
  1. Open hyper terminal and set this to connect via winsocks to 192.168.0.1 on port 9000
Changed lines 178-191 from:

Watch the CMD window, as soon as you see a ping from 192.168.0.1 hit the mouse button with one hand and then ctrl C with the other.

to:
  1. Set both windows so you can see them, set the ping running and have hyperterminal in the\ foreground.
  2. With your left hand on the mouse button and the mouse cursor over the connect buttonin hyperterminal, turn on the NSLU.

    Move your other hand ready to hit CTRL C
  3. Watch the CMD windows. In about 5 seconds with the Ready light coloured Amber, youshould see a ping from 192.168.0.1
  4. hit the mouse button with one hand and then ctrl C with the other.

    If the Ready light starts to flash Green, try again from the NSLU2 power-up.
March 24, 2005, at 08:52 PM by Dave Redfern --
Added lines 159-185:

Accessing Redboot from Windows

This worked for me. Open a command prompt Window (ie by typing cmd at the start and run prompt)

in this type ping -t 192.168.0.1

open hyper terminal and set this to connect via winsocks to 192.168.0.1 on port 9000

set both windows so you can see them, set the ping running and have hyperterminal in the foreground.

with your left hand on the mouse button and the mouse cursor over the connect button in hyperterminal turn on the NSLU. Move your other hand ready to hit CTRL C

Watch the CMD window, as soon as you see a ping from 192.168.0.1 hit the mouse button with one hand and then ctrl C with the other.

Worked for me every time!!

March 05, 2005, at 10:27 PM by saylerthewalrusorg --
Added line 16:

You can also try sudo route add 192.168.0.1 -interface en0 on an OS X box.

January 07, 2005, at 10:47 AM by tman --
Changed line 94 from:

An Sucessful example on RH Linux:

to:

A successful example on RH Linux:

Changed line 96 from:

You have to do the "control+C" really realy quick.

to:

You have to do the "control+C" really really quick.

Changed lines 98-107 from:

[root@dual root]# arping -f 192.168.0.1;telnet 192.168.0.1 9000 ARPING 192.168.0.1 from 192.168.1.253 eth0 Unicast reply from 192.168.0.1 [00:0F:66:7B:FE:96] 9.641ms Sent 7 probes (7 broadcast(s)) Received 1 response(s) Trying 192.168.0.1... Connected to 192.168.0.1 (192.168.0.1). Escape character is '^]'. == Executing boot script in 1.820 seconds - enter ^C to abort ^C

to:
 [root@dual root]# arping -f 192.168.0.1;telnet 192.168.0.1 9000
 ARPING 192.168.0.1 from 192.168.1.253 eth0
 Unicast reply from 192.168.0.1 [00:0F:66:7B:FE:96]  9.641ms
 Sent 7 probes (7 broadcast(s))
 Received 1 response(s)
 Trying 192.168.0.1...
 Connected to 192.168.0.1 (192.168.0.1).
 Escape character is '^]'.
 == Executing boot script in 1.820 seconds - enter ^C to abort
 ^C
January 07, 2005, at 04:39 AM by tjyang --
Changed line 94 from:

An example on RH Linux:

to:

An Sucessful example on RH Linux:

Changed lines 96-103 from:
 [root@dual root]# telnet 192.168.0.1 9000;telnet 192.168.0.1 9000;telnet 192.168.0.1 9000;telnet 192.168.0.1 9000;telnet 192.168.0.1 9000;telnet 192.168.0.1 9000
 Trying 192.168.0.1...
 telnet: Unable to connect to remote host: No route to host
 Trying 192.168.0.1... 
 Connected to 192.168.0.1 (192.168.0.1). 
 Escape character is '^]'. 
 == Executing boot script in 1.600 seconds - enter ^C to abort
 ^C 
to:

You have to do the "control+C" really realy quick.

[root@dual root]# arping -f 192.168.0.1;telnet 192.168.0.1 9000 ARPING 192.168.0.1 from 192.168.1.253 eth0 Unicast reply from 192.168.0.1 [00:0F:66:7B:FE:96] 9.641ms Sent 7 probes (7 broadcast(s)) Received 1 response(s) Trying 192.168.0.1... Connected to 192.168.0.1 (192.168.0.1). Escape character is '^]'. == Executing boot script in 1.820 seconds - enter ^C to abort ^C

January 03, 2005, at 05:11 PM by tman --
Deleted lines 14-74:

@@ An example on RH Linux:
[root@dual root]# telnet 192.168.0.1 9000;telnet 192.168.0.1 9000;telnet 192.168.0.1 9000;telnet 192.168.0.1 9000;telnet 192.168.0.1 9000;telnet 192.168.0.1 9000
Trying 192.168.0.1...
telnet: Unable to connect to remote host: No route to host
Trying 192.168.0.1...
Connected to 192.168.0.1 (192.168.0.1).
Escape character is '^]'.
== Executing boot script in 1.600 seconds - enter ^C to abort
^C
RedBoot> help
go to assign mode
assign
Set/Query the system console baud rate
baudrate [-b <rate>]
sercomm boot flow
boot
Manage machine caches
cache [ON | OFF]
Display/switch console channel
channel [-1|<channel number>]
Compute a 32bit checksum [POSIX algorithm] for a range of memory
cksum -b <location> -l <length>
Display (hex dump) a range of memory
dump -b <location> [-l <length>] [-s] [-1|2|4]
Execute an image - with MMU off
exec [-w timeout] [-b <load addr> [-l <length>]]
[-r <ramdisk addr> [-s <ramdisk length>]]
[-c "kernel command line"] [<entry_point>]
Manage FLASH images
fis {cmds} \\ Execute code at a location \\

   go [-w <timeout>] [entry] 
Help about help?
help [<topic>] \\

Set/change IP addresses
ip_address [-l <local_ip_address>] [-h <server_address>]
Load a file
load [-r] [-v] [-d] [-h <host>] [-m <varies>] [-c <channel_number>]
[-b <base_address>] <file_name>
Compare two blocks of memory
mcmp -s <location> -d <location> -l <length> [-1|-2|-4]
Fill a block of memory with a pattern
mfill -b <location> -l <length> -p <pattern> [-1|-2|-4]
move kernel&ramdisk to ram
move
Network connectivity test \\

   ping [-v] [-n <count>] [-l <length>] [-t <timeout>] [-r <rate>] 
[-i <IP_addr>] -h <IP_addr>
Reset the system
reset
Set/Read MAC address for NPE ethernet ports
set_npe_mac [-p <portnum>] [xx:xx:xx:xx:xx:xx]
go to upgrade mode
upgrade
Display RedBoot version information
version
Display (hex dump) a range of memory
x -b <location> [-l <length>] [-s] [-1|2|4]
RedBoot>@@
Deleted line 34:
Added lines 94-154:

An example on RH Linux:

 [root@dual root]# telnet 192.168.0.1 9000;telnet 192.168.0.1 9000;telnet 192.168.0.1 9000;telnet 192.168.0.1 9000;telnet 192.168.0.1 9000;telnet 192.168.0.1 9000
 Trying 192.168.0.1...
 telnet: Unable to connect to remote host: No route to host
 Trying 192.168.0.1... 
 Connected to 192.168.0.1 (192.168.0.1). 
 Escape character is '^]'. 
 == Executing boot script in 1.600 seconds - enter ^C to abort
 ^C 
 RedBoot> help 
 go to assign mode 
    assign 
 Set/Query the system console baud rate 
    baudrate [-b <rate>] 
 sercomm boot flow 
    boot 
 Manage machine caches 
    cache [ON | OFF] 
 Display/switch console channel 
    channel [-1|<channel number>] 
 Compute a 32bit checksum [POSIX algorithm] for a range of memory 
    cksum -b <location> -l <length> 
 Display (hex dump) a range of memory 
    dump -b <location> [-l <length>] [-s] [-1|2|4] 
 Execute an image - with MMU off 
    exec [-w timeout] [-b <load addr> [-l <length>]] 
         [-r <ramdisk addr> [-s <ramdisk length>]] 
         [-c "kernel command line"] [<entry_point>] 
 Manage FLASH images 
    fis {cmds} 
 Execute code at a location 
    go [-w <timeout>] [entry] 
 Help about help? 
    help [<topic>]
 Set/change IP addresses
    ip_address [-l <local_ip_address>] [-h <server_address>]
 Load a file
    load [-r] [-v] [-d] [-h <host>] [-m <varies>] [-c <channel_number>]
         [-b <base_address>] <file_name>
 Compare two blocks of memory
    mcmp -s <location> -d <location> -l <length> [-1|-2|-4]
 Fill a block of memory with a pattern
    mfill -b <location> -l <length> -p <pattern> [-1|-2|-4]
 move kernel&ramdisk to ram
    move
 Network connectivity test
    ping [-v] [-n <count>] [-l <length>] [-t <timeout>] [-r <rate>]
         [-i <IP_addr>] -h <IP_addr>
 Reset the system
    reset
 Set/Read MAC address for NPE ethernet ports
    set_npe_mac [-p <portnum>] [xx:xx:xx:xx:xx:xx]
 go to upgrade mode
    upgrade
 Display RedBoot version information
    version
 Display (hex dump) a range of memory
    x -b <location> [-l <length>] [-s] [-1|2|4]
 RedBoot>
December 31, 2004, at 04:54 AM by tjyang --
Added lines 15-75:

@@ An example on RH Linux:
[root@dual root]# telnet 192.168.0.1 9000;telnet 192.168.0.1 9000;telnet 192.168.0.1 9000;telnet 192.168.0.1 9000;telnet 192.168.0.1 9000;telnet 192.168.0.1 9000
Trying 192.168.0.1...
telnet: Unable to connect to remote host: No route to host
Trying 192.168.0.1...
Connected to 192.168.0.1 (192.168.0.1).
Escape character is '^]'.
== Executing boot script in 1.600 seconds - enter ^C to abort
^C
RedBoot> help
go to assign mode
assign
Set/Query the system console baud rate
baudrate [-b <rate>]
sercomm boot flow
boot
Manage machine caches
cache [ON | OFF]
Display/switch console channel
channel [-1|<channel number>]
Compute a 32bit checksum [POSIX algorithm] for a range of memory
cksum -b <location> -l <length>
Display (hex dump) a range of memory
dump -b <location> [-l <length>] [-s] [-1|2|4]
Execute an image - with MMU off
exec [-w timeout] [-b <load addr> [-l <length>]]
[-r <ramdisk addr> [-s <ramdisk length>]]
[-c "kernel command line"] [<entry_point>]
Manage FLASH images
fis {cmds} \\ Execute code at a location \\

   go [-w <timeout>] [entry] 
Help about help?
help [<topic>] \\

Set/change IP addresses
ip_address [-l <local_ip_address>] [-h <server_address>]
Load a file
load [-r] [-v] [-d] [-h <host>] [-m <varies>] [-c <channel_number>]
[-b <base_address>] <file_name>
Compare two blocks of memory
mcmp -s <location> -d <location> -l <length> [-1|-2|-4]
Fill a block of memory with a pattern
mfill -b <location> -l <length> -p <pattern> [-1|-2|-4]
move kernel&ramdisk to ram
move
Network connectivity test \\

   ping [-v] [-n <count>] [-l <length>] [-t <timeout>] [-r <rate>] 
[-i <IP_addr>] -h <IP_addr>
Reset the system
reset
Set/Read MAC address for NPE ethernet ports
set_npe_mac [-p <portnum>] [xx:xx:xx:xx:xx:xx]
go to upgrade mode
upgrade
Display RedBoot version information
version
Display (hex dump) a range of memory
x -b <location> [-l <length>] [-s] [-1|2|4]
RedBoot>@@
December 26, 2004, at 11:46 PM by kamcgough --
Added lines 15-16:

... or in Panther, a mask of 255.255.0.0 seems to work just fine

Changed lines 95-96 from:

[http://groups.yahoo.com/group/nslu2-linux/message/1096][http://groups.yahoo.com/group/nslu2-linux/message/1106]

to:

[http://groups.yahoo.com/group/nslu2-linux/message/1096][http://groups.yahoo.com/group/nslu2-linux/message/1106]

November 26, 2004, at 06:06 PM by jsilence --
Added lines 31-33:

Once you have the RedBoot> Prompt, type help to see which commands you now have at your fingertips.

October 10, 2004, at 01:14 PM by pbnexuscouk --
Added lines 38-39:

If your arping doesn't understand -f, you probably have the standalone "arping" package. Install the version from iputils instead. (For Debian: apt-get install iputils-arping)

October 10, 2004, at 01:54 AM by tman --
Changed line 15 from:

Type the command telnet 192.168.0.1 9000 into a terminal window, but

to:

Type the command telnet 192.168.0.1 9000 into a terminal window, but

October 09, 2004, at 07:36 PM by tman --
Changed line 41 from:
  • Assumes you have done "ifconfig eth0:1 192.168.0.2" or something similar so you can reach the 192.168.0 net.
to:
  • Assumes you have done ifconfig eth0:1 192.168.0.2 or something similar so you can reach the 192.168.0 net.
October 09, 2004, at 07:35 PM by tman --
Changed lines 1-2 from:

When the slug starts up, for a few seconds it listens for a telnet connection on port 9000. Redboot will

to:

When the slug starts up, for a few seconds it listens for a telnet connection on port 9000. Redboot will

Changed lines 11-13 from:

a cheap hub which doesn't have such hangups. If your computer is not on the 192.168.0.x subnet, you can either change its address temporarily or add a new route. (For Linux, su to root and execute the command 'route add 192.168.0.1 eth0')

to:

a cheap hub which doesn't have such hangups. If your computer is not on the 192.168.0.x subnet, you can either change its address temporarily or add a new route. (For Linux, su to root and execute the command route add 192.168.0.1 eth0)

Changed line 15 from:

Type the command telnet 192.168.0.1 9000 into a terminal window, but

to:

Type the command telnet 192.168.0.1 9000 into a terminal window, but

Changed lines 24-25 from:

What you do need to be ready with is a finger on ctrl-c, as when the Redboot prompt appears you will have between 2 and 0.1 of a second to

to:

What you do need to be ready with is a finger on Ctrl-C, as when the RedBoot prompt appears you will have between 2 and 0.1 of a second to

Changed line 28 from:

screen. You should then get a Redboot> prompt that you can type at. If

to:

screen. You should then get a RedBoot> prompt that you can type at. If

Changed line 33 from:
       sudo arping -f 192.168.0.1; telnet 192.168.0.1 9000
to:

sudo arping -f 192.168.0.1; telnet 192.168.0.1 9000

Changed line 36 from:

slug will respond, and all you have to do is remember to press ^C. :)

to:

slug will respond, and all you have to do is remember to press Ctrl+C. :)

Deleted line 86:
September 17, 2004, at 08:37 PM by sfo --
Added lines 35-85:

Here is a perl script to automate the entire process.

  • Uses upslug (installed in /usr/local/bin) to reset the slug.
  • Assumes you have done "ifconfig eth0:1 192.168.0.2" or something similar so you can reach the 192.168.0 net.
  • Assumes you are running as root.
  • Tosses you into a telnet session after aborting the boot sequence.
 #!/usr/bin/perl -w
 # telnet_redboot.pl - ./upslug --reset;arping -f 192.168.0.1;telnet 192.168.0.1 9000

 use Net::Telnet ();

 my $host = '192.168.0.1';

 system("/usr/local/bin/upslug --reset");
 printf("NSLU2 reset\n");
 system("/sbin/arping -f $host");
 printf("NSLU2 arping response\n");

 my $t = new Net::Telnet (Port => 9000, Timeout => 30);
 if(!defined($t)){
     print "new Net::Telnet failed\n";
     exit(1);
 } # if
 my $ok;
 $ok = $t->errmode("return");
 $ok = $t->open($host);
 if(!defined($ok)){
     print "open('$host') failed\n";
     $t->close();
     exit(1);
 } # if

 # == Executing boot script in 1.930 seconds - enter ^C to abort

 my $line;
 while($line = $t->getline()){
        $line =~ s/[\r\n]//;
        print "-> $line\n";
        if($line =~ m/enter \^C to abort/){
                $t->put(chr(3)); # send ^C
                print "<- \^C\n";
                $t->close();
                sleep(1);
                system("telnet $host 9000");
                exit(0);
        } # if
 } # while
 $t->close();
September 13, 2004, at 06:08 PM by ka6sox --
Changed line 4 from:

equipment on many people's LANs?, you may like to connect directly with

to:

equipment on many people's LANs, you may like to connect directly with

September 13, 2004, at 03:07 PM by CodeWhacker --
Changed lines 10-12 from:

a cheap hub which doesn't have such hangups. You will also need to change your computer's ip address to one on the 19.168.0 subnet if it isn't already.

to:

a cheap hub which doesn't have such hangups. If your computer is not on the 192.168.0.x subnet, you can either change its address temporarily or add a new route. (For Linux, su to root and execute the command 'route add 192.168.0.1 eth0')

September 13, 2004, at 06:40 AM by rwhitby --
Changed lines 37-38 from:

[http://groups.yahoo.com/group/nslu2-linux/message/1096] [http://groups.yahoo.com/group/nslu2-linux/message/1106]

to:

[http://groups.yahoo.com/group/nslu2-linux/message/1096][http://groups.yahoo.com/group/nslu2-linux/message/1106]

September 13, 2004, at 06:40 AM by rwhitby --
Changed lines 37-38 from:

[Original Source: http://groups.yahoo.com/group/nslu2-linux/message/1096, http://groups.yahoo.com/group/nslu2-linux/message/1106]

to:

[http://groups.yahoo.com/group/nslu2-linux/message/1096] [http://groups.yahoo.com/group/nslu2-linux/message/1106]

September 13, 2004, at 03:30 AM by rwhitby --
Changed lines 37-38 from:

[--[Original Source: http://groups.yahoo.com/group/nslu2-linux/message/1096, http://groups.yahoo.com/group/nslu2-linux/message/1106]--]

to:

[Original Source: http://groups.yahoo.com/group/nslu2-linux/message/1096, http://groups.yahoo.com/group/nslu2-linux/message/1106]

September 13, 2004, at 03:30 AM by rwhitby --
Changed lines 37-38 from:

[Original Source: http://groups.yahoo.com/group/nslu2-linux/message/1096]

to:

[--[Original Source: http://groups.yahoo.com/group/nslu2-linux/message/1096, http://groups.yahoo.com/group/nslu2-linux/message/1106]--]

September 13, 2004, at 03:29 AM by rwhitby --
Added lines 36-37:

[Original Source: http://groups.yahoo.com/group/nslu2-linux/message/1096]

September 12, 2004, at 09:52 PM by rwhitby --
Added lines 29-35:

An easier way to "catch" the telnet window is:

       sudo arping -f 192.168.0.1; telnet 192.168.0.1 9000

then, the telnet starts trying as soon as the IP address on the slug will respond, and all you have to do is remember to press ^C. :)

September 12, 2004, at 09:51 PM by rwhitby --
Changed lines 1-28 from:

Describe TelnetRedBootAccess? here.

to:

When the slug starts up, for a few seconds it listens for a telnet connection on port 9000. Redboot will insist on being 192.168.0.1 for this, whatever you've set the Linux portion of your slug to be. Since this will conflict with other equipment on many people's LANs?, you may like to connect directly with a crossover cable and ignore the network for the moment. NB: If you have a fancy network card with auto-MDI (ie you don't need to worry about crossover or straight-through, as with all new Macs, for instance) you may end up missing the brief telnet window as the card tries to work out what sex it should be today. Consider connecting via a cheap hub which doesn't have such hangups. You will also need to change your computer's ip address to one on the 19.168.0 subnet if it isn't already.

Type the command telnet 192.168.0.1 9000 into a terminal window, but don't press return just yet. Turn off the slug (pulling out the power if need be, then plugging it in) and be ready to turn it on with the power button. Press the button, then press return on your computer to start the telnet connection. Some people report that they have to start telnet at just the right moment to "catch it" - I find mine will sit there with "trying 192.168.0.1..." as long as necessary until the slug starts listening.

What you do need to be ready with is a finger on ctrl-c, as when the Redboot prompt appears you will have between 2 and 0.1 of a second to hit it. It's something of a reaction test - hold down control when you start telnet, and be ready to mash C as soon as anything appears on the screen. You should then get a Redboot> prompt that you can type at. If you miss it, simply cycle the slug and try again.