juniper EX系列交换机 CLI命令行操作模式

2023-11-30 19:12

本文主要是介绍juniper EX系列交换机 CLI命令行操作模式,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

JUNOS有两种模式:操作模式和配置模式。

1,操作模式

监控和排错 软件,网络连接、路由器硬件。

2,配置模式

test@lab2>

配置路由器包括:interface、路由信息、路由协议、用户访问、系统硬件参数。

test@lab2> configure

[edit]

test@lab2#

操作模式

(1)命令层次

(2)主要命令

{master}

lab@ex4200-vc> ?

Possible completions:

  clear                Clear information in the system

  configure            Manipulate software configuration information

  file                 Perform file operations

  help                 Provide help information

  monitor              Show real-time debugging information

  mtrace               Trace multicast path from source to receiver

  op                   Invoke an operation script

  ping                 Ping remote target

  quit                 Exit the management session

  request              Make system-level requests

  restart              Restart software process

  set                  Set CLI properties, date/time, craft interface message

  show                 Show system information

  ssh                  Start secure shell on another host

  start                Start shell

  telnet               Telnet to another host

  test                 Perform diagnostic debugging

  traceroute           Trace route to remote host

{master}

lab@ex4200-vc>    

(3)可以配合使用下列管道符号 |

  compare              Compare configuration changes with prior version

  count                Count occurrences

  display              Show additional kinds of information

  except               Show only text that does not match a pattern

  find                 Search for first occurrence of pattern

  hold                 Hold text without exiting the --More-- prompt

  last                 Display end of output only

  match                Show only text that matches a pattern

  no-more              Don't paginate output

  request              Make system-level requests

  resolve              Resolve IP addresses

  save                 Save output text to file

  trim                 Trim specified number of columns from start of line

(4)使用set cli 命令设置 cli 环境

{master}

lab@ex4200-vc> set cli ?

Possible completions:

  complete-on-space    Set whether typing space completes current word

  directory            Set working directory

  idle-timeout         Set maximum idle time before login session ends

  prompt               Set CLI command prompt string

  restart-on-upgrade   Set whether CLI prompts to restart after software upgrade

  screen-length        Set number of lines on screen

  screen-width         Set number of characters on a line

  terminal             Set terminal type

  timestamp            Timestamp CLI output

{master}

(5)编辑环境在VT-100

(6)空格键功能

lab@ex4200-vc> show i     

                     ^

'i' is ambiguous.

Possible completions:

  igmp                 Show Internet Group Management Protocol information

  igmp-snooping        Show IGMP snooping information

  ike                  Show Internet Key Exchange information

  interfaces           Show interface information

  ipsec                Show IP Security information

  isis                 Show Intermediate System-to-Intermediate System information

(7)?号命令提示

lab@ex4200-vc> ?

Possible completions:

  clear                Clear information in the system

  configure            Manipulate software configuration information

  file                 Perform file operations

  help                 Provide help information

  monitor              Show real-time debugging information

  mtrace               Trace multicast path from source to receiver

  op                   Invoke an operation script

  ping                 Ping remote target

  quit                 Exit the management session

  request              Make system-level requests

  restart              Restart software process

  set                  Set CLI properties, date/time, craft interface message

  show                 Show system information

  ssh                  Start secure shell on another host

  start                Start shell

  telnet               Telnet to another host

  test                 Perform diagnostic debugging

  traceroute           Trace route to remote host

配置模式

(1) 进入配置模式

root@lab2> configure

Entering configuration mode

[edit]

root@lab2#

example:

root@lab2#set system services ftp

system {

services {

ftp;

}

}

(2) 配置模式层次

(3)使用edit 命令类似于cd 命令

使用edit chassis alarm ethernet 可以直接在ethernet 这一级操作而不需要 set chassis alarm Ethernet 操作。

(4) 使用up 和top 命令

user@host# up

[edit chassis alarm]

user@host# top

[edit]

(5)显示Candidate 配置

[edit]

user@host# show chassis alarm

user@host# edit chassis alarm

[edit chassis alarm]

user@host# show

 [edit chassis alarm]

(6)区分配置文件

 比较Candidate 与active 配置的区别

[edit chassis]

user@host# show | compare

alarm {

xxx {

+ xxx xxx

- xxx xxx;

}

}

其它选项

user@host# show | compare filename

user@host# show | compare rollback number

(7)配置的差异更新

root@router# show | compare

[edit interfaces]

[edit]

root@router# show | compare | save /var/tmp/patch.cfg

Wrote 9 lines of output to '/var/tmp/patch.cfg'

[edit]

root@router# load patch /var/tmp/patch.cfg

load complete

(8)删除配置

[edit]

user@host# edit chassis alarm xxx

[edit chassis alarm xxxx]

user@host# delete xxx

[edit chassis alarm xxxx]

user@host# delete xxx

[edit chassis alarm xxxx]

user@host#

9)配置生效

 使用 commit 是配置生效。rollback 恢复配置。

ser@host#commit

