Connect and Configure a QFX5120 Switch
We ship the QFX5120 switch with Junos OS preinstalled and
ready to be configured when you power on the switch. You must perform
the initial configuration of the QFX5120 through the console port
(labeled CON
) on the switch by using the command-line
interface (CLI).
Before you connect and configure a QFX5120, set the following parameter values on the console server or desktop PC:
Baud Rate—9600
Data—8
Flow Control—None
Parity—None
Stop Bits—1
DCD State—Disregard
Ensure that you have the following parts and tools available:
An Ethernet cable with an RJ-45 connector attached—provided
An RJ-45 to DB-9 serial port adapter—provided
A management host such as a laptop or desktop PC, with a serial port—not provided
Have the following information available before you configure custom settings for the switch:
Root password
IP address of the default gateway
IP address of the management port
IP address of a DNS server
(Optional) Hostname
(Optional) IP address of a backup router
(Optional) SNMP read community, location, and contact to configure SNMP parameters
(Optional) Static routes to remote subnets with access to the management port
(Optional) Static routes to remote prefixes with access to the management port
This procedure describes how to perform the initial configuration on the switch and to connect it to the network. For the complete information about enabling the switch to forward traffic, including examples, see the Junos OS configuration guides.
To perform the initial configuration on the switch and to connect it to the network:
- Power the switch on.
- Connect the console port (labeled
CON
) on the switch to a management host such as a laptop or desktop PC by using an RJ-45 to DB-9 serial port adapter. - At the Junos OS login prompt, type root to log in. You don't need to enter a password. If the software boots
before you connect to the console port, you might need to press the
Enter key on the keyboard for the prompt to appear.login: root
- Start the CLI.root@:RE:0% cliroot>
- Enter the configuration mode.root> configure[edit]root#
- Add a password to the root administration user account.
Enter a plain-text password, an encrypted password, or an SSH public
key string.
Plain-text password:
[edit]root# set system root-authentication plain-text-passwordNew password: passwordRetype new password: passwordEncrypted password:
[edit]root# set system root-authentication encrypted-password encrypted-password[edit]root# set system root-authentication ssh-ecdsa public-keySSH-ECDSA password:
[edit]root# set system root-authentication ssh-ed25519 public-keySSH-RSA password:
[edit]root# set system root-authentication ssh-rsa public-key - (Optional) Configure the hostname of the switch. If the
name includes spaces, enclose the name in double quotation marks (“
”).[edit]root# set system host-name host-name
- (Optional) Create a user account.[edit]root# set system login user user-name authentication plain-text-passwordNew password: passwordRetype new password: password
- (Optional) Set the user account class to super-user.[edit]root# set system login user user-name class super-user
- (Optional) Configure the domain name of the switch.[edit]root# set system domain-name domain-name
- Configure the default gateway.[edit]root# set routing-options static route 0/0 next-hop address
- Configure the IP address and prefix length for the management
interface on the switch.[edit]root# set interfaces em0 unit 0 family inet address address/prefix-length
Note The management port em0 (labeled
MGMT
) is located on the front panel of the QFX5120-32C switch. The management port em0 (labeledMGMT
) is located on the rear panel of the QFX5120-48T switch. The management ports em0 (labeledC0
) and em1 (labeledC1
) are located on the rear panel of the QFX5120-48Y and QFX5120-48YM switches. - (Optional) Configure the IP address of a backup router,
which is used only while the routing protocol is not running.[edit]root# set system backup-router address
- Configure the IP address of a DNS server.[edit]root# set system name-server address
- (Optional) Configure the static routes to remote subnets
with access to the management port. Access to the management port
is limited to the local subnet.[edit]root# set routing-options static route remote-subnet next-hop destination-IP retain no-readvertise
- (Optional) Configure the static routes to remote prefixes
with access to the management port.[edit]root# set routing-options static route remote-prefix next-hop destination-IP retain no-readvertise
- Configure the SSH service.[edit]root# set system services ssh root-login allow
Configure in-band management or out-of-band management:
With in-band management, you can configure a network port interface as the management interface and connect it to the management device. In this scenario, you can do either of the following:
Use the automatically created VLAN named default for management of all data interfaces as members of the default VLAN. Specify the management IP address and the default gateway.
Create a new management VLAN. Specify the VLAN name, VLAN ID, management IP address, and default gateway. Select the ports that must be part of this VLAN.
With out-of-band management, you use a dedicated management channel (
MGMT
,C0
, orC1
port) to connect to the management device. Specify the IP address and gateway of the management interface. Use this IP address to connect to the switch.
- (Optional) Specify the SNMP read community, location, and contact to configure SNMP parameters.
- (Optional) Specify the system date and time. Select the time zone from the list. The configured parameters are displayed.
- Enter yes to commit the configuration. The configuration is committed as the active configuration for the switch.
- (Optional) Display the configuration to verify that it
is correct.[edit]root# showsystem {host-name host-name;domain-name domain-name;root-authentication {authentication-method (password | public-key);}name-server {address;}}interfaces {em0 {unit 0 {family inet {address address/prefix-length;}}}}
- (Optional) Configure additional properties by adding the necessary configuration statements.
- Commit the configuration to activate it on the switch.[edit]root# commit
- When you have finished configuring the switch, exit the
configuration mode.[edit]root@switch# exitroot@switch>
You can now log in by using the CLI and continue configuring the switch.