Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Announcement: Try the Ask AI chatbot for answers to your technical questions about Juniper products and solutions.

close
external-header-nav
keyboard_arrow_up
close
keyboard_arrow_left
Overview for Junos OS
Table of Contents Expand all
list Table of Contents
file_download PDF
{ "lLangCode": "en", "lName": "English", "lCountryCode": "us", "transcode": "en_US" }
English
keyboard_arrow_right

Configuring Junos OS for the First Time on a Device with a Single Routing Engine

date_range 21-Mar-23

To configure the Junos OS for the first time on a router with a single Routing Engine and no base configuration, follow these steps:

  1. Connect to the device through the console port.
  2. Power on the device and wait for it to boot.

    The Junos OS boots automatically. The boot process is complete when you see the login: prompt on the console.

  3. Log in as the user root.

    Initially, the root user account requires no password. You can see that you are the root user, because the prompt on the device shows the username root@#.

  4. Start the Junos OS command-line interface (CLI):
    content_copy zoom_out_map
    root@# cli
    root@>
    
  5. Enter Junos OS configuration mode:
    content_copy zoom_out_map
    cli> configure
    [edit]
    root@#
    
  6. Configure the hostname of the device. We do not recommend spaces in the router name. However, if the name does include spaces, enclose the entire name in quotation marks ("  ").
    content_copy zoom_out_map
    [edit]
    root@# set system host-name hostname
    
  7. Set the root password, entering either a clear-text password that the system will encrypt, a password that is already encrypted, or an SSH public key string.

    Choose one of the following:

    1. To enter a clear-text password, use the following command:

      content_copy zoom_out_map
      [edit]
      root@# set system root-authentication plain-text-password
      New password: type password
      Retype new password: retype password
      
    2. To enter a password that is already encrypted, use the following command:

      content_copy zoom_out_map
      [edit]
      root@# set system root-authentication encrypted-password encrypted-password
      
    3. To enter an SSH public key, use the following command:

      content_copy zoom_out_map
      [edit]
      root@# set system root-authentication ssh-rsa key
      
  8. Configure the device domain name:
    content_copy zoom_out_map
    [edit]
    root@# set system domain-name domain-name
    
    Note:

    Before you begin the next step, see Supported Routing Engines by Router to find the management Ethernet interface that you should use to perform this configuration.

  9. Configure the IP address and prefix length for the device management Ethernet interface. The management Ethernet interface provides a separate out-of-band management network for the device.
    • For devices that use management Ethernet interface fxp0:

      content_copy zoom_out_map
      [edit]
      root@# set interfaces fxp0 unit 0 family inet address address/prefix-length
      
    • For devices that use management Ethernet interface em0:

      content_copy zoom_out_map
      [edit]
      root@# set interfaces em0 unit 0 family inet address address/prefix-length
      
  10. Configure the IP address of a backup or default network device. Choose a device that is directly connected to the local router by way of the management interface. This backup is used only when it is booting and only or when the Junos routing software (the routing protocol process, rpd) is not running.

    For devices with two Routing Engines, the backup Routing Engine, RE1, uses the backup device as a default gateway after the device boots. This enables you to access the backup Routing Engine. (RE0 is the default primary Routing Engine.)

    Note:

    The backup Routing Engine does not support more than 16 backup routing destinations. If you configure more than 16 destinations on the backup Routing Engine, the Junos OS ignores any destination addresses after the sixteenth address and displays a commit-time warning message to this effect.

    content_copy zoom_out_map
    [edit]
    root@# set system backup-router address
    
  11. Configure the IP address of a DNS server. The router uses the DNS name server to translate hostnames into IP addresses.
    content_copy zoom_out_map
    [edit]
    root@# set system name-server address
    
  12. Optionally, display the configuration statements:
    content_copy zoom_out_map
    [edit]
    root@ show
    system {
        host-name hostname;
        domain-name domain.name;
        backup-router address;
        root-authentication {
            (encrypted-password "password" | public-key);
            ssh-dsa "public-key";
            ssh-ecdsa "public-key";
            ssh-rsa "public-key";
        }
        name-server {
            address;
        }
        interfaces {
            fxp0 {
                unit 0 {
                    family inet {
                        address address ;
                    }
                }
            }
        }
    }
    

    On devices that use management Ethernet interface em0, you will see em0 in place of fxp0 in the show command output.

  13. Commit the configuration, which activates the configuration on the device:
    content_copy zoom_out_map
    [edit]
    root@# commit
    

    After committing the configuration, you see the newly configured hostname appear after the username in the prompt—for example, user@hostname#.

    A basic configuration for Junos OS is now set on the device.

    If you want to configure additional Junos OS properties at this time, remain in the CLI configuration mode and add the necessary configuration statements. You need to commit your configuration changes to activate them on the device.

  14. Exit from the CLI configuration mode.
    content_copy zoom_out_map
    [edit]
    root@hostname# exit
    root@hostname>
    
  15. Back up the configuration.

    After you have committed the configuration and are satisfied that the new configuration is successfully running, you should issue the request system snapshot command to back up the new software to the /altconfig file system. If you do not issue the request system snapshot command, the configuration on the alternate boot device will be out of sync with the configuration on the primary boot device.

    The request system snapshot command causes the root file system to be backed up to /altroot, and /config to be backed up to /altconfig. The root and /config file systems are on the device’s CompactFlash card, and the /altroot and /altconfig file systems are on the device’s hard drive.

    Note:

    After you issue the request system snapshot command, you cannot easily return to the previous configuration, because the running copy and the backup copies are identical.

external-footer-nav