Command-Line Interface
The JUNOS software CLI contains two main modes: operational and configuration. The
names adequately describe the functions permitted within each environment
Operational mode
In operational mode, you enter commands to monitor and diagnose the software, network connectivity, and the router
Configuration mode
you configure the JUNOS software by creating a hierarchy of configuration statements. You can do this using the CLI or by creating a text (ASCII) file that contains the statement hierarchy. (The statement hierarchy is identical in both the CLI and the text configuration file.) You can configure all properties of the JUNOS software, including interfaces, general routing information, routing protocols, and user access, as well as several system hardware properties. When you have finished entering the configuration statements, you commit them, which activate the configuration on the router.
1. configure or edit
You access the router’s configuration mode hierarchy with either the configure or edit command:
juniper@ROUTER-RE0> configure
Entering configuration mode
[edit]
juniper@ROUTER-RE0#
2. configure exclusive
Exclude others from modifying the configuration database. Attempts by other users to modify the configuration while
configure exclusive
is active result in a descriptive error message, giving the owner, tty, and timestamp of the exclusive lock.juniper@ROUTER-RE0> configure exclusive
3. configure private
The
configure private
command allows multiple users to edit different parts of the configuration at the same time and to commit only their own changes, or to roll back without interfering with one another's changes. When you issue the configure private
command, you work in a private candidate configuration, which is a copy of the most recently committed configuration.juniper@ROUTER-RE0> configure private
warning: uncommitted changes will be discarded on exit
Entering configuration mode
4. Run command
One very useful command that exists in configuration mode is run. When you use this command,the router allows you access to operational mode commands from within the configuration. This flexibility enables you to easily verify information on the router
[edit protocols ospf]
juniper@ROUTER-RE0# run show route
inet.0: 23 destinations, 24 routes (23 active, 0 holddown, 0 hidden)
+ =
Active Route , - = Last Active, * = Both
Active Route , - = Last Active, * = Both
1.1.1.0/24 *[OSPF/10] 00:40:41, metric 4
> via so-0/0/0.0
5. Configuring interface
Go to the edit mode and configure the interface which needs to be configured.Say we want to configure a serial interface s-2/0/0
set interfaces so-2/0/0 description "connected to PE15-PAR-EU so-1/0/0"
set interfaces so-2/0/0 traps
set interfaces so-2/0/0 dce
set interfaces so-2/0/0 clocking external
set interfaces so-2/0/0 encapsulation frame-relay
set interfaces so-2/0/0 lmi lmi-type ansi
6. Creating subinterface
Here we want to create say s-2/0/0.150
set interfaces so-2/0/0 unit 150 point-to-point
set interfaces so-2/0/0 unit 150 dlci 150
set interfaces so-2/0/0 unit 150 inverse-arp
set interfaces so-2/0/0 unit 150 family inet address 212.31.229.30/30
set interfaces so-2/0/0 unit 150 family mpls
7. Reloading the Router
request system reboot
juniper@ROUTER-RE0> request system reboot
Reboot the system ? [yes,no] (no) no
If want to rebbot at some fixed time:
juniper@ROUTER-RE0> request system reboot at 2100 message ?
Possible completions:
<message> Message to display to all users
juniper@ROUTER-RE0> request system reboot at 2100 message
8. IOS Upgrade
We can upgrade the JUNOS software by using the request system software add filename command.
This command loads a software file from some location, often the user’s home directory, onto the internal flash on the Routing Engine.
juniper@ROUTER-RE0>
request system software add <file name>
We must reboot the router to use the new software using the “request system reboot command”.
We also have the option of an automatic reboot by using the reboot option in conjunction with the request system software add filename command.
The process looks like this:
juniper@ROUTER-RE0> request system software add <file-name> reboot
No comments:
Post a Comment