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

相关文章

使用Java将各种数据写入Excel表格的操作示例

《使用Java将各种数据写入Excel表格的操作示例》在数据处理与管理领域,Excel凭借其强大的功能和广泛的应用,成为了数据存储与展示的重要工具,在Java开发过程中,常常需要将不同类型的数据,本文... 目录前言安装免费Java库1. 写入文本、或数值到 Excel单元格2. 写入数组到 Excel表格

Python中pywin32 常用窗口操作的实现

《Python中pywin32常用窗口操作的实现》本文主要介绍了Python中pywin32常用窗口操作的实现,pywin32主要的作用是供Python开发者快速调用WindowsAPI的一个... 目录获取窗口句柄获取最前端窗口句柄获取指定坐标处的窗口根据窗口的完整标题匹配获取句柄根据窗口的类别匹配获取句

Python位移操作和位运算的实现示例

《Python位移操作和位运算的实现示例》本文主要介绍了Python位移操作和位运算的实现示例,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一... 目录1. 位移操作1.1 左移操作 (<<)1.2 右移操作 (>>)注意事项:2. 位运算2.1

Python ZIP文件操作技巧详解

《PythonZIP文件操作技巧详解》在数据处理和系统开发中,ZIP文件操作是开发者必须掌握的核心技能,Python标准库提供的zipfile模块以简洁的API和跨平台特性,成为处理ZIP文件的首选... 目录一、ZIP文件操作基础三板斧1.1 创建压缩包1.2 解压操作1.3 文件遍历与信息获取二、进阶技

Java中字符串转时间与时间转字符串的操作详解

《Java中字符串转时间与时间转字符串的操作详解》Java的java.time包提供了强大的日期和时间处理功能,通过DateTimeFormatter可以轻松地在日期时间对象和字符串之间进行转换,下面... 目录一、字符串转时间(一)使用预定义格式(二)自定义格式二、时间转字符串(一)使用预定义格式(二)自

Python使用getopt处理命令行参数示例解析(最佳实践)

《Python使用getopt处理命令行参数示例解析(最佳实践)》getopt模块是Python标准库中一个简单但强大的命令行参数处理工具,它特别适合那些需要快速实现基本命令行参数解析的场景,或者需要... 目录为什么需要处理命令行参数?getopt模块基础实际应用示例与其他参数处理方式的比较常见问http

Nginx location匹配模式与规则详解

《Nginxlocation匹配模式与规则详解》:本文主要介绍Nginxlocation匹配模式与规则,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录一、环境二、匹配模式1. 精准模式2. 前缀模式(不继续匹配正则)3. 前缀模式(继续匹配正则)4. 正则模式(大

Java字符串操作技巧之语法、示例与应用场景分析

《Java字符串操作技巧之语法、示例与应用场景分析》在Java算法题和日常开发中,字符串处理是必备的核心技能,本文全面梳理Java中字符串的常用操作语法,结合代码示例、应用场景和避坑指南,可快速掌握字... 目录引言1. 基础操作1.1 创建字符串1.2 获取长度1.3 访问字符2. 字符串处理2.1 子字

SpringShell命令行之交互式Shell应用开发方式

《SpringShell命令行之交互式Shell应用开发方式》本文将深入探讨SpringShell的核心特性、实现方式及应用场景,帮助开发者掌握这一强大工具,具有很好的参考价值,希望对大家有所帮助,如... 目录引言一、Spring Shell概述二、创建命令类三、命令参数处理四、命令分组与帮助系统五、自定

Python 中的 with open文件操作的最佳实践

《Python中的withopen文件操作的最佳实践》在Python中,withopen()提供了一个简洁而安全的方式来处理文件操作,它不仅能确保文件在操作完成后自动关闭,还能处理文件操作中的异... 目录什么是 with open()?为什么使用 with open()?使用 with open() 进行