在 EX4100-F 交换机上配置 Junos OS
EX4100-F 默认配置
每台 EX 系列交换机均设置了出厂默认配置,此配置包含装运交换机时为每个配置参数设置的值。默认配置文件可以设置系统参数syslogcommit的值,例如 和 ,用于在所有接口上配置以太网交换,启用 IGMP 侦听,并启用 LLDP 和 RSTP 协议。
对于具有更多端口的型号,出厂默认配置文件包含更多接口。
poe该语句不适用于没有 PoE+ 端口的型号。
对配置执行更改时,将创建新的配置文件。此文件将成为活动配置。您随时可以恢复为出厂默认配置。请参阅恢复 到 EX 系列交换机上的默认出厂配置。
以下是 EX4100-48P 交换机的出厂默认配置文件:
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;
}
}
processes {
dhcp-service {
traceoptions {
file dhcp_logfile size 10m;
level all;
flag packet;
}
}
}
phone-home {
server https://redirect.juniper.net;
rfc-compliant;
}
## Warning: missing mandatory statement(s): 'root-authentication'
}
chassis {
redundancy {
graceful-switchover;
}
auto-image-upgrade;
}
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/0/24 {
unit 0 {
family ethernet-switching {
storm-control default;
}
}
}
ge-0/0/25 {
unit 0 {
family ethernet-switching {
storm-control default;
}
}
}
ge-0/0/26 {
unit 0 {
family ethernet-switching {
storm-control default;
}
}
}
ge-0/0/27 {
unit 0 {
family ethernet-switching {
storm-control default;
}
}
}
ge-0/0/28 {
unit 0 {
family ethernet-switching {
storm-control default;
}
}
}
ge-0/0/29 {
unit 0 {
family ethernet-switching {
storm-control default;
}
}
}
ge-0/0/30 {
unit 0 {
family ethernet-switching {
storm-control default;
}
}
}
ge-0/0/31 {
unit 0 {
family ethernet-switching {
storm-control default;
}
}
}
ge-0/0/32 {
unit 0 {
family ethernet-switching {
storm-control default;
}
}
}
ge-0/0/33 {
unit 0 {
family ethernet-switching {
storm-control default;
}
}
}
ge-0/0/34 {
unit 0 {
family ethernet-switching {
storm-control default;
}
}
}
ge-0/0/35 {
unit 0 {
family ethernet-switching {
storm-control default;
}
}
}
ge-0/0/36 {
unit 0 {
family ethernet-switching {
storm-control default;
}
}
}
ge-0/0/37 {
unit 0 {
family ethernet-switching {
storm-control default;
}
}
}
ge-0/0/38 {
unit 0 {
family ethernet-switching {
storm-control default;
}
}
}
ge-0/0/39 {
unit 0 {
family ethernet-switching {
storm-control default;
}
}
}
ge-0/0/40 {
unit 0 {
family ethernet-switching {
storm-control default;
}
}
}
ge-0/0/41 {
unit 0 {
family ethernet-switching {
storm-control default;
}
}
}
ge-0/0/42 {
unit 0 {
family ethernet-switching {
storm-control default;
}
}
}
ge-0/0/43 {
unit 0 {
family ethernet-switching {
storm-control default;
}
}
}
ge-0/0/44 {
unit 0 {
family ethernet-switching {
storm-control default;
}
}
}
ge-0/0/45 {
unit 0 {
family ethernet-switching {
storm-control default;
}
}
}
ge-0/0/46 {
unit 0 {
family ethernet-switching {
storm-control default;
}
}
}
ge-0/0/47 {
unit 0 {
family ethernet-switching {
storm-control default;
}
}
}
et-0/1/0 {
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;
}
}
}
et-0/1/1 {
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;
}
}
}
et-0/1/2 {
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;
}
}
}
et-0/1/3 {
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;
}
}
}
ge-0/2/0 {
unit 0 {
family ethernet-switching {
storm-control default;
}
}
}
xe-0/2/0 {
unit 0 {
family ethernet-switching {
storm-control default;
}
}
}
ge-0/2/1 {
unit 0 {
family ethernet-switching {
storm-control default;
}
}
}
xe-0/2/1 {
unit 0 {
family ethernet-switching {
storm-control default;
}
}
}
ge-0/2/2 {
unit 0 {
family ethernet-switching {
storm-control default;
}
}
}
xe-0/2/2 {
unit 0 {
family ethernet-switching {
storm-control default;
}
}
}
ge-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 {
vendor-id Juniper-ex4100-48p-FA1422AN0045;
}
}
family inet6 {
dhcpv6-client {
client-type stateful;
client-ia-type ia-na;
client-identifier duid-type duid-ll;
vendor-id Juniper:ex4100-48p:FA1422AN0045;
}
}
}
}
vme {
unit 0 {
family inet {
dhcp {
vendor-id Juniper-ex4100-48p-FA1422AN0045;
}
}
family inet6 {
dhcpv6-client {
client-type stateful;
client-ia-type ia-na;
client-identifier duid-type duid-ll;
vendor-id Juniper:ex4100-48p:FA1422AN0045;
}
}
}
}
}
forwarding-options {
storm-control-profiles default {
all;
}
}
protocols {
router-advertisement {
interface vme.0 {
managed-configuration;
}
interface irb.0 {
managed-configuration;
}
}
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/0/24;
interface ge-0/0/25;
interface ge-0/0/26;
interface ge-0/0/27;
interface ge-0/0/28;
interface ge-0/0/29;
interface ge-0/0/30;
interface ge-0/0/31;
interface ge-0/0/32;
interface ge-0/0/33;
interface ge-0/0/34;
interface ge-0/0/35;
interface ge-0/0/36;
interface ge-0/0/37;
interface ge-0/0/38;
interface ge-0/0/39;
interface ge-0/0/40;
interface ge-0/0/41;
interface ge-0/0/42;
interface ge-0/0/43;
interface ge-0/0/44;
interface ge-0/0/45;
interface ge-0/0/46;
interface ge-0/0/47;
interface et-0/1/0;
interface ge-0/1/0;
interface xe-0/1/0;
interface et-0/1/1;
interface ge-0/1/1;
interface xe-0/1/1;
interface et-0/1/2;
interface ge-0/1/2;
interface xe-0/1/2;
interface et-0/1/3;
interface ge-0/1/3;
interface xe-0/1/3;
interface ge-0/2/0;
interface xe-0/2/0;
interface ge-0/2/1;
interface xe-0/2/1;
interface ge-0/2/2;
interface xe-0/2/2;
interface ge-0/2/3;
interface xe-0/2/3;
}
}
poe {
interface all;
}
vlans {
default {
vlan-id 1;
l3-interface irb.0;
}
}
连接和配置 EX4100-F 交换机
连接和配置 EX4100-F 交换机之前,请在控制台服务器或 PC 上设置以下参数值:
波特率 - 9600
数据—8
流控制 - 无
奇偶校验 - 无
停止位 - 1
DCD 状态 - 忽略
确保您有以下可用的零件和工具:
连接有 RJ-45 连接器的以太网电缆(未提供)
RJ-45 到 DB-9 串行端口适配器(未提供)
带有串行端口(未提供)的笔记本电脑或 PC
设备包中不再包含带有 DB-9 适配器的 RJ-45 控制台电缆。如果您的设备包装中不包含控制台电缆和适配器,或者您需要不同类型的适配器,您可以单独订购以下产品:
-
RJ-45 到 DB-9 适配器 (JNP-CBL-RJ45-DB9)
-
RJ-45 转 USB-A 适配器 (JNP-CBL-RJ45-USBA)
-
RJ-45 转 USB-C 适配器 (JNP-CBL-RJ45-USBC)
如果您想使用 RJ-45 到 USB-A 或 RJ-45 到 USB-C 适配器,您的 PC 上必须安装 X64(64 位)虚拟 COM 端口 (VCP) 驱动程序。看, https://ftdichip.com/drivers/vcp-drivers/ 下载驱动程序。
在为交换机配置自定义设置之前,请准备好以下信息:
Root 密码
默认网关的 IP 地址
管理端口的 IP 地址
DNS 服务器的 IP 地址
(选答)主机名
(选答)备份路由器的 IP 地址
(选答)SNMP 读取公共组、位置和联系人以配置 SNMP 参数
(选答)到远程子网的静态路由可访问管理端口
(选答)到可访问管理端口的远程前缀的静态路由
EX4100-F 交换机随附的 Junos OS 预装在交换机开机时即可进行配置。您必须使用 CLI 通过交换机后面板上的控制台端口(标记为 CON)执行交换机的初始配置。
此过程介绍如何在交换机上执行初始配置并将其连接到网络。有关启用交换机转发流量的完整信息(包括示例),请参阅 Junos OS 配置指南。
要在交换机上执行初始配置并将其连接到网络,请执行以下作:
您现在可以使用 CLI 登录并继续配置交换机。
在 EX 系列交换机上恢复到默认出厂配置
使用 EX 系列交换机,如果由于任何原因当前活动配置出现问题,可恢复为出厂默认配置。
您还可以回滚到之前的配置(如 回滚 Junos OS 配置更改中所述),或恢复为挽救配置(如 恢复为 EX 系列交换机的挽救配置中所述)。
如果丢失 root 密码,则没有必要恢复到出厂默认配置来进行重置。请参阅 恢复交换机上的 root 密码。
出厂默认配置包含交换机的基本配置设置。这是交换机的第一个配置,在交换机首次开机时加载。有关交换机的出厂默认配置文件,请参阅交换机的硬件文档。
在固定配置交换机上,您可以运行 EZsetup 脚本在恢复到出厂默认配置之后完成初始配置。(EZsetup 脚本在模块化交换机上不可用。要配置模块化交换机,请使用 CLI 或 J-Web 界面。)有关使用 CLI 或 J-Web 界面完成初始配置的信息,请参阅连接和配置 EX 系列交换机(CLI 过程)或连接和配置 EX 系列交换机(J-Web 过程)。
您可以使用 operational 命令或 load factory-default configuration 命令恢复到出厂默认配置文件request system zeroize,其中包含除 root 密码设置外的所有默认设置,root 密码设置将保留。
以下部分中介绍了这些过程:
通过 CLI 或出厂重置/端口模式按钮重置出厂默认配置后,不会重置设备的先前主机名。只能通过配置新主机名或重新启动设备来更改主机名。
- 使用 request system zeroize 命令恢复到 EX 系列交换机的出厂默认配置
- 使用 load factory-default 命令恢复到 EX 系列交换机的出厂默认配置
- 使用出厂重置/端口模式按钮恢复到出厂默认配置
使用以下命令恢复 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 密码设置除外)。默认情况下,不设置 root 密码;在此过程中,您必须将其设置为提交新配置。
在恢复到出厂默认配置之后,如果想要运行 EZsetup 脚本来完成交换机的初始配置,请勿使用该 load factory-default 命令。而要使用命令进行 request system zeroize 恢复。如果使用命令 load factory-default 恢复到出厂默认配置,root 密码配置将保留,并且 EZsetup 脚本将不会运行。(EZsetup 脚本仅适用于固定配置交换机,不适用于模块化交换机。)
在虚拟机箱中配置的 EX3300、EX4200、EX4500 和 EX4550 交换机上,该 load factory-default 命令本身不受支持。
要使用以下 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 的剩余设置。 - 使用命令
show virtual-chassis vc-port检查 VCP 的其余设置。
使用出厂重置/端口模式按钮恢复到出厂默认配置
要将交换机设置到出厂默认配置,请使用位于前面板最右端的出厂重置/模式按钮。
要将虚拟机箱的成员交换机恢复到出厂默认配置,请断开连接到虚拟机箱端口 (VCP) 的电缆。断开电缆以防止对其他成员上的虚拟机箱配置参数(例如成员 ID、主角色优先级和 VCP 上行链路的设置)产生任何影响(请参阅 断开光纤电缆)。
要使用出厂重置/模式按钮恢复到出厂默认配置:
默认情况下,出厂重置/模式按钮处于启用状态。您可以使用 CLI 禁用该按钮。
要禁用出厂重置/模式按钮,请运行以下命令:
-
[编辑] user@switch#
set chassis config-button no-clear -
[编辑] user@switch#
commit
要启用出厂重置/模式按钮,请运行以下命令:
-
[编辑] user@switch#
delete chassis config-button no-clear -
[编辑] user@switch#
commit