and-quit 如果配置成功退出配置模式

at 在定义的时间后commit 配置

check 检测配置,不改变配置

confirmed 知道回滚等到下一个commit 模式是10 分钟

 rollback 恢复配置。系统默认9 个配置在 /config/ 3 个。file show /config/6 个

rollback 或rollback 0 就恢复到刚刚改变的配置

(10)配置模式层次改变。

 使用exit 退回到上一层配置模式

 使用exit configuration-mode 从任意层次退去配置模式

(11)保存加载配置文件

可以使用save filename 在任何配置模式保持这个层次的配置内容到一个指定存放位置便于下

一次load。

[edit]

cli# save filename

[edit]

cli#

 load (replace | merge | override)

replace 取代现有的配置并且配置正确

merge 合并配置

override 取代现有的配置

user@host# load merge /var/db/config/juniper.conf.4

 可以通过 show system storage 查看文件系统,或用file show <pathname>来查看。

这篇关于juniper EX系列交换机 CLI命令行操作模式的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/438210

相关文章

Python实现对阿里云OSS对象存储的操作详解

《Python实现对阿里云OSS对象存储的操作详解》这篇文章主要为大家详细介绍了Python实现对阿里云OSS对象存储的操作相关知识,包括连接,上传,下载,列举等功能,感兴趣的小伙伴可以了解下... 目录一、直接使用代码二、详细使用1. 环境准备2. 初始化配置3. bucket配置创建4. 文件上传到os

Java设计模式---迭代器模式(Iterator)解读

《Java设计模式---迭代器模式(Iterator)解读》:本文主要介绍Java设计模式---迭代器模式(Iterator),具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,... 目录1、迭代器(Iterator)1.1、结构1.2、常用方法1.3、本质1、解耦集合与遍历逻辑2、统一

Java 线程安全与 volatile与单例模式问题及解决方案

《Java线程安全与volatile与单例模式问题及解决方案》文章主要讲解线程安全问题的五个成因(调度随机、变量修改、非原子操作、内存可见性、指令重排序)及解决方案,强调使用volatile关键字... 目录什么是线程安全线程安全问题的产生与解决方案线程的调度是随机的多个线程对同一个变量进行修改线程的修改操

mysql表操作与查询功能详解

《mysql表操作与查询功能详解》本文系统讲解MySQL表操作与查询,涵盖创建、修改、复制表语法,基本查询结构及WHERE、GROUPBY等子句,本文结合实例代码给大家介绍的非常详细,感兴趣的朋友跟随... 目录01.表的操作1.1表操作概览1.2创建表1.3修改表1.4复制表02.基本查询操作2.1 SE

sqlite3 命令行工具使用指南

《sqlite3命令行工具使用指南》本文系统介绍sqlite3CLI的启动、数据库操作、元数据查询、数据导入导出及输出格式化命令,涵盖文件管理、备份恢复、性能统计等实用功能,并说明命令分类、SQL语... 目录一、启动与退出二、数据库与文件操作三、元数据查询四、数据操作与导入导出五、查询输出格式化六、实用功

c++中的set容器介绍及操作大全

《c++中的set容器介绍及操作大全》:本文主要介绍c++中的set容器介绍及操作大全,本文通过实例代码给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友参考下吧... 目录​​一、核心特性​​️ ​​二、基本操作​​​​1. 初始化与赋值​​​​2. 增删查操作​​​​3. 遍历方

MySQL追踪数据库表更新操作来源的全面指南

《MySQL追踪数据库表更新操作来源的全面指南》本文将以一个具体问题为例,如何监测哪个IP来源对数据库表statistics_test进行了UPDATE操作,文内探讨了多种方法,并提供了详细的代码... 目录引言1. 为什么需要监控数据库更新操作2. 方法1:启用数据库审计日志(1)mysql/mariad

springboot如何通过http动态操作xxl-job任务

《springboot如何通过http动态操作xxl-job任务》:本文主要介绍springboot如何通过http动态操作xxl-job任务的问题,具有很好的参考价值,希望对大家有所帮助,如有错... 目录springboot通过http动态操作xxl-job任务一、maven依赖二、配置文件三、xxl-

Oracle 数据库数据操作如何精通 INSERT, UPDATE, DELETE

《Oracle数据库数据操作如何精通INSERT,UPDATE,DELETE》在Oracle数据库中,对表内数据进行增加、修改和删除操作是通过数据操作语言来完成的,下面给大家介绍Oracle数... 目录思维导图一、插入数据 (INSERT)1.1 插入单行数据,指定所有列的值语法:1.2 插入单行数据,指

SQLite3命令行工具最佳实践指南

《SQLite3命令行工具最佳实践指南》SQLite3是轻量级嵌入式数据库,无需服务器支持,具备ACID事务与跨平台特性,适用于小型项目和学习,sqlite3.exe作为命令行工具,支持SQL执行、数... 目录1. SQLite3简介和特点2. sqlite3.exe使用概述2.1 sqlite3.exe