Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

header-navigation
keyboard_arrow_up
close
keyboard_arrow_left
list Table of Contents
file_download PDF
{ "lLangCode": "en", "lName": "English", "lCountryCode": "us", "transcode": "en_US" }
English
keyboard_arrow_right

Installing Software on MX Series Routers Using a USB Flash Drive

date_range 26-Feb-24

You can install or upgrade Junos OS on an MX Series router using a USB flash drive.

Note:

This topic describes overall MX Series router information.

For details about specific MX Series routers, see the Hardware Guide for that device.

To access the Hardware Guide for a specific device, review Junos OS by Product and select the device. A link to the Hardware Guide for the device is displayed, along with links to other device specific guides.

Before you begin, determine which software package you need and download it onto the USB flash drive. For information on which packages to use for which upgrades, see Junos OS and Junos OS Evolved Installation Package Names.

Note:

This topic describes a standard Junos OS installation and upgrade with a Junos OS installation package.

For information about a Junos OS recovery installation, see Recovery of Junos OS.

For information about upgrading to Junos OS with upgraded FreeBSD, see Upgrading and Downgrading to Junos with Upgraded FreeBSD.

Pre-Installing Junos OS on a USB Flash Drive

A USB flash drive must have Junos OS stored on it before using the software to install on or upgrade the router.

To pre-install the software on a USB flash drive, ensure the following:

  • The USB flash drive meets the MX Series router USB port specifications.

  • The USB flash drive is empty and formatted as FAT-32.

  • The USB flash drive capacity is large enough to accommodate the size of the desired Junos OS package.)

  • A computer to download the software package from the download site and copy it to the USB flash drive.

To download a Junos OS package onto a USB flash drive:

  1. Insert the USB flash drive into your computer.
  2. Navigate to the download site to download the desired Junos OS package to the USB flash drive.

    Recommended download site: MX Series Software Downloads.

  3. Choose your router model and version and select a software package to download from the Install Media menu.
  4. Download the software package.

    (Optional) Rename the software package for identification purposes.

  5. Eject the USB flash drive when the download has completed.

Installing Junos OS from a USB Flash Drive

Note:

As a best practice, save a system snapshot of the installed Junos OS image and configuration files for backup purposes before starting the installation procedure.

For details about saving a system snapshot, see request system snapshot (Junos OS with FreeBSD Prior to Release 10).

Use the following steps to install a Junos OS package from a USB flash drive.

  1. Ensure that the router has been powered off.
  2. Insert the USB flash drive into the USB port on the router.
  3. Power on the router.

    Powering on the router starts the loader script and checks for a Junos OS package on the USB flash drive.

  4. When the install prompt appears, enter Yes.
  5. When the installation has completed, reboot the router:
    content_copy zoom_out_map
    user@host> request system reboot
  6. After the reboot has completed, log in and verify that the new version of the software has been properly installed.
    content_copy zoom_out_map
    user@host> show version

Upgrading Junos OS using a USB Flash Drive

The procedure to upgrade Junos OS on an MX Series router using a USB flash drive is different than installing Junos OS from a USB flash drive. The install procedure includes booting the device from a USB flashdrive and installing a fresh image of Junos OS without preserving configuration files or data files. The upgrade procedure includes replacing the existing Junos OS with a different version of Junos OS on the device while preserving existing configuration files and data files.

