在 EX4400 上配置 Junos OS
使用 CLI 连接和配置 EX4400 交换机
连接和配置 EX4400 交换机的方法有两种:一种是通过控制台使用 CLI,另一种是使用 J-Web 界面。
从 Junos OS 22.3R1 版本开始,J-Web 可支持 EX4400 交换机。
本主题介绍 CLI 过程。
连接和配置 EX4400 之前,请在控制台服务器或 PC 上设置以下参数值:
-
波特率 - 9600
-
数据 - 8
-
流控制 - 无
-
奇偶校验 - 无
-
停止位 - 1
-
DCD 状态 - 忽略
确保您拥有以下可用的部件和工具:
-
连接了 RJ-45 连接器的以太网电缆 - 未提供
-
RJ-45 到 DB-9 串行端口适配器 - 未提供
-
带串行端口的笔记本电脑或 PC — 未提供
在为交换机配置自定义设置之前,请准备好以下信息:
-
Root 密码
-
默认网关的 IP 地址
-
管理端口的 IP 地址
-
DNS 服务器的 IP 地址
-
(选答)主机名
-
(选答)备份路由器的 IP 地址
-
(选答)SNMP 读取公共组、位置和联系人以配置 SNMP 参数
-
(选答)到具有管理端口访问权限的远程子网的静态路由
-
(选答)到可访问管理端口的远程前缀的静态路由
我们运送 EX4400 交换机时已预装 Junos OS,可在交换机开机时进行配置。您必须使用命令行界面 (CLI),通过交换机后面板上的控制台端口(标记为 CON)执行 EX4400 的初始配置。
此过程介绍如何在交换机上执行初始配置并将其连接到网络。有关启用交换机以转发流量的完整信息(包括示例),请参阅 Junos OS 配置指南。
要在交换机上执行初始配置并将其连接到网络,请执行以下步骤:
您现在可使用 CLI 登录并继续配置交换机。
要使用 J-Web 界面连接和配置 EX4400 交换机,请参阅连接和配置 EX 系列交换机(J-Web 过程)。
EX4400 默认配置
每台 EX 系列交换机均设置了出厂默认配置,此配置包含装运交换机时为每个配置参数设置的值。默认配置文件可设置系统参数(如 syslog 和 commit)的值,用于配置所有接口上的以太网交换,启用 IGMP 侦听,并启用 LLDP 和 RSTP 协议。
-
对于具有更多端口的型号,出厂默认配置文件具有更多接口。
-
该
poe语句仅出现在端口支持 PoE-bt 的型号中。
对配置执行更改时,将创建新的配置文件,它将成为活动配置。您随时可以恢复为出厂默认配置。请参阅恢复到 EX 系列交换机的出厂默认配置。
以下是具有 24 个支持 PoE-bt 的 EX4400-24P 交换机的出厂默认配置文件。其他 EX4400 型号的出厂默认配置文件与此类似。
system {
commit {
factory-settings {
reset-chassis-lcd-menu;
reset-virtual-chassis-configuration;
}
}
services {
ssh;
netconf {
ssh;
rfc-compliant;
yang-compliant;
}
}
auto-snapshot;
syslog {
file interactive-commands {
interactive-commands any;
}
file messages {
any notice;
authorization info;
}
}
phone-home {
server https://redirect.juniper.net;
rfc-compliant;
}
## Warning: missing mandatory statement(s): 'root-authentication'
}
chassis {
redundancy {
graceful-switchover;
}
}
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;
}
}
}
et-0/2/0 {
unit 0 {
family ethernet-switching {
storm-control default;
}
}
}
xe-0/2/0 {
unit 0 {
family ethernet-switching {
storm-control default;
}
}
}
et-0/2/1 {
unit 0 {
family ethernet-switching {
storm-control default;
}
}
}
xe-0/2/1 {
unit 0 {
family ethernet-switching {
storm-control default;
}
}
}
et-0/2/2 {
unit 0 {
family ethernet-switching {
storm-control default;
}
}
}
xe-0/2/2 {
unit 0 {
family ethernet-switching {
storm-control default;
}
}
}
et-0/2/3 {
unit 0 {
family ethernet-switching {
storm-control default;
}
}
}
xe-0/2/3 {
unit 0 {
family ethernet-switching {
storm-control default;
}
}
}
irb {
unit 0 {
family inet {
dhcp;
}
}
}
vme {
unit 0 {
family inet {
dhcp;
}
}
}
}
forwarding-options {
storm-control-profiles default {
all;
}
}
protocols {
lldp {
interface all;
}
lldp-med {
interface all;
}
igmp-snooping {
vlan default;
}
rstp {
interface all;
}
}
poe {
interface all;
}
vlans {
default {
vlan-id 1;
l3-interface irb.0;
}
}
将 EX4400 交换机恢复到出厂默认配置
如果交换机上的当前活动配置出现故障,可恢复为出厂默认配置。您还可以回滚到之前的配置,如 回滚 Junos OS 配置更改中所述。
如果丢失 root 密码,则没有必要恢复到出厂默认配置来进行重置。请参阅 恢复交换机上的 root 密码。
出厂默认配置包含交换机的基本配置设置。这是交换机的第一个配置,在交换机首次开机时加载。有关交换机的出厂默认配置文件,请参阅交换机的硬件文档。
要将虚拟机箱的成员交换机恢复到出厂默认配置,请断开连接到 VCP 的电缆,以避免影响其他成员上的虚拟机箱配置参数(成员 ID、主角色优先级和 VCP 上行链路的设置)(请参阅 断开光纤电缆)。
您可以使用 request system zeroize 操作命令或 load factory-default 配置命令恢复到出厂默认配置。您也可以使用 load factory-default 命令恢复到出厂默认配置文件,其中包含除 root 密码设置 外 的所有默认设置,root 密码设置将保留。
我们在以下部分中介绍了这些过程:
通过 CLI 或出厂重置/端口模式按钮重置出厂默认配置后,设备的先前主机名不会重置。只能通过配置新主机名或重新启动设备来更改主机名。
使用 request system zeroize 命令恢复到出厂默认配置
request system zeroize命令是标准 Junos OS 操作模式命令,用于移除所有配置信息并重置所有键值。该操作会将用户创建的所有数据文件(包括自定义配置和日志文件)从其目录中断开链接。交换机随后重新启动并恢复到出厂默认配置。
要完全擦除用户创建的数据,使其无法恢复,请使用命令 request system zeroize media 。
发出 request system zeroize前 ,请使用 request system snapshot 命令将当前用于运行交换机的文件备份到辅助设备上。
使用 load factory-default 命令恢复到出厂默认配置
命令 load factory-default 是标准 Junos OS 配置命令,用于将当前活动配置替换为出厂默认配置(root 密码设置除外,默认情况下未设置,但必须设置该密码才能在此过程中提交新的配置)。
在恢复到出厂默认配置之后,如果想要运行 EZsetup 脚本来完成交换机的初始配置,请勿使用命令 load factory-default 。而要使用 request system zeroize 命令执行还原。如果使用 load factory-default 命令恢复到出厂默认配置,root 密码配置将保留,并且 EZsetup 脚本将不会运行。
要使用 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 和主要角色优先级,然后使用show virtual-chassis vc-port命令查看是否有上行链路 VCP 的剩余设置。
使用出厂重置/模式按钮恢复到出厂默认配置
要使用出厂重置/模式按钮恢复到出厂默认配置:
默认情况下,出厂重置/模式按钮处于启用状态。您可以使用 CLI 禁用该按钮。
要禁用出厂重置/模式按钮,请运行以下命令:
-
[编辑] user@switch#
set chassis config-button no-clear -
[编辑] user@switch#
commit
要启用出厂重置/模式按钮,请运行以下命令:
-
[编辑] user@switch#
delete chassis config-button no-clear -
[编辑] user@switch#
commit