Press "Enter" to skip to content

Category: Juniper

Alternate FTP method to upload JunOS image to Juniper switch

I have had some issues getting the ftp command on a Juniper switch to download a new JunOS image from a FTP server. Basically I would initiate this command:

request system software add ftp://test:[email protected]/jinstall-ex-2200-12.3R1.7-domestic-signed.tgz      

and then I would get this in return

Checking pending install on fpc0
Fetching package…
error: File-fetch failed
error: Couldn’t retrieve package ftp://test:[email protected]/jinstall-ex-2200-12.3R1.7-domestic-signed.tgz

And after that I was basically stuck and had no idea what else to do to resolve it and how to pull down this image. Then I knew the underlying OS running on the switch is freebsd linux and this is shows when the switch first boots up. When the switch boots you get into the command line 0% which allows you to perform linux type commands, and this includes using the ftp package, only when you type “cli” you get into JunOS.

So with that in mind here is my attempt to update the image via FTP in 0% mode. You must make sure to type in “binary” to transfer the images in binary mode. I have used /var/tmp on the switch since that had most amount of space.

root@alcatron-switch:RE:0% cd /var/tmp

root@alcatron-switch:RE:0% ftp
Connected to
Name ( test
331 Password required for test
230 Logged on
Remote system type is UNIX.
ftp> binary
200 Type set to I
ftp> mget jinstall-ex-2200-12.3R1.7-domestic-signed.tgz
mget jinstall-ex-2200-12.3R1.7-domestic-signed.tgz?
200 Port command successful
150 Opening data channel for file transfer.
100% |**************************************************| 96491 KB    00:00 ETA
226 Transfer OK
98807485 bytes received in 130.93 seconds (736.97 KB/s)
ftp> quit
221 Goodbye

Now we can see the image has been downloaded as its in the directory when typing ls.
root@alcatron-switch:RE:0% ls

Then to load the image to the switch simple type:

root@alcatron-switch:RE:0% cli
root@alcatron-switch>request system software add validate /var/tmp/jinstall-ex-2200-12.3R1.7-domestic-signed.tgz
root@alcatron-switch>request system reboot

I hope this has been been useful to someone as it has to me, i have no idea why the ftp method worked when outside the JunOS cli but inside JunOS it failed with an error.

1 Comment

Clearing alarms on a new Juniper switch

I recently have been using a Juniper EX2200 switch, which is quite nice, 48port, POE and much cheaper than a Cisco equivalent like a 2960S. When you initially turn on the switch you will see some alarm lights which is a Red LED and a Amber LED. The Red LED basically means the management port at back of the switch isnt in use, and the Amber means the configuration isnt saved as part of the rescue if anything goes wrong. To switch off these lights simply perform these commands:

RED LED – set chassis alarm management-ethernet link-down ignore
AMBER LED – request system configuration rescue save


Show Configuration on Juniper simplistic view

On Juniper devices usually you issue  “show configuration” which displays the configuration file how the device is configured as per below:

root@alcatron-switch> show configuration
## Last commit: 2013-01-11 14:14:58 UTC by root
version 11.4R1.6;
system {
    host-name alcatron-switch;
    root-authentication {
        encrypted-password “$1$GJroMRrQ$.UkiU”; ## SECRET-DATA
    syslog {
        user * {
            any emergency;
        file messages {
            any notice;
            authorization info;
        file interactive-commands {
            interactive-commands any;

This is completely different compared to the cisco equivalent, to make things easier in a simplistic view similar to cisco simply issue “show configuration | display set” and voila everything is set out much neater and easy to copy and paste.

root@alcatron-switch> show configuration | display set
set version 11.4R1.6
set system host-name alcatron-switch
set system root-authentication encrypted-password “$1$GJroMRrQ$.UkiU”
set system services
set system syslog user * any emergency
set system syslog file messages any notice
set system syslog file messages authorization info
set system syslog file interactive-commands interactive-commands any

Leave a Comment