The procedure to upgrade includes:

  1. On the router, enter the shell as the root user:
    content_copy zoom_out_map
    user@router#> start shell user root
    
    Password:
    
  2. List the existing devices on the router.
    content_copy zoom_out_map
    root@router# ls directory name

    For example:

    content_copy zoom_out_map
    root@router# ls /dev/da*
    /dev/da0 /dev/da0s1c /dev/da0s2a /dev/da0s3 /dev/da0s3e
    /dev/da0s1 /dev/da0s1f /dev/da0s2c /dev/da0s3c
    /dev/da0s1a /dev/da0s2 /dev/da0s2f /dev/da0s3d
  3. Insert the USB flash drive into the USB port on the router.

    The console messages describe the device ID of the USB flash drive.

    You can use the results of the ls directory name command to determine the device ID of the USB flash drive by comparing it to the list of device IDs of the previous step.

    Note:

    If the console session is not available while inserting the USB, check the /var/log directory for messages related to da. For example, use the show log messages | match da command to display the messages.

    In this example, /dev/da2s1 is the device ID of the USB flash drive.

    content_copy zoom_out_map
    root@router# router1: TOSHIBA TransMemory, rev 2.00/1.00, addr 3
    da2 at router-sim1 bus 1 target 0 lun 0
    da2: <TOSHIBA TransMemory 5.00> Removable Direct Access SCSI-0 device 
    da2: 40.000MB/s transfers
    da2: 983MB (2013184 512 byte sectors: 64H 32S/T 983C)
    
    root@router# ls /dev/da*
    /dev/da0 /dev/da0s1c /dev/da0s2a /dev/da0s3 /dev/da0s3e
    /dev/da0s1 /dev/da0s1f /dev/da0s2c /dev/da0s3c /dev/da2
    /dev/da0s1a /dev/da0s2 /dev/da0s2f /dev/da0s3d /dev/da2s1
  4. Create a directory for the USB drive to mount to.
    content_copy zoom_out_map
    mkdir /var/tmp/directory name

    For example:

    content_copy zoom_out_map
    root@router# mkdir /var/tmp/usb
  5. Mount the USB drive to the new directory and check the contents of the directory.
    content_copy zoom_out_map
    mount_msdosfs /dev/usb device ID /var/tmp/ directory name
    ls /var/tmp/ directory name

    For example:

    content_copy zoom_out_map
    root@router# mount_msdosfs /dev/da2s1 /var/tmp/usb
    root@router# ls /var/tmp/usb
    MX_image.tgz
  6. Copy the Junos OS package from the USB flash drive to the /var/tmp/ directory of the router's internal storage.
    content_copy zoom_out_map
    cp /var/tmp/directory name/installation-package-name /var/tmp
    Note:

    Use the ls directory name command to verify the Junos OS package was copied to the router's internal storage.

    In the example, the MX_image.tgz file on the USB flash drive is copied to the /var/tmp directory on the router.

    content_copy zoom_out_map
    root@router# cp /var/tmp/usb/MX_image.tgz /var/tmp
    root@router# ls /var/tmp
    MX_image.tgz
    
  7. Unmount the USB flash drive after the Junos OS package has been copied to the router's internal storage.
    content_copy zoom_out_map
    umount /var/tmp/directory name

    For example:

    content_copy zoom_out_map
    root@router# umount /var/tmp/usb
    root@% router1: at uhub0 port 1 (addr 3) disconnected
    (da1:router-sim1:1:0:0): lost device
    (da1:router-sim1:1:0:0): removing device entry
    router1: detached

Proceed to the next section to continue upgrading Junos OS.

Note:

For devices with Routing Engines with VMhost support, you can use the USB device as an emergency boot device. For more information, see Creating an Emergency Boot Device for Routing Engines with VM Host Support. After the junos-vmhost-install-usb image is written to the USB drive using the dd command, you can boot to the USB using the request vmhost reboot usb command.

Installing Software on Routing Devices (Junos OS)

Routing devices are delivered with Junos OS preinstalled on them. As new features and software fixes become available, you must upgrade Junos OS to use them. You can install software on single and redundant routing engines.

Installing the Software Package on a Router with a Single Routing Engine (Junos OS)

Before you install a new software release on a device, you should back up the current system.

Note:

Starting in Junos OS release 20.3R1, ACX710 routers support limited images.

