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

相关文章

使用Go语言开发一个命令行文件管理工具

《使用Go语言开发一个命令行文件管理工具》这篇文章主要为大家详细介绍了如何使用Go语言开发一款命令行文件管理工具,支持批量重命名,删除,创建,移动文件,需要的小伙伴可以了解下... 目录一、工具功能一览二、核心代码解析1. 主程序结构2. 批量重命名3. 批量删除4. 创建文件/目录5. 批量移动三、如何安

Python调用Orator ORM进行数据库操作

《Python调用OratorORM进行数据库操作》OratorORM是一个功能丰富且灵活的PythonORM库,旨在简化数据库操作,它支持多种数据库并提供了简洁且直观的API,下面我们就... 目录Orator ORM 主要特点安装使用示例总结Orator ORM 是一个功能丰富且灵活的 python O

python使用fastapi实现多语言国际化的操作指南

《python使用fastapi实现多语言国际化的操作指南》本文介绍了使用Python和FastAPI实现多语言国际化的操作指南,包括多语言架构技术栈、翻译管理、前端本地化、语言切换机制以及常见陷阱和... 目录多语言国际化实现指南项目多语言架构技术栈目录结构翻译工作流1. 翻译数据存储2. 翻译生成脚本

0基础租个硬件玩deepseek,蓝耘元生代智算云|本地部署DeepSeek R1模型的操作流程

《0基础租个硬件玩deepseek,蓝耘元生代智算云|本地部署DeepSeekR1模型的操作流程》DeepSeekR1模型凭借其强大的自然语言处理能力,在未来具有广阔的应用前景,有望在多个领域发... 目录0基础租个硬件玩deepseek,蓝耘元生代智算云|本地部署DeepSeek R1模型,3步搞定一个应

轻松上手MYSQL之JSON函数实现高效数据查询与操作

《轻松上手MYSQL之JSON函数实现高效数据查询与操作》:本文主要介绍轻松上手MYSQL之JSON函数实现高效数据查询与操作的相关资料,MySQL提供了多个JSON函数,用于处理和查询JSON数... 目录一、jsON_EXTRACT 提取指定数据二、JSON_UNQUOTE 取消双引号三、JSON_KE

Java实现状态模式的示例代码

《Java实现状态模式的示例代码》状态模式是一种行为型设计模式,允许对象根据其内部状态改变行为,本文主要介绍了Java实现状态模式的示例代码,文中通过示例代码介绍的非常详细,需要的朋友们下面随着小编来... 目录一、简介1、定义2、状态模式的结构二、Java实现案例1、电灯开关状态案例2、番茄工作法状态案例

C++实现封装的顺序表的操作与实践

《C++实现封装的顺序表的操作与实践》在程序设计中,顺序表是一种常见的线性数据结构,通常用于存储具有固定顺序的元素,与链表不同,顺序表中的元素是连续存储的,因此访问速度较快,但插入和删除操作的效率可能... 目录一、顺序表的基本概念二、顺序表类的设计1. 顺序表类的成员变量2. 构造函数和析构函数三、顺序表

使用C++实现单链表的操作与实践

《使用C++实现单链表的操作与实践》在程序设计中,链表是一种常见的数据结构,特别是在动态数据管理、频繁插入和删除元素的场景中,链表相比于数组,具有更高的灵活性和高效性,尤其是在需要频繁修改数据结构的应... 目录一、单链表的基本概念二、单链表类的设计1. 节点的定义2. 链表的类定义三、单链表的操作实现四、

Python利用自带模块实现屏幕像素高效操作

《Python利用自带模块实现屏幕像素高效操作》这篇文章主要为大家详细介绍了Python如何利用自带模块实现屏幕像素高效操作,文中的示例代码讲解详,感兴趣的小伙伴可以跟随小编一起学习一下... 目录1、获取屏幕放缩比例2、获取屏幕指定坐标处像素颜色3、一个简单的使用案例4、总结1、获取屏幕放缩比例from

通过prometheus监控Tomcat运行状态的操作流程

《通过prometheus监控Tomcat运行状态的操作流程》文章介绍了如何安装和配置Tomcat,并使用Prometheus和TomcatExporter来监控Tomcat的运行状态,文章详细讲解了... 目录Tomcat安装配置以及prometheus监控Tomcat一. 安装并配置tomcat1、安装