Difference between revisions of "JunOS Basics"
| Line 51: | Line 51: | ||
root@switch# | root@switch# | ||
| − | Note: just | + | Note: just setting up the password is not enough, you need to save the change that you just made. In JunOS the way to save changes is by typing the command "commit". |
| − | But before we save the changes, there is another usefully command that allows | + | But before we save the changes, there is another usefully command that allows us to see what are all the changes made to the device before we save the changes and that command is "show | compare" |
| + | |||
| + | root@switch# show | compare | ||
| + | [edit system] | ||
| + | + root-authentication { | ||
| + | + encrypted-password "$1$vVYnP0uH$YmTKnA.L0W0KGFtTw36NJ/"; ## SECRET-DATA | ||
| + | + } | ||
| + | |||
| + | The + sign in front of each lines means that those lines will add to our devices configuration. | ||
| + | Note: you can make all you changes and when done you can type the command " show | compare" before you save with "commit" or you can do one change at the time and do "show | compare" and "commit" and go to the next change. I recommend if you are starting to just do one change and "show | compare" then "commit" | ||
=How to change the device name= | =How to change the device name= | ||
Revision as of 20:32, 28 August 2018
In this Tutorial We will be discussing about the basic of the JunOS which will include:
- How to setup the root password
- How to change the device name
- How to create a user with admin right using a password and using a SSH key
- How to setup the management interface to ssh in to the switch
- How to create VLAN's
- How to create access and trunk ports
- How to create interfaces range
- How to connect 2 switches
Prerequisites
To complete this tutorial, you will need:
- A laptop running Linux or MacOS. for this tutorial I will be using a laptop running Ubuntu 16
- A console cable. Since all the new laptops today don't come with a USB port, you will need a USB to Console adapter
- The program "Screen"
If you don't have "screen" install it with the command below
sudo apt-get install screen
Accessing the device
- Step 1: Plug the console cable to you device into the console port and start screen as root user on your laptop
screen /dev/ttyUSB0
- step 2: Power on your device
After the device finished booting you will get at the prompt below
- Step 3: Enter the username and password
By default, all Juniper devices username is "root" with no password. At the prompt, just type in root and hit enter
How to setup the root password
When you come from a CISCO world like me, at the beginning it is a little bit confusing when working with JunOS. But, with time running a couple of commands, you get use to the concept.
For us to setup the root password, we need to be in configuration mode (#). Right now our prompt is showing "%". tyoe in
cli
to and the prompt will change to ">" which is the operational mode and after that type in "edit" or "configuration" to enter the configuration mode
root@switch:RE:0% cli
{master:0}
root@switch> edit
Entering configuration mode
{master:0}[edit]
root@switch#
To setup the root password with a plain-text password the command it "set system root-authentication plain-text-password" Type the command and hit enter. You will be asked to enter a password twice.
root@switch# set system root-authentication plain-text-password
New password:
Retype new password:
{master:0}[edit]
root@switch#
Note: just setting up the password is not enough, you need to save the change that you just made. In JunOS the way to save changes is by typing the command "commit".
But before we save the changes, there is another usefully command that allows us to see what are all the changes made to the device before we save the changes and that command is "show | compare"
root@switch# show | compare
[edit system]
+ root-authentication {
+ encrypted-password "$1$vVYnP0uH$YmTKnA.L0W0KGFtTw36NJ/"; ## SECRET-DATA
+ }
The + sign in front of each lines means that those lines will add to our devices configuration. Note: you can make all you changes and when done you can type the command " show | compare" before you save with "commit" or you can do one change at the time and do "show | compare" and "commit" and go to the next change. I recommend if you are starting to just do one change and "show | compare" then "commit"