To upgrade the software on a router or switch:

  1. Install the new software package using the request system software add command:
    content_copy zoom_out_map
    user@host> request system software add /var/tmp/installation-package

    The variable installation-package is the name of the installation package. Specify the absolute path on the local disk. For package name prefixes, see Junos OS Installation Package Names.

    Note:

    (Junos OS only) To install multiple software packages at one time, you can use the request system software add set command. For more information on this command, see the set option in request system software add (Junos OS).

    CAUTION:

    Do not include the re0 | re1 option when you install a package using the request system software add command, if the Routing Engine on which the package is located and the Routing Engine on which you want to install the package are the same. In such cases, the package gets deleted after a successful upgrade.

  2. Reboot the device to start the new software:
    content_copy zoom_out_map
    user@host>  request system reboot
    Reboot the system ? [yes,no] (no) yes
    
    Note:

    You must reboot the device to load the new software release on the device.

    To terminate the installation, do not reboot the device. Instead, finish the installation and then issue the request system software delete package-name command. This is your last chance to stop the installation.

    The software is loaded when you reboot the system. Installation can take between 5 and 10 minutes. The device then reboots from the boot device on which the software was just installed. When the reboot is complete, the device displays the login prompt.

    While the software is being upgraded, the Routing Engine on which you are performing the installation does not route traffic.

  3. Log in and verify the release of the software installed:
    • To verify release for installation of a Junos OS release, use the show version command.

      content_copy zoom_out_map
      user@host>  show version
      

Installing the Software Package on a Device with Redundant Routing Engines (Junos OS)

If the device has two Routing Engines, perform a Junos OS installation on each Routing Engine separately to minimize disruption to network operation.

To upgrade redundant Routing Engines, you first install the new Junos OS release on the backup Routing Engine while keeping the currently running software version on the primary Routing Engine. After making sure that the new software version is running correctly on the backup Routing Engine, you switch device control to the backup Routing Engine. Finally, you install the new software on the new backup Routing Engine. For detailed procedures, see the following subsections:

Preparing the Device for the Installation (Junos OS)

Determine if this is the best procedure for upgrading your device:

Warning:

If graceful Routing Engine switchover (GRES) or nonstop active routing (NSR) is enabled when you initiate a software installation, the software does not install properly. Make sure you deactivate GRES (if it is enabled). By default, NSR is disabled. If NSR is enabled, remove the nonstop-routing statement from the [edit routing-options] hierarchy level to disable it.

To ensure GRES and NSR are disabled:

  1. Log in to the primary Routing Engine’s console.

    For more information about logging in to the Routing Engine through the console port, see the specific hardware guide for your device.

  2. From the CLI operational prompt, enter configuration mode:

    content_copy zoom_out_map
    {master}
    user@host> configure
    Entering configuration mode
      
    {master} [edit]
    user@host#
  3. Disable nonstop active routing (NSR) (supported on switches running Junos OS Release 10.4 or later):

    content_copy zoom_out_map
    {master}[edit] 
    user@host# delete routing-options nonstop-routing 
  4. Disable nonstop-bridging if it is enabled:

    content_copy zoom_out_map
    {master}[edit]
    user@host# delete protocols layer2-control nonstop-bridging
    
  5. Disable Routing Engine redundancy if enabled:

    content_copy zoom_out_map
    {master}[edit]
    user@host# (delete | deactivate) chassis redundancy graceful-switchover
    
  6. Save the configuration change on both Routing Engines:

    content_copy zoom_out_map
    {master}[edit]
    user@host# commit synchronize
    re0:
    configuration check succeeds
    re1:
    commit complete
    re0:
    commit complete
    Note:

    To ensure the most recent configuration changes are committed before the software upgrade, perform this step even if nonstop active routing and graceful Routing Engine switchover were previously disabled.

  7. Exit the CLI configuration mode:

    content_copy zoom_out_map
    [edit]
    user@host# exit

Installing Software on the Backup Routing Engine (Junos OS)

After the device has been prepared, you first install the new Junos OS release on the backup Routing Engine, while keeping the currently running software version on the primary Routing Engine. This enables the primary Routing Engine to continue operations, minimizing disruption to your network.

Before you start this procedure, decide which software package you need and download it to the /var/tmp directory of the primary Routing Engine. For information on which packages to use for which upgrades, see Junos OS Installation Package Names.

