Juniper MX204 setup

In this article I will give an example of configuring Juniper MX204, other Juniper MX series (JunOS) can be configured in the same way.

Connect to the device with a console cable and launch the Command Line Interface (CLI):

cli

By default, the login is root without a password.

Let’s see the current configuration:

show configuration

Let’s see information about components, CPU and memory usage, temperature, JunOS version, etc.

show chassis hardware
show chassis routing-engine
show system memory
show system storage
show chassis environment
show version
show system information

A few more examples of commands for viewing other information:

show system alarms
show system uptime
show system connections
show system errors active
show system users
show system resource-monitor summary
show system processes extensive
show subscribers summary
show subscribers extensive
show bridge mac-table

Let’s go to configuration:

configure

To execute CLI commands without returning to the CLI, add “run” before the command, for example:

run show configuration

Specify the password for the root user (after entering the command, you will need to enter the password):

set system root-authentication plain-text-password

Let’s create a new user admin (for example, we will use this user to connect via SSH in the future):

set system login user admin authentication plain-text-password
set system login user admin class super-user

set system login user admin class ?
operator        permissions [ clear network reset trace view ]
read-only       permissions [ view ]
super-user      permissions [ all ]
unauthorized    permissions [ none ]

Let’s specify the hostname:

set system host-name "test"
set system domain-name "ixnfo.com"

Assign an IP address for the Ethernet management port (we will connect the cable to it later), and also indicate the DNS server and default route:

set interfaces fxp0 unit 0 family inet address 192.168.24.200/24
set system name-server 1.1.1.1
set routing-options static route 0.0.0.0/0 next-hop 192.168.24.1
run show route

To apply any changes to the configuration, you must run the “commit” command, for example, check the configuration and apply:

commit check
commit
commit ?
commit comment "ixnfo.com"

If you assume that after commit the connection with the device will be lost, you can use the “commit confirm” command, which will apply the changes and if you do not commit a second time, the changes will be canceled after 5 minutes (10 minutes by default if no number of minutes):

commit confirmed 5
commit

You can undo the changes made with the rollback 0 command, or you can revert the older configuration:

run show system commit
rollback ?
rollback 0
rollback 1

Let’s check the connection with the ping command:

run ping 192.168.24.1

Let’s see the configuration of network interfaces:

edit interfaces
show

fxp0 {
    unit 0 {
        family inet {
            address 192.168.24.200/24;
        }
    }
}

I will give an example of deleting a command, for example, delete the IP address and apply the changes:

delete fxp0 unit 0 family inet address 192.168.24.200/24
commit
exit

We activate ssh or telnet:

set system services ssh
set system services ssh port 2222
run show system connections extensive | match "22|2222" | match LISTEN
set system services telnet
show system services

You can see who else is editing the configuration with the command:

status

Let’s set the time:

set system ntp server 192.168.5.5
set system time-zone Europe/Kiev

An example of resetting settings and completely clearing the configuration, log files and other things:

load factory defaults
request system zeroize

Examples of viewing logs:

show log messages | last 30
show log cli-comands | last 30
show log user admin
show log ?
show system alarms
show system boot-messages

Reboot device:

request system reboot

See also my articles:

Leave a comment

Leave a Reply