Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

物理接口的接口范围

Junos OS 允许您将一系列相同的接口分组到一个 接口范围中。首先指定接口范围内的相同接口组。然后,您可以将通用配置应用于指定的接口范围。接口范围减少了所需的配置语句数量。既节省时间又能实现紧凑的配置

注意:

此任务将 Junos OS 用于不支持增强型第 2 层软件 (ELS) 配置样式的设备。如果您的设备运行的 Junos OS 版本支持 ELS,请参阅为 带有 ELS 的 EX 系列交换机配置接口范围。有关 ELS 的详细信息,请参阅 使用增强型第 2 层软件 CLI

配置接口范围

要配置接口范围,请在层次结构级别使用interface-range[edit interfaces]该语句。该interface-range语句在其定义中仅接受物理网络接口名称。Junos OS 支持以下接口类型的接口范围:

  • ATM: at-fpc/pic/port

  • 通道化: (coc | cstm)n-fpc/pic/port

  • DPC: xe-fpc/pic/port

  • E1/E3: (e1 | e3)-fpc/pic/port

  • 以太网: (xe | ge | fe)-fpc/pic/port

  • ISDN: isdn-fpc/pic/port

  • 型号: se-fpc/pic/port

  • SONET/SDH: so-fpc/pic/port

  • T1/T3: (t1 | t3)-fpc/pic/port

要配置接口范围:

  1. 在层次结构级别使用[edit interfaces]interface-range语句。包括您为接口范围选择的名称。

    例如,要配置名为“range1”的接口范围:

  2. 要指定成员范围,请在层次结构级别使用[edit interfaces interface-range range-name]member-range start-range to end-range语句。例如:

  3. 要指定单个成员,请在层次结构级别使用[edit interfaces interface-range range-name]member语句。例如:
  4. 您可以使用带有语句的 member range of interface names 正则表达式来指定接口范围成员的列表。成员语句的范围可以包含以下内容:
    • *——全部。指定从 0 到 47 的顺序接口。

      注意:

      成员语句中的通配符 * 不会考虑特定接口类型支持的接口编号。无论接口类型如何, * 接口组都包括从 0 到 47 的接口编号。因此,在成员声明中使用时要 * 谨慎。

    • num—编号。按接口编号指定一个特定接口。

    • [low-high]- 从低到高的数字。指定顺序接口的范围。

    • [num1, num2, num3]— 编号 num1num2num3 指定多个特定接口。

    接口类型前缀不支持正则表达式和通配符。例如,必须显式提及前缀etxe

    例如:

interface-range定义中可以同时member包含 and member-range 语句。定义中的 interface-rangemember-range 语句的数量member没有限制。但是,定义中interface-range必须至少存在一个 member or member-range 语句。

interface-range 具有 member or member-range 语句且没有通用配置语句的定义是有效的。但是,您可以选择将通用配置语句作为定义的一部分 interface-range 添加到接口范围。例如:

这些定义的接口范围可在节点所在位置 interface 的其他配置层次结构中使用。例如:

在前面的示例中, interface 节点可以接受单个接口和接口范围。

提示:

要查看扩展配置中的接口范围,请使用命令 (show | display inheritance)

支持的层次结构

默认情况下, interface-range 无法在提供语句的 interface CLI 中配置。支持以下位置。但是,此列表中显示的某些层次结构特定于产品:

  • ethernet-switching-options analyzer name input [egress | ingress ] interface

  • ethernet-switching-options analyzer name output interface

  • ethernet-switching-options bpdu-block interface

  • ethernet-switching-options interfaces ethernet-switching-options voip interface

  • ethernet-switching-options redundant-trunk-group group g1 interface

  • ethernet-switching-options secure-access-port interface

  • poe interface vlans pro-bng-mc1-bsd1 interface

  • protocols dot1x authentication interface

  • protocols dvmrp interface

  • protocols esis interface

  • protocols gvrp interface

  • protocols igmp interface

  • protocols igmp-snooping vlan name interface

  • protocols igmp-host client num interface

  • protocols isis interface

  • protocols layer2-control bpdu-block interface

  • protocols layer2-control mac-rewrite interface

  • protocols ldp interface

  • protocols link-management peer control-channel

  • protocols link-management peer lmp-control-channel interface

  • protocols link-management te-link name interface

  • protocols lldp interface

  • protocols lldp-med interface

  • protocols mld interface

  • protocols mld-host client num interface

  • protocols mpls interface

  • protocols mstp interface

  • protocols mstp msti id interface

  • protocols mstp msti vlan id interface

  • protocols oam ethernet link-fault-management interface

  • protocols oam ethernet lmi interface

  • protocols ospf area id interface

  • protocols pim interface

  • protocols rip group name neighbour

  • protocols ripng group name neighbour

  • protocols router-advertisement interface

  • protocols router-discovery interface

  • protocols rstp interface

  • protocols rsvp interface

  • protocols sflow interfaces

  • protocols snmp interface

  • protocols stp interface

  • protocols vstp interface

  • protocols vstp vlan name interface

扩展接口范围语句

OS 展开 member 接口范围定义中的所有和 member-range 语句,以生成指定接口范围的最终接口名称列表。

在展开之前,示例配置如下所示:

对于语member-range句,在扩展成员时,都会考虑 和 end-range 之间start-range所有可能的接口。例如,以下member-range语句:

扩展为:

以下 member 语句:

扩展为:

以下 member 语句:

扩展为:

配置继承优先级

接口范围按继承优先级的顺序定义。第一个接口范围配置数据优先于后续接口范围。

在此示例中,接口 et-1/1/1 同时存在于接口范围 int-grp-one 和接口范围内 int-grp-two

接口继承自mtu 500接口范围et-1/1/1int-grp-one,因为它是首先定义的。

成员接口的配置继承

Junos OS 展开 member 中存在interface-range的 and member-range 语句时,如果配置中未明确定义这些语句,则会创建接口对象。操作系统会将通用配置复制到接口范围的所有成员接口。

前台接口配置优先于接口从接口范围配置继承的配置。

在此示例中,接口 et-1/0/1 的 MTU 值为 1024,因为这是其前台配置:

您可以在命令的 show interfaces | display inheritance 输出中验证这一点:

通用配置继承

如果接口是多个接口范围的成员,则该接口将继承所有这些接口范围的通用配置。

例如:

在此示例中,直通接口同时et-4/0/0配置了 hold-timemtu configured。et-4/0/40

配置组继承

接口范围成员接口像任何其他前台配置一样,从配置组继承配置。唯一的区别是,在 OS 读取此配置之前,它 interface-range 会经历成员接口扩展。

在此示例中, Junos OShold-time 配置应用于接口范围 range1的所有成员:

使用进行 show interfaces | display inheritance验证,如下所示:

使用接口范围的配置扩展

在此示例中, interface-range range1 用于层次结构下 protocols

interface下面的authenticator节点展开为接口范围range1的成员接口,如下所示:

interface range-1 语句扩展为两个接口,et-7/1/1 和 et-5/0/1,操作系统将 retries 1 配置复制到这两个接口下。

您可以使用以下 show protocols dot1x | display inheritance 命令验证此配置。