Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?


Step 2: Up and Running

Now that the MX304 is powered on, let’s do some initial configuration to get it up and running on the network. It’s simple to configure and manage the MX304 using the CLI.

Plug and Play

The MX304 router ships with factory-default settings that enable some zero touch provisioning (ZTP) functions. These settings load as soon as you power on the switch. In our case we configure the router manually, so we remove the ZTP settings as part of our initial configuration.

Perform Initial Configuration

You can easily customize the factory-default configuration with just a few commands. When you commit changes to the configuration, a new configuration file is created. This becomes the active configuration. You can always revert to the factory-default configuration anytime you want.

When ZTP is not used you must perform the initial configuration of an MX304 router through the console port (CON) using the Junos OS command-line interface (CLI). If your MX304 has dual Routing-Engines, you should perform these steps on each Routing-Engine, being sure to specify a unique management IP address for the management interface on each Routing-Engine. See Step 3: Keep Going for a link on how to use configuration groups to share a single configuration file between both Routing-Engines.

Have the following information ready before you begin the initial configuration:
  • The router's host and domain name

  • IP address and subnet mask for the management Ethernet interface

  • IP address of a default gateway for the management network

  • IP address of a DNS server

  • The root user's password

  1. Verify that the router is powered on.
  2. Note:

    You may see messages on the console relating to ZTP and DHCP. These messages stop once your remove the ZTP statements from the default configuration.

    Configure your serial port for 9600 bps/8-N-1, and attach the cable to the CON port of the desired Routing-Engine. Log in as the “root” user. No password is needed.
  3. Start the CLI.
  4. Enter configuration mode.
  5. Set the root authentication password by entering either a plain text password, an encrypted password, or an SSH public key string (ECDSA, ED25519 or RSA).



  6. Remove factory default configuration statements that relate to ZTP. After you commit these initial changes the ZTP process is stopped and the related console messages are no longer displayed.
  7. Perform an initial commit to activate the modified configuration.
  8. Configure the router's host name. If the name includes spaces, enclose the name in quotation marks (“ ”).
  9. Configure the router’s domain name.
  10. Configure the IP address of a DNS server.
  11. Configure the IP address and prefix length for the router’s management Ethernet interface (fxp0).
  12. Configure one or more static routes to remote subnets that have access to the management subnet. Without static routing, access to the management port is limited to devices attached to the management subnet. Static routing is needed to access the management interface from devices attached to remote subnets. For more information about static routes, see Configure Static Routes.

    In our example we define a single default static route to provide management network reachability to all possible remote destinations.

  13. Configure the IP address of a backup router. The backup router is only used while the routing protocol is not running. The primary use of the backup router is to provide routing capability for the management port on the backup Routing-Engine. This is because the backup Routing-Engine does not run the routing protocol daemon (rpd).
  14. In most cases the backup router is the same IP next hop as used for the management network's static routes. We again use a default route to provide the back up Routing-Engine with reachability for all possible remote destinations.
  15. Configure remote access for the root user over ssh. By default the root user is only able to log-in via the console port. The root-login allow statement permits remote log-in for the root user.
  16. (Optional) Display the configuration to verify it's correct.
  17. Commit the configuration to activate it on the router.
  18. When you've finished configuring the router, exit configuration mode.

    Congratulations. The initial configuration is complete. Remember to also configure the backup Routing-Engine if your MX304 is equipped with redundant control planes. At this point you should be able to remotely access both of the Routing-Engines using ssh as the root user via the management network.