To install software on the backup Routing Engine:

  1. Log in to the console port on the current primary Routing Engine in slot 0.

  2. Install the new software package on the backup Routing Engine (re1) using the request system software add command:

    content_copy zoom_out_map
    user@host> request system software add re1 validate /var/tmp/jinstall-9.2R1.8–domestic-signed.tgz

    Installation and validation take about 15 minutes.

    CAUTION:

    Do not include the re0 or re1 option when you install a package using the request system software add command if the Routing Engine on which the package is located and the Routing Engine on which you want to install the package are the same. In such cases, the package gets deleted after a successful upgrade.

    For M Series, MX Series, and T Series routers running Junos OS Release 12.2 and later, you can use the request system software add set command to install multiple software packages at the same time:

    content_copy zoom_out_map
    user@host> request system software add set re1 /var/tmp/installation-package

    For more information about the request system software add set command, see request system software add (Junos OS) or the CLI Explorer.

  3. Reboot the backup Routing Engine to start the new software:

    content_copy zoom_out_map
    user@host> request system reboot other-routing-engine
    Rebooting re1
    user@host> 

    You must reboot the device to load the new installation of Junos OS on the device. You can combine steps 2 and 3 by adding reboot to the request system software add command. But if you do the steps separately, make sure you reboot the Routing Engine you just added system software to.

    Note:

    To terminate the installation, do not reboot your device. Instead, finish the installation and then issue the request system software delete software-package-name command. This is your last chance to stop the installation.

    All the software is loaded when you reboot the device. Installation can take between 5 and 10 minutes. The device then reboots from the boot device on which the software was just installed. When the reboot is complete, the device displays the login prompt.

    While the software is being upgraded, the Routing Engine on which you are performing the installation is not routing traffic.

  4. Issue the show version invoke-on other-routing-engine command to verify the new software is installed.

    content_copy zoom_out_map
    user@host> show version invoke-on other-routing-engine
    re1:
    --------------------------------------------------------------------------
    Hostname: host1
    Model: mx240
    Junos: package-name
    . . .
    user@host>
  5. (Optional) Add the jweb package using the request system software add command. Before you can add this package, you must first download the software as you did the installation package. For more information about downloading the jweb package, see Downloading Software (Junos OS).

    The jweb installation module adds a router management graphical user interface that you can use to view and configure your router.

Installing Software on the Remaining Routing Engine (Junos OS)

Once the software is installed on the backup Routing Engine, you are ready to switch routing control to the backup Routing Engine, and then upgrade or downgrade the software on the remaining Routing Engine in slot 0.

To install software on the primary Routing Engine:

  1. Transfer routing control from the primary to the backup Routing Engine:

    content_copy zoom_out_map
    user@host> request chassis routing-engine master switch
    warning: Traffic will be interrupted while the PFE is re-initialized
    Toggle mastership between routing engines ? [yes,no] (no) yes 
    
    Resolving mastership...
    Complete. The other routing engine becomes the master.
    

    For more information about the request chassis routing-engine master command, see the CLI Explorer.

  2. Verify that the Routing Engine in slot 1 is now the primary Routing Engine:

    content_copy zoom_out_map
    user@host> show chassis routing-engine
    
    Routing Engine status:
      Slot 0:
        Current state                  Backup
        Election priority              Master (default)
    
    Routing Engine status:
      Slot 1:
        Current state                  Master
        Election priority              Backup (default)
  3. Install the new software package on the Routing Engine in slot 0 using the request system software add command:

    content_copy zoom_out_map
    user@host> request system software add validate re0  /var/tmp/jinstall-9.2R1.8–domestic-signed.tgz

    Installation and validation take about 15 minutes.

    CAUTION:

    Do not include the re0 or re1 option when you install a package using the request system software add command if the Routing Engine on which the package is located and the Routing Engine on which you want to install the package are the same. In such cases, the package gets deleted after a successful upgrade.

    For M Series, MX Series, and T Series routers running Junos OS Release 12.2 and later, you can use the request system software add set command to install multiple software packages at the same time:

    content_copy zoom_out_map
    user@host> request system software add set re0 /var/tmp/installation-package

    For more information about the request system software add set command, see request system software add (Junos OS) or the CLI Explorer.

  4. Reboot the Routing Engine using the request system reboot command:

    content_copy zoom_out_map
    user@host> request system reboot
    Reboot the system? [yes, no] (no) yes

    You must reboot the device to load the new installation of Junos OS on the device. You can combine steps 3 and 4 by adding reboot to the request system software add command. But if you do the steps separately, make sure you reboot the Routing Engine you just added system software to.

    Note:

    To terminate the installation, do not reboot your device. Instead, finish the installation and then issue the request system software delete software-package-name command. This is your last chance to stop the installation.

    The software is loaded when you reboot the system. Installation can take between 5 and 10 minutes. The device then reboots from the boot device on which the software was just installed. When the reboot is complete, the device displays the login prompt.

    While the software is being upgraded, the Routing Engine on which you are performing the installation does not route traffic.

  5. Log in to the current backup Routing Engine (slot 0) and issue the show version command to verify the version of the software installed.

    content_copy zoom_out_map
    user@host> show version
  6. (Optional) Add the jweb package using the request system software add command. Before you can add this package, you must first download the software as you did the installation package. For more information about downloading the jweb package, see Downloading Software (Junos OS).

    The jweb installation module adds a router management graphical user interface that you can use to view and configure your router.

