在 EX2300 上配置 Junos OS
EX2300 交换机默认配置
每台 EX 系列交换机都使用出厂默认配置进行编程,其中包含在交换机发货时为每个配置参数设置的值。EX2300 交换机的默认配置文件用于在所有接口上配置以太网交换和风暴控制,在提供 PoE 的型号的所有接口上配置以太网供电 (PoE),并启用 LLDP、LLDP-MED 和 RSTP 协议和 IGMP 侦听。
对配置提交更改时,将创建新的配置文件,该配置文件将成为活动配置。您可以随时恢复到出厂默认配置 — EX2300 交换机没有 LCD 面板,请使用 CLI 命令恢复到出厂默认配置。请参阅 恢复到 EX 系列交换机的默认出厂配置。
EX2300 交换机型号不同,出厂默认配置文件也不同。
默认配置文件中的接口数量取决于 EX2300 交换机中的端口数量。
语句 poe
不会对于没有 PoE 的型号出现。
EX2300 交换机(EX2300-C 交换机除外)上的上行链路端口列为ge-0/1/0
ge-0/1/3
和xe-0/1/0
到xe-0/1/3
。EX2300-C 交换机ge-0/1/0
上的上行链路端口。ge-0/1/1
xe-0/1/0
xe-0/1/1
以下是具有 24 个端口且具有 PoE 功能且运行 Junos OS 18.2R3 或更高版本的 EX2300 交换机的出厂默认配置文件。
system { auto-snapshot; phone-home { server https://redirect.juniper.net; rfc-compliant; } services { ssh; netconf { ssh; rfc-compliant; yang-compliant; } } } protocols { lldp { interface all; } lldp-med { interface all; } igmp-snooping { vlan default; } rstp { interface ge-0/0/0; interface ge-0/0/1; interface ge-0/0/2; interface ge-0/0/3; interface ge-0/0/4; interface ge-0/0/5; interface ge-0/0/6; interface ge-0/0/7; interface ge-0/0/8; interface ge-0/0/9; interface ge-0/0/10; interface ge-0/0/11; interface ge-0/0/12; interface ge-0/0/13; interface ge-0/0/14; interface ge-0/0/15; interface ge-0/0/16; interface ge-0/0/17; interface ge-0/0/18; interface ge-0/0/19; interface ge-0/0/20; interface ge-0/0/21; interface ge-0/0/22; interface ge-0/0/23; interface xe-0/1/0; interface xe-0/1/1; interface xe-0/1/2; interface xe-0/1/3; interface ge-0/1/0; interface ge-0/1/1; interface ge-0/1/2; interface ge-0/1/3; } } forwarding-options { storm-control-profiles default { all; } } poe { interface all; } interfaces { ## For phone-home connectivity to PHS enable dhcp on vme and irb. vme { unit 0 { family inet { dhcp; } } } irb { unit 0 { family inet { dhcp; } } } ge-0/0/0 { unit 0 { family ethernet-switching { storm-control default; } } } ge-0/0/1 { unit 0 { family ethernet-switching { storm-control default; } } } ge-0/0/2 { unit 0 { family ethernet-switching { storm-control default; } } } ge-0/0/3 { unit 0 { family ethernet-switching { storm-control default; } } } ge-0/0/4 { unit 0 { family ethernet-switching { storm-control default; } } } ge-0/0/5 { unit 0 { family ethernet-switching { storm-control default; } } } ge-0/0/6 { unit 0 { family ethernet-switching { storm-control default; } } } ge-0/0/7 { unit 0 { family ethernet-switching { storm-control default; } } } ge-0/0/8 { unit 0 { family ethernet-switching { storm-control default; } } } ge-0/0/9 { unit 0 { family ethernet-switching { storm-control default; } } } ge-0/0/10 { unit 0 { family ethernet-switching { storm-control default; } } } ge-0/0/11 { unit 0 { family ethernet-switching { storm-control default; } } } ge-0/0/12 { unit 0 { family ethernet-switching { storm-control default; } } } ge-0/0/13 { unit 0 { family ethernet-switching { storm-control default; } } } ge-0/0/14 { unit 0 { family ethernet-switching { storm-control default; } } } ge-0/0/15 { unit 0 { family ethernet-switching { storm-control default; } } } ge-0/0/16 { unit 0 { family ethernet-switching { storm-control default; } } } ge-0/0/17 { unit 0 { family ethernet-switching { storm-control default; } } } ge-0/0/18 { unit 0 { family ethernet-switching { storm-control default; } } } ge-0/0/19 { unit 0 { family ethernet-switching { storm-control default; } } } ge-0/0/20 { unit 0 { family ethernet-switching { storm-control default; } } } ge-0/0/21 { unit 0 { family ethernet-switching { storm-control default; } } } ge-0/0/22 { unit 0 { family ethernet-switching { storm-control default; } } } ge-0/0/23 { unit 0 { family ethernet-switching { storm-control default; } } } xe-0/1/0 { unit 0 { family ethernet-switching { storm-control default; } } } xe-0/1/1 { unit 0 { family ethernet-switching { storm-control default; } } } xe-0/1/2 { unit 0 { family ethernet-switching { storm-control default; } } } xe-0/1/3 { unit 0 { family ethernet-switching { storm-control default; } } } ge-0/1/0 { unit 0 { family ethernet-switching { storm-control default; } } } ge-0/1/1 { unit 0 { family ethernet-switching { storm-control default; } } } ge-0/1/2 { unit 0 { family ethernet-switching { storm-control default; } } } ge-0/1/3 { unit 0 { family ethernet-switching { storm-control default; } } } } groups { junos-defaults { protocols { igmp { interface me0.0 { disable; } interface vme.0 { disable; } } } } } system { commit { factory-settings { reset-chassis-lcd-menu; reset-virtual-chassis-configuration; } } } chassis { redundancy { graceful-switchover; } } vlans { default { vlan-id 1; l3-interface irb.0; } }
以下是具有 24 个端口且具有 PoE 功能且运行的 Junos OS 版本早于 18.2R3 的 EX2300 交换机的出厂默认配置文件。
system { auto-snapshot; syslog { user * { any emergency; } file messages { any notice; authorization info; } file interactive-commands { interactive-commands any; } } commit { factory-settings { reset-virtual-chassis-configuration; reset-chassis-lcd-menu; } } } interfaces { ge-0/0/0 { unit 0 { family ethernet-switching { storm-control default; } } } ge-0/0/1 { unit 0 { family ethernet-switching { storm-control default; } } } ge-0/0/2 { unit 0 { family ethernet-switching { storm-control default; } } } ge-0/0/3 { unit 0 { family ethernet-switching { storm-control default; } } } ge-0/0/4 { unit 0 { family ethernet-switching { storm-control default; } } } ge-0/0/5 { unit 0 { family ethernet-switching { storm-control default; } } } ge-0/0/6 { unit 0 { family ethernet-switching { storm-control default; } } } ge-0/0/7 { unit 0 { family ethernet-switching { storm-control default; } } } ge-0/0/8 { unit 0 { family ethernet-switching { storm-control default; } } } ge-0/0/9 { unit 0 { family ethernet-switching { storm-control default; } } } ge-0/0/10 { unit 0 { family ethernet-switching { storm-control default; } } } ge-0/0/11 { unit 0 { family ethernet-switching { storm-control default; } } } ge-0/0/12 { unit 0 { family ethernet-switching { storm-control default; } } } ge-0/0/13 { unit 0 { family ethernet-switching { storm-control default; } } } ge-0/0/14 { unit 0 { family ethernet-switching { storm-control default; } } } ge-0/0/15 { unit 0 { family ethernet-switching { storm-control default; } } } ge-0/0/16 { unit 0 { family ethernet-switching { storm-control default; } } } ge-0/0/17 { unit 0 { family ethernet-switching { storm-control default; } } } ge-0/0/18 { unit 0 { family ethernet-switching { storm-control default; } } } ge-0/0/19 { unit 0 { family ethernet-switching { storm-control default; } } } ge-0/0/20 { unit 0 { family ethernet-switching { storm-control default; } } } ge-0/0/21 { unit 0 { family ethernet-switching { storm-control default; } } } ge-0/0/22 { unit 0 { family ethernet-switching { storm-control default; } } } ge-0/0/23 { unit 0 { family ethernet-switching { storm-control default; } } } ge-0/1/0 { unit 0 { family ethernet-switching { storm-control default; } } } xe-0/1/0 { unit 0 { family ethernet-switching { storm-control default; } } } ge-0/1/1 { unit 0 { family ethernet-switching { storm-control default; } } } xe-0/1/1 { unit 0 { family ethernet-switching { storm-control default; } } } ge-0/1/2 { unit 0 { family ethernet-switching { storm-control default; } } } xe-0/1/2 { unit 0 { family ethernet-switching { storm-control default; } } } ge-0/1/3 { unit 0 { family ethernet-switching { storm-control default; } } } xe-0/1/3 { unit 0 { family ethernet-switching { storm-control default; } } } } forwarding-options { storm-control-profiles default { all; } } protocols { lldp { interface all; } lldp-med { interface all; } igmp-snooping { vlan default; } rstp { interface ge-0/0/0; interface ge-0/0/1; interface ge-0/0/2; interface ge-0/0/3; interface ge-0/0/4; interface ge-0/0/5; interface ge-0/0/6; interface ge-0/0/7; interface ge-0/0/8; interface ge-0/0/9; interface ge-0/0/10; interface ge-0/0/11; interface ge-0/0/12; interface ge-0/0/13; interface ge-0/0/14; interface ge-0/0/15; interface ge-0/0/16; interface ge-0/0/17; interface ge-0/0/18; interface ge-0/0/19; interface ge-0/0/20; interface ge-0/0/21; interface ge-0/0/22; interface ge-0/0/23; interface ge-0/1/0; interface xe-0/1/0; interface ge-0/1/1; interface xe-0/1/1; interface ge-0/1/2; interface xe-0/1/2; interface ge-0/1/3; interface xe-0/1/3; } } poe { interface all; }
另请参阅
连接和配置 EX 系列交换机(CLI 过程)
使用 CLI,在控制台服务器或 PC 中设置以下参数值:
波特率 — 9600
流控制 — 无
数据 — 8
奇偶校验 — 无
停止位 — 1
DCD 状态 — 忽略
连接和配置 EX 系列交换机有两种方法:一种方法是使用 CLI 通过控制台,另一种方法是使用 J-Web 界面。
EX2200-24T-4G-DC 交换机不支持通过 J-Web 界面连接和配置交换机。
本主题介绍 CLI 过程。
要运行脚本 ezsetup
,交换机必须将出厂默认配置作为活动配置。如果您在交换机上配置了任何配置并想要运行 ezsetup
,请恢复为出厂默认配置。请参阅 恢复到 EX 系列交换机的默认出厂配置。
要使用 CLI 从控制台连接和配置交换机:
您现在可使用 CLI 或 J-Web 界面登录,以继续配置交换机。如果您使用 J-Web 界面继续配置交换机,Web 会话将重定向至新的管理 IP 地址。如果无法建立连接,J-Web 界面将显示启动 J-Web 会话的说明。
另请参阅
连接和配置 EX 系列交换机(J-Web 过程)
连接和配置 EX 系列交换机有两种方法:一种方法是使用 CLI 通过控制台,另一种方法是使用 J-Web 界面。
从 Junos OS 19.2R1 版开始,J-Web 支持 EX4650 交换机。
您无法使用 J-Web 界面中的 EZSetup 过程连接到 EX2200-24T-4G-DC、EX4300-48MP、EX4300-48MP-S 交换机和 EX4600 交换机并执行初始配置。对于 EX2200-24T-4G-DC 交换机,必须通过交换机控制台使用 EZSetup。对于 EX4300-48MP、EX4300-48MP-S 和 EX4600 交换机,必须通过交换机控制台使用 CLI 过程。
本主题介绍 J-Web 过程。
开始配置之前,在要连接到交换机的管理 PC 上启用 DHCP 客户端,以便 PC 可以动态获取 IP 地址。
在开始配置之前,请阅读以下步骤。您必须在 10 分钟内使用 EZSetup 完成初始配置。交换机在 10 分钟后退出 EZSetup,并恢复为出厂默认配置,PC 会失去与交换机的连接。
EX2200 和 EX2200-C 交换机 — 交换机处于初始设置模式时,位于前面板上的网络端口上的 LED 会闪烁。
EX3200、EX3300、EX4200、EX4300 交换机(EX4300-48MP 和 EX4300-48MP-S 交换机、EX4500、EX4550、EX6200 或 EX8200 交换机除外) — 交换机处于初始设置模式时,液晶显示屏会显示倒数计时器。
注意:EX4300-48MP 和 EX4300-48MP-S 交换机上没有液晶显示屏。
要使用 J-Web 界面连接和配置交换机:
现在,您可以使用 CLI 或 J-Web 界面登录,以继续配置交换机。
如果您使用 J-Web 界面继续配置交换机,Web 会话将重定向至新的管理 IP 地址。如果无法建立连接,J-Web 界面将显示启动 J-Web 会话的说明。
恢复到 EX 系列交换机的默认出厂配置
使用 EX 系列交换机,如果由于任何原因当前的活动配置失败,您可以恢复到出厂默认配置。
您还可以回滚到之前的配置(如 回滚 Junos OS 配置更改中所述),或者恢复到救援配置(如 恢复为 EX 系列交换机的救援配置中所述)。
如果丢失了 root 密码,则无需恢复到出厂默认配置来重置密码。请参阅 恢复交换机上的 root 密码。
出厂默认配置包含交换机的基本配置设置。这是交换机的第一个配置,在交换机首次开机时加载。有关交换机的出厂默认配置文件,请参阅交换机的硬件文档。
恢复为出厂默认配置 后 ,您可以运行 EZsetup 脚本来完成交换机的初始配置。(EZsetup 脚本仅适用于固定配置交换机,不适用于模块化交换机。)有关使用 CLI 或 J-Web 界面完成初始配置的信息,请参阅 连接和配置 EX 系列交换机(CLI 过程) 或 连接和配置 EX 系列交换机(J-Web 过程)。
您可以使用带 LCD 面板的交换机上 LCD 面板右侧的 Menu 按钮,或者使用 request system zeroize
操作命令或 load factory-default
配置命令,恢复到出厂默认配置。(如果您的交换机型号没有 LCD 面板,请使用以下命令。)您还可以使用 load factory-default
命令恢复到出厂默认配置文件,其中包含除 root 密码设置 以外的 所有默认设置,root 密码设置将保留。
以下部分介绍了这些过程:
- 使用 request system zeroize 命令恢复到 EX 系列交换机的出厂默认配置
- 使用 load factory-default 命令恢复到 EX 系列交换机的出厂默认配置
- 使用 EX 系列交换机 LCD 面板恢复到出厂默认配置
- 使用 EX2300、EX3400 和 EX4300-48MP 交换机上的出厂重置/模式按钮恢复到出厂默认配置
使用 request system zeroize 命令恢复到 EX 系列交换机的出厂默认配置
命令 request system zeroize
是标准 Junos OS 操作模式命令,用于移除所有配置信息并重置所有键值。该操作可取消所有用户创建的数据文件(包括自定义配置和日志文件)与其目录中的关联。交换机随后重新启动并恢复为出厂默认配置。
要完全擦除用户创建的数据,使其无法恢复,请使用 request system zeroize media
命令。
发出 request system zeroize
之前, request system snapshot
使用命令将当前用于运行交换机的文件备份到辅助设备。使用 zeroize 命令会破坏 Junos 和 OAM 分区,交换机可能无法启动。要从安装失败的软件中恢复,请参阅 从失败的软件安装中恢复。
要使用命令恢复到出厂默认配置 request system zeroize
:
使用 load factory-default 命令恢复到 EX 系列交换机的出厂默认配置
命令 load factory-default
是标准 Junos OS 配置命令,用于将当前活动配置替换为出厂默认配置(root 密码设置除外,默认情况下未设置,但必须设置该密码才能在此过程中提交新配置)。
如果想要在恢复到出厂默认配置后运行 EZsetup 脚本来完成交换机的初始配置,请勿使用 load factory-default
命令。而是使用 LCD 面板或 request system zeroize
命令进行回归。如果使用 load factory-default
命令恢复到出厂默认配置,root 密码配置将保留,并且 EZsetup 脚本不会运行。(EZsetup 脚本仅适用于固定配置交换机,不适用于模块化交换机。)
在 load factory-default
虚拟机箱中配置的 EX3300、EX4200、EX4500 和 EX4550 交换机上,命令本身不受支持。
要使用命令恢复到出厂默认配置 load factory-default
:
如果使用此过程,则必须删除系统提交出厂设置,设置 root 密码,然后提交配置。使用request system zeroize
恢复到出厂默认配置时,不需要执行这些步骤。此外,auto-image-upgrade
使用此过程时,语句不会添加到配置中;使用request system zeroize
时,语句会添加到配置中。
- [编辑] user@switch#
load factory-default
- [编辑] user@switch#
delete system commit factory-settings
- [编辑] user@switch#
set system root-authentication plain-text-password
- [编辑] user@switch#
commit
- 使用
show virtual-chassis
命令检查成员 ID 和主角色优先级,并使用命令查看是否有上行链路 VCP 的show virtual-chassis vc-port
剩余设置。
使用 EX 系列交换机 LCD 面板恢复到出厂默认配置
要将交换机设置为出厂默认配置,对于 EX 系列交换机,您可以使用 LCD 面板和交换机前面板上的按钮。如果 EX 系列交换机型号没有 LCD 面板,请使用以下部分中介绍的过程之一。
要虚拟机箱的成员交换机恢复到出厂默认配置,请首先断开连接到虚拟机箱端口 (VCP) 的电缆,以避免影响其他成员上的虚拟机箱配置参数(成员 ID、主角色优先级和 VCP 上行链路的设置)。请参阅 断开光纤电缆、 断开虚拟机箱电缆与 EX4200 交换机的连接,或 断开虚拟机箱电缆与 EX4500 交换机的连接。
要使用 LCD 面板恢复到出厂默认配置:
- 按 Menu 按钮,直到在面板上看到 MAINTENANCE MENU。
- 按 Enter 按钮。
- 按 Menu, 直到看到 FACTORY DEFAULT。
- 按 Enter。显示 RESTORE DEFAULT?
- 按 Enter。屏幕 闪烁出厂默认状态, 并返回空闲菜单。
- 完成交换机的初始配置。请参阅连接和配置 EX 系列交换机(CLI 过程)或连接和配置 EX 系列交换机(J-Web 过程)。
使用 EX2300、EX3400 和 EX4300-48MP 交换机上的出厂重置/模式按钮恢复到出厂默认配置
要将 EX2300 交换机(EX2300-24MP 和 EX2300-48MP 交换机、EX2300-C 交换机、EX3400 交换机和 EX4300-48MP 交换机)设置为出厂默认配置,请使用位于前面板最右侧的出厂重置/模式按钮。
要虚拟机箱的成员交换机恢复到出厂默认配置,请断开连接到 VCP 的电缆,以避免影响其他成员上的虚拟机箱配置参数(成员 ID、主角色优先级和 VCP 上行链路的设置)(请参阅 断开光纤电缆)。
要使用出厂重置/模式按钮恢复到出厂默认配置:
- 按住出厂重置/模式按钮 10 秒。交换机将转换为出厂默认配置,控制台会显示 提交出厂默认配置,RJ-45 网络端口和上行链路端口上的链路/活动 LED 呈绿色稳定亮起。
- 再按出厂重置/模式按钮 10 秒。交换机将转换为初始设置模式,控制台显示 提交 ezsetup 配置,RJ-45 网络端口上的链路/活动 LED 和上行链路端口呈绿色闪烁。
默认情况下,出厂重置/模式按钮处于启用状态。您可以使用 CLI 禁用该按钮。
要禁用出厂重置/模式按钮,请运行以下命令:
[编辑] user@switch#
set chassis config-button no-clear
[编辑] user@switch#
commit
要启用出厂重置/模式按钮,请运行以下命令:
[编辑] user@switch#
delete chassis config-button no-clear
[编辑] user@switch#
commit