Configuring the Junos OS the First Time on a Router with a Single Routing Engine
When you turn on a router the first time, the Junos OS automatically boots and starts. You must enter basic configuration information so that the router is on the network and you can log in to it over the network.
To configure the router initially, you must connect a terminal or laptop computer to the router through the console port—a serial port on the front of the router. Only console access to the router is enabled by default. Remote management access to the router and all management access protocols, including Telnet, FTP, and SSH, are disabled by default.
To configure the Junos OS for the first time on a router with a single Routing Engine, follow these steps:
- Connect a terminal or laptop computer to the router through the console port—a serial port on the front of the router. Only console access to the router is enabled by default.
- Power on the router 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.
- 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 router shows the username root@#.
- Start the Junos OS command-line interface (CLI):root@# cliroot@>
- Enter Junos OS configuration
mode:cli> configure [edit]root@#
- Configure the name of
the router (the router hostname). We do not recommend spaces in the
router name. However, if the name does include spaces, enclose the
entire name in quotation marks (" ").[edit]root@# set system host-name hostname
- Configure the router’s domain name:[edit]root@# set system domain-name domain-name
- Configure the IP address
and prefix length for the router management Ethernet interface. The
management Ethernet interface provides a separate out-of-band management
network for the router.
- For all routers except the TX Matrix
Plus router and T1600 routers in a routing matrix:[edit]root@# set interfaces fxp0 unit 0 family inet address address/prefix-length
- For a TX Matrix Plus router and T1600 routers in a routing
matrix only:[edit]root@# set interfaces em0 unit 0 family inet address address/prefix-length
To use em0 as an out-of-band management Ethernet interface, you must configure its logical port, em0.0, with a valid IP address.
- For a T1600 standalone router (not connected to a TX Matrix
Plus router and not in a routing matrix):[edit]root@# set interfaces fxp0 unit 0 family inet address address/prefix-length
- For all routers except the TX Matrix
Plus router and T1600 routers in a routing matrix:
- Configure the IP address
of a backup or default router. This device is called the backup router,
because it is used only while the routing protocol process is not
running. Choose a router that is directly connected to the local router
by way of the management interface. The router uses this backup router
only when it is booting and only or when the Junos routing software
(the routing protocol process, rpd) is not running.
For routers with two Routing Engines, the backup Routing Engine, RE1, uses the backup router as a default gateway after the router boots. This enables you to access the backup Routing Engine. (RE0 is the default master Routing Engine.)
[edit]root@# set system backup-router address - Configure the IP address of a DNS server.
The router uses the DNS name server to translate hostnames into IP
addresses.[edit]root@# set system name-server address
- 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:
- To enter a clear-text password, use the following command:[edit]root@# set system root-authentication plain-text-passwordNew password: type passwordRetype new password: retype password
- To enter a password that is already encrypted, use the
following command:[edit]root@# set system root-authentication encrypted-password encrypted-password
- To enter an SSH public key, use the following command:[edit]root@# set system root-authentication ssh-rsa key
- To enter a clear-text password, use the following command:
- Optionally, display the
configuration statements:[edit]root@ show system {host-name hostname;domain-name domain.name;backup-router address;root-authentication {(encrypted-password "password" | public-key);ssh-rsa "public-key";ssh-dsa "public-key";}name-server {address;}interfaces {fxp0 {unit 0 {family inet {address address ;}}}}}
On a TX Matrix Plus router, the management Ethernet interface is em0 and not fxp0. Therefore, when you issue the show command in the configuration mode, the configuration statements would be:
[edit]root@ show system {host-name hostname;domain-name domain.name;backup-router address;root-authentication {(encrypted-password "password" | public-key);ssh-rsa "public-key";ssh-dsa "public-key";}name-server {address;}interfaces {em0 {unit 0 {family inet {address address ;}}}}} - Commit the configuration, which activates
the configuration on the router:[edit]root@# commit
After committing the configuration, you see the newly configured hostname appear after the username in the prompt—for example, user@host#.
Junos OS defaults are now set on the router.
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 router.
- Exit from the CLI configuration mode.[edit]root@ hostname# exitroot@hostname>
- Back up the configuration on the hard
drive.
After you have installed the software on the router, 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 router’s CompactFlash card, and the /altroot and /altconfig file systems are on the router’s hard disk.

Note: After you issue the request system snapshot command, you cannot return to the previous version of the software, because the running copy and the backup copy of the software are identical.
Related Topics
- Initial Router Configuration Using the Junos OS
- Format for Specifying IP Addresses, Network Masks, and Prefixes in Junos Configuration Statements
- Default Directories for Junos OS File Storage on the Router
- Configuring Basic Router or Switch Properties
- Configuring Automatic Mirroring of the CompactFlash Card on the Hard Disk Drive