Finalizing the Installation (Junos OS)

Once the software is installed on both Routing Engines, you return the router back to its original configuration and back up the new installation.

To finalize the redundant Routing Engines upgrade:

  1. Restore the configuration that existed before you started this procedure (from Preparing the Device for the Installation (Junos OS)):

    content_copy zoom_out_map
    user@host> configure
    [edit]
    user@host# rollback 1
    Note:

    The number on the rollback command should match the number of commits you did in preparing the router for the installation. For example, if you did a separate commit for disabling Routing Engine redundancy and disabling nonstop-bridging, you need to use rollback 2 in this step.

  2. Save the configuration change on both Routing Engines:

    content_copy zoom_out_map
    [edit]
    user@host# commit synchronize and-quit
  3. Transfer routing control back to the original primary Routing Engine in slot 0:

    content_copy zoom_out_map
    {backup}
    user@host> request chassis routing-engine master switch
    warning: Traffic will be interrupted while the PFE is re-initialized
    Toggle mastership between routing engines ? [yes,no] (no) yes 
    Resolving mastership...
    Complete. The other routing engine becomes the master.
    

    For more information about the request chassis routing-engine master command, see the CLI Explorer.

  4. Verify that the Routing Engine (slot 0) is indeed the primary Routing Engine:

    content_copy zoom_out_map
    {master}
    user@host> show chassis routing-engine
    
    Routing Engine status:
      Slot 0:
        Current state                  Master
        Election priority              Master (default)
    
    Routing Engine status:
      Slot 1:
        Current state                  Backup
        Election priority              Backup (default)
  5. After you have installed the new software and are satisfied that it is successfully running, back up the new software on both the primary and the backup Routing Engines.

    • For backing up Junos OS with upgraded FreeBSD, use the request system snapshot recovery command. To find which platforms in which releases use Junos OS with upgraded FreeBSD, see Feature Explorer and enter Junos kernel upgrade to FreeBSD 10+. For more information, see Changes in Use of Snapshots for Junos OS with Upgraded FreeBSD.

    • For Junos OS, use the request system snapshot command:

      content_copy zoom_out_map
      {master}
      user@host> request system snapshot
      {master}
      user@host> request routing-engine login other-routing-engine
      {backup}
      user@host-re1> request system snapshot
      {backup}
      user@host-re1> request routing-engine login other-routing-engine
      {master}
      user@host>

    The root file system is backed up to /altroot, and /config is backed up to /altconfig. The root and /config file systems are on the router’s CompactFlash card, and the /altroot and /altconfig file systems are on the router’ s hard disk or solid-state drive (SSD).

    For more information about the request system snapshot command, see the CLI Explorer .

    Note:

    After you issue the request system snapshot command, you cannot return to the previous version of the software because the running copy and backup copy of the software are identical.

footer-navigation