在 EX4100 交换机上配置 Junos OS
EX4100 默认配置
每台 EX 系列交换机均设置了出厂默认配置,此配置包含装运交换机时为每个配置参数设置的值。默认配置文件可设置系统参数(如 syslog 和 commit)的值,用于配置所有接口上的以太网交换,启用 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 交换机
连接和配置 EX4100 交换机之前,请在控制台服务器或 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 交换机随附时已预装 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 过程)。
您可以使用 request system zeroize 操作命令或 load factory-default 配置命令恢复到出厂默认配置,以恢复为出厂默认配置,其中包含除 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 脚本仅适用于固定配置交换机,不适用于模块化交换机。)
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 和主要角色优先级,然后使用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