The Junos CLI | Introduction to Juniper and JNCIA Part 2

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
welcome to video 2 of our introduction to juniper series we're going to take a look at the basics of the juniper cli as well as the configuration hierarchy juniper devices run the junos operating system junos can be configured through the cli or the web interface and also supports automation through netconf or rest one of the major benefits to junos is that it's used across all juniper routers switches and firewalls this means that we have the same basic commands on any device the slight exception to this is on some of their older switches which use different commands to the newer ones this was before juniper created els or enhanced layer 2 services which unified these commands across all platforms we can connect to juniper devices the same way we would to any other device which includes a console port telnet ssh or through a web browser juniper cli has two modes first we have operational mode which is where we run show commands ping and anything else that operates the device we know we're in operational mode because of the greater than symbol in the prompt the second mode is configuration mode this is where all the configuration of the device is done we switch from operational mode to configuration mode with the configure command we can now see that we have the hash or pound symbol in the prompt we can leave configuration mode with the exit command if at any time you get stuck there are some inbuilt help commands you can use help reference to learn about other commands notice here that we can use the question mark to see available options if you were used to linux you'll probably notice that this looks like the man command this is because junos is built on top of freebsd or linux depending on the version if you have no idea which command you need to use then you can type help propose to search for the command you need and i sincerely hope that i pronounce that correctly help topic can give us more information on the features and configuration tasks and finally you get simple tips with help tip cli not something i use very often to be honest of course you can tab complete your commands and variables as in most clis when i say variable i mean things like the name of a policy that we have chosen a bonus feature in junos is being able to space complete commands as well it's not like ios there's no shortened commands every time you press space the cli will try to fill in the rest of the command for you if you really want to you can disable space complete but personally i love it i said a moment ago that junos was built on freebsd or linux well we can even connect to the underlying shell if we want with this start shell command notice that the prompt changes to a percent sign from here we can run the regular linux commands like pwd cd for changing directory and ls for a directory listing when you're done in the shell type exit to return to the juno cli and of course the journal cli supports the regular emacs keyboard shortcuts as shown here i recommend getting comfortable with them if you're not already if nothing else just get started by using control a and control e the junos configuration hierarchy is where it really starts to get interesting it's a lot more structured than some other vendors which makes it a lot easier to work with in the long run it looks like a file system full of directories and files each piece of config is grouped into an area for example one of the top level areas is called system and under that is an area called login and under that is an area for each user here we can see some sample configuration is easy to get intimidated by this at first because it looks a bit like a programming language of some kind but don't worry it's really not that hard the curly braces are used to group configuration into areas often there are child groups nested within parent groups anything that ends with a semicolon is a configuration item this is just a setting of some sort if we compare this to the corresponding cisco ios config we see that the junos config looks longer but is far more organized the ios config is partially hierarchical which we can see when some sections are indented but a lot of the settings are just floating around as you start getting used to the junos hierarchy you'll start to see how useful this structure is anytime you want to see the configuration from operational mode just use show configuration this is paginated by default if we pipe through no more it will show us all the output at once when we're in configuration mode we can see the configuration with just the show command we can also pipe through match and accept to filter output match shows any line that matches our phrase except we'll show lines that don't match our phrase there are a few other cool options too you can see a few of those listed on the screen if you need to run an operational mode command like ping from configuration mode just put the command run at the start of the line this is like the do command in ios remember how i said that the hierarchy is like a file system well we can navigate around it like a file system too we can use the edit command to move into a configuration group just like we would use cd on windows or linux to change a directory as soon as we do this the label above the prompt will update to show our current location moving deeper into the config continues to update this label when we run the show command from here it is relative to our position in the config so we don't see the full configuration just the parts within system login we can use up to go up one level or top to go straight to the root of the hierarchy when we want to configure something we use the set command for example we can set the host name sorry that's host hyphen name these commands are relative to our position in the hierarchy we have to include system as we're at the top of the hierarchy the opposite to set is delete this is like using the no command on a cisco router here we're using delete to remove one of our user accounts sorry it looks like that user doesn't exist we can use the question mark to find out our valid options ok we can remove the user admin 2. nearly all set commands run from configuration mode the only exception that i know of is the set cli commands which run from operational mode and control how we interact with the cli you may have noticed that the hostname hasn't changed yet even though we just said it this is because junos uses a commit model this means that configuration changes aren't applied immediately when we're ready to apply our changes we need to run the commit command this process does a few checks to make sure our config is fine and then applies the changes this also writes the changes to disk so there's no need for commands like write memory or copy run start if you would like to try all this out for yourself there's a guided lab on the website that you can use this one's pretty simple but i warn you that they will get trickier as we move through the series here's the first quiz of the series when you see these pause the video and see if you can think your way through each of these questions you're welcome to try to work these out yourselves or discuss them in the comments section if you want to or you can always head over to the members section on the website to get detailed answers and explanations check the video description for a link hopefully the cli will no longer seem as foreign to you as it once did one of the best parts of the juniper cli is the commit model which we're going to look at further in part 5. we'll also look at configuration management further in part 6. please click the video shown here to move on to part 3 where we'll take our cli skills further by configuring some interfaces and a vlan or two
Info
Channel: Network Direction
Views: 7,169
Rating: 5 out of 5
Keywords: Network direction, Juniper, Junos, JNCIA, JN0-103, Cli, Netconf, Rest, Els, Enhanced layer-2 services, Configure, Prompt, Start shell, Hierarchy, Operational, Show configuration, Set delete, Commit, emacs
Id: jffeYfx24vM
Channel Id: undefined
Length: 9min 11sec (551 seconds)
Published: Tue Sep 22 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.