12 2009

Junos学习杂记(四)<CLI>

Posted by admin in juniper

CLI Modes and Feature Overview(CLI模式和特点)
image

 

 

 

 

 

 

 

 

 

 

 

 

 

 

CLI Operational Mode  (CLI操作模式)
    Use the CLI operational mode to monitor and troubleshoot the operational of the router
    (使用此模式可监控和排错)

CLI Configuration Mode(CLI配置模式)
    Use the CLI Configuration mode when
    (当确定要修改路由器配置时,使用此模式)

 

 

CLI Modes
Operational mode:(操作模式)
    Monitor and troubleshoot lthe software、network、connectivity and router hardware

configuration mode:
    configure the router,including interfaces,general routing information, routing protocols,user acces,and system hardware properties.

 

Logging in:
    当普通用户登录系统是这种效果:
image

 

 

 

当你从本地使用root登录。是这种情况:

Junos (ttyd0)

login: root
Password:

— JUNOS 8.5R1.14 built 2007-12-08 07:38:33 UTC

root@Junos%
root@Junos% cli

当root用户成功登录后, 会首先进入 Unix的sheel命令提示符,需输入cli 以进入CLI状态。

 

CLI操作模式:
image

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

root@Junos> show ospf neighbor logical-router r1   
Address          Interface              State     ID               Pri  Dead
10.0.4.6         em1.102                Full      10.0.6.2         128    38
10.0.4.13        em1.103                Full      10.0.6.3         128    37

root@Junos> configure
Entering configuration mode
[edit]
root@Junos# run show ospf neighbor logical-router r1
Address          Interface              State     ID               Pri  Dead
10.0.4.6         em1.102                Full      10.0.6.2         128    31
10.0.4.13        em1.103                Full      10.0.6.3         128    32

[edit]
root@Junos#

 

 

 

CLI的快捷键:与VT100的一样。

JunOS的Command and Variable completion
Junos命令的自动补全与命令提示

   

root@Junos> sh<space> i
                                     ^
‘i’ is ambiguous.
Possible completions:
  igmp                 Show Internet Group Management Protocol information
  ike                  Show Internet Key Exchange information
  ilmi                 Show interim local management interface information
  interfaces           Show interface information
  ipsec                Show IP Security information
  ipv6                 Show IP version 6 information
  isis                 Show Intermediate System-to-Intermediate System information
root@Junos> show i      

 

<space>表示space按键!
同样也可以使用tab按键来补全命令。

 

 

命令提示!  输入 ?

 

 

在Junos中有一个命令非常实用。 它就是Help

root@Junos> help topic system user   
[code]

                           Configuring User Accounts 

   User accounts provide one way for users to access the router. (Users can
   access the router without accounts if you configured RADIUS or TACACS+
   servers, as described in Configuring User Authentication.) For each
   account, you define the login name for the user and, optionally,
   information that identifies the user. After you have created an account,
   the software creates a home directory for the user.
   To create user accounts, include the user statement at the [edit system
   login] hierarchy level:
     [edit system login]
     user username {
         full-name complete-name;
         uid uid-value;
         class class-name;
         authentication {
             (encrypted-password "password" | plain-text-password);
             ssh-rsa "public-key";
             ssh-dsa "public-key";
         }
     }
   For each user account, you can define the following:
     * Username--(Optional) Name that identifies the user. It must be unique
---(more)---
[/code]
 
 
 
 
 
Help reference(参考)
root@Junos> help reference system user-login
user (Access)

  Syntax

     user username {
         full-name complete-name;
         uid uid-value;
         class class-name;
         authentication {
             (encrypted-password "password" | plain-text-password);
             ssh-rsa "public-key";
             ssh-dsa "public-key";
         }
     }

  Hierarchy Level

     [edit system login]

  Release Information

     Statement introduced before JUNOS Release 7.4.

  Description       

     Configure access permission for individual users.

  Options

     The remaining statements are explained separately.

  Usage Guidelines

     See "Configuring User Access".

  Required Privilege Level

     admin--To view this statement in the configuration.
     admin-control--To add this statement to the configuration.
    class
收藏与分享