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

相关文章

Linux系统配置NAT网络模式的详细步骤(附图文)

《Linux系统配置NAT网络模式的详细步骤(附图文)》本文详细指导如何在VMware环境下配置NAT网络模式,包括设置主机和虚拟机的IP地址、网关,以及针对Linux和Windows系统的具体步骤,... 目录一、配置NAT网络模式二、设置虚拟机交换机网关2.1 打开虚拟机2.2 管理员授权2.3 设置子

Mysql表的简单操作(基本技能)

《Mysql表的简单操作(基本技能)》在数据库中,表的操作主要包括表的创建、查看、修改、删除等,了解如何操作这些表是数据库管理和开发的基本技能,本文给大家介绍Mysql表的简单操作,感兴趣的朋友一起看... 目录3.1 创建表 3.2 查看表结构3.3 修改表3.4 实践案例:修改表在数据库中,表的操作主要

C# WinForms存储过程操作数据库的实例讲解

《C#WinForms存储过程操作数据库的实例讲解》:本文主要介绍C#WinForms存储过程操作数据库的实例,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录一、存储过程基础二、C# 调用流程1. 数据库连接配置2. 执行存储过程(增删改)3. 查询数据三、事务处

Java使用Curator进行ZooKeeper操作的详细教程

《Java使用Curator进行ZooKeeper操作的详细教程》ApacheCurator是一个基于ZooKeeper的Java客户端库,它极大地简化了使用ZooKeeper的开发工作,在分布式系统... 目录1、简述2、核心功能2.1 CuratorFramework2.2 Recipes3、示例实践3

Java利用JSONPath操作JSON数据的技术指南

《Java利用JSONPath操作JSON数据的技术指南》JSONPath是一种强大的工具,用于查询和操作JSON数据,类似于SQL的语法,它为处理复杂的JSON数据结构提供了简单且高效... 目录1、简述2、什么是 jsONPath?3、Java 示例3.1 基本查询3.2 过滤查询3.3 递归搜索3.4

SpringBoot如何通过Map实现策略模式

《SpringBoot如何通过Map实现策略模式》策略模式是一种行为设计模式,它允许在运行时选择算法的行为,在Spring框架中,我们可以利用@Resource注解和Map集合来优雅地实现策略模式,这... 目录前言底层机制解析Spring的集合类型自动装配@Resource注解的行为实现原理使用直接使用M

Python使用DrissionPage中ChromiumPage进行自动化网页操作

《Python使用DrissionPage中ChromiumPage进行自动化网页操作》DrissionPage作为一款轻量级且功能强大的浏览器自动化库,为开发者提供了丰富的功能支持,本文将使用Dri... 目录前言一、ChromiumPage基础操作1.初始化Drission 和 ChromiumPage

利用Go语言开发文件操作工具轻松处理所有文件

《利用Go语言开发文件操作工具轻松处理所有文件》在后端开发中,文件操作是一个非常常见但又容易出错的场景,本文小编要向大家介绍一个强大的Go语言文件操作工具库,它能帮你轻松处理各种文件操作场景... 目录为什么需要这个工具?核心功能详解1. 文件/目录存javascript在性检查2. 批量创建目录3. 文件

Redis中管道操作pipeline的实现

《Redis中管道操作pipeline的实现》RedisPipeline是一种优化客户端与服务器通信的技术,通过批量发送和接收命令减少网络往返次数,提高命令执行效率,本文就来介绍一下Redis中管道操... 目录什么是pipeline场景一:我要向Redis新增大批量的数据分批处理事务( MULTI/EXE

使用Python高效获取网络数据的操作指南

《使用Python高效获取网络数据的操作指南》网络爬虫是一种自动化程序,用于访问和提取网站上的数据,Python是进行网络爬虫开发的理想语言,拥有丰富的库和工具,使得编写和维护爬虫变得简单高效,本文将... 目录网络爬虫的基本概念常用库介绍安装库Requests和BeautifulSoup爬虫开发发送请求解