Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Navigation

Interface Ranges

Note: This task uses Junos OS for EX Series switches that does not support the Enhanced Layer 2 Software (ELS) configuration style. If your switch runs software that supports ELS, see Interface Ranges. For ELS details, see Getting Started with Enhanced Layer 2 Software.

The Junos OS allows you to group a range of identical interfaces into an interface range. You first specify the group of identical interfaces in the interface range. Then you can apply a common configuration to the specified interface range, reducing the number of configuration statements required and saving time while producing a compact configuration.

Configuring Interface Ranges

To configure an interface range, include the interface-range statement at the [edit interfaces] hierarchy level.

The interface-range statement accepts only physical networking interface names in its definition. The following interface types are supported and example CLI descriptors are shown:

  • ATM—at-fpc/pic/port
  • Channelized—(coc | cstm)n-fpc/pic/port
  • DPC—xe-fpc/pic/port
  • E1/E3—(e1 | e3)-fpc/pic/port
  • Ethernet—(xe | ge | fe)-fpc/pic/port
  • ISDN—isdn-fpc/pic/port
  • Serial—se-fpc/pic/port
  • SONET/SDH—so-fpc/pic/port
  • T1/T3—(t1 | t3)-fpc/pic/port

Interfaces can be grouped either as a range of interfaces or using a number range under the interface-range statement definition.

Interfaces in an interface-range definition can be added as part of a member range or as individual members or multiple members using a number range.

To specify a member range, use the member-range statement at the [edit interfaces interface-range name] hierarchy level.

To specify interfaces in lexical order, use the member-range start-range to end-range statement.

A range for a member statement should contain the following:

  • *—All, specifies sequential interfaces from 0 through 47.

    Caution: The wildcard * in a member statement does not take into account the interface numbers supported by a specific interface type. Irrespective of the interface type, * includes interface numbers ranging from 0 through 47 to the interface group. Therefore, use * in a member statement with caution.

  • num—Number, specifies one specific interface by its number.
  • [low-high]—Numbers between low to high, specifies a range of sequential interfaces.
  • [num1, num2, num3]—Numbers num1, num2, and num3 specify multiple specific interfaces.

Example: Specifying an Interface Range Member Range

member-range ge-0/0/0 to ge-4/0/40;

To specify one or multiple members, use the member statement at the [edit interfaces interface-range name] hierarchy level.

To specify the list of interface range members individually or for multiple interfaces using regex, use the member list of interface names statement.

Example: Specifying an Interface Range Member

member ge-0/0/0;member ge-0/*/*member ge-0/[1-10]/0;member ge-0/[1,2,3]/3;

Regex or wildcards are not supported for interface-type prefixes. For example, prefixes ge, fe, and xe must be mentioned explicitly.

An interface-range definition can contain both member and member-range statements within it. There is no maximum limit on the number of member or member-range statements within an interface-range. However, at least one member or member-range statement must exist within an interface-range definition.

Example: Interface Range Common Configuration

Configuration common to an interface range can be added as a part of the interface-range definition, as follows:

[edit]
interfaces {+ interface-range foo {+ member-range ge-1/0/0 to ge-4/0/40;+ member ge-0/1/1;+ member ge-5/[1-10]/*;/*Common configuration is added as part of interface-range definition*/mtu 256;hold-time up 10;ether-options {flow-control;speed {100m;}802.3ad primary;}}}

An interface-range definition having just member or member-range statements and no common configurations statements is valid.

These defined interface ranges can be used in other configuration hierarchies, in places where an interface node exists.

Example: Interface-Range foo Used Under the Protocols Hierarchy

protocols {dot1x {authenticator {interface foo{retries 1;}}}}

foo should be an interface-range defined at the [interfaces] hierarchy level. In the above example, the interface node can accept both individual interfaces and interface ranges.

Tip: To view an interface range in expanded configuration, use the (show | display inheritance) command. For more information, see the CLI User Guide.

By default, interface-range is not available to configure in the CLI where the interface statement is available. The following locations are supported; however, some of the hierarchies shown in this list are product specific:

  • protocols dot1x authentication interface
  • protocols dvmrp interface
  • protocols oam ethernet lmi interface
  • protocols esis interface
  • protocols igmp interface
  • protocols igmp-host client num interface
  • protocols mld-host client num interface
  • protocols router-advertisement interface
  • protocols isis interface
  • protocols ldp interface
  • protocols oam ethernet link-fault-management interface
  • protocols lldp interface
  • protocols link-management peer lmp-control-channel interface
  • protocols link-management peer control-channel
  • protocols link-management te-link name interface
  • protocols mld interface
  • protocols ospf area id interface
  • protocols pim interface
  • protocols router-discovery interface
  • protocols rip group name neighbour
  • protocols ripng group name neighbour
  • protocols rsvp interface
  • protocols snmp interface
  • protocols layer2-control bpdu-block interface
  • protocols layer2-control mac-rewrite interface
  • protocols mpls interface
  • protocols stp interface
  • protocols rstp interface
  • protocols mstp interface
  • protocols vstp interface
  • protocols mstp msti id interface
  • protocols mstp msti vlan id interface
  • protocols vstp vlan name interface
  • protocols gvrp interface
  • protocols igmp-snooping vlan name interface
  • protocols lldp interface
  • protocols lldp-med interface
  • protocols sflow interfaces
  • ethernet-switching-options analyzer name input [egress | ingress ] interface
  • ethernet-switching-options analyzer name output interface
  • ethernet-switching-options secure-access-port interface
  • ethernet-switching-options interfaces ethernet-switching-options voip interface
  • ethernet-switching-options redundant-trunk-group group g1 interface
  • ethernet-switching-options redundant-trunk-group group g1 interface
  • ethernet-switching-options bpdu-block interface
  • poe interface vlans pro-bng-mc1-bsd1 interface

Expanding Interface Range Member and Member Range Statements

All member and member-range statements in an interface range definition are expanded to generate the final list of interface names for the specified interface range.

Example: Expanding Interface Range Member and Member Range Statements

[edit]interfaces {interface-range range-1 {member-range ge-0/0/0 to ge-4/0/20;member ge-10/1/1;member ge-5/[0-5]/*;/*Common configuration is added part of the interface-range definition*/mtu 256;hold-time up 10;ether-options {flow-control;speed {100m;}802.3ad primary;}}}

For the member-range statement, all possible interfaces between start-range and end-range are considered in expanding the members. For example, the following member-range statement:

member-range ge-0/0/0 to ge-4/0/20

expands to:

      [ge-0/0/0, ge-0/0/1 ... ge-0/0/max_ports
       ge-0/1/0  ge-0/1/1 ... ge-0/1/max_ports
       ge-0/2/0  ge-0/2/1 ... ge-0/2/max_ports
                           .
                           .
       ge-0/MAX_PICS/0 ... ge-0/max_pics/max_ports
       ge-1/0/0  ge-1/0/1 ... ge-1/0/max_ports
                           .
       ge-1/MAX_PICS/0 ... ge-1/max_pics/max_ports
                           .
                           .
       ge-4/0/0 ge-4/0/1  ... ge-4/0/max_ports]

The following member statement:

ge-5/[0-5]/*

expands to:

      ge-5/0/0 ... ge-5/0/max_ports
      ge-5/1/0 ... ge-5/0/max_ports
          .
           .
      ge-5/5/0 ... ge-5/5/max_ports

The following member statement:

ge-5/1/[2,3,6,10]

expands to:

      ge-5/1/2
      ge-5/1/3
      ge-5/1/6
      ge-5/1/10

Configuration Inheritance for Member Interfaces

When Junos OS expands the member and member-range statements present in an interface-range, it creates interface objects if they are not explicitly defined in the configuration. The common configuration is copied to all its member interfaces in the interface-range.

Example: Configuration Priorities

Foreground interface configuration takes priority over configuration inherited by the interface through the interface-range.

interfaces {interface-range range-1 {member-range ge-1/0/0/ to ge-10/0/47;mtu 256;}ge-1/0/1 {mtu 1024;}}

In the preceding example, interface ge-1/0/1 will have an MTU value of 1024.

This can be verified with output of the show interfaces | display inheritance command, as follows:

user@host: # show interfaces | display inheritance
## 'ge-1/0/0' was expanded from interface-range 'range-1'
##
ge-1/0/0 {
    ##
    ## '256' was expanded from interface-range 'range-1'
    ##
    mtu 256;
}
ge-1/0/1 {
    mtu 1024;
}
##
## 'ge-1/0/2' was expanded from interface-range 'range-1'
##
ge-1/0/2 {
    ##
    ## '256' was expanded from interface-range 'range-1'
    ##
    mtu 256;
}
      .........
      .........
##
## 'ge-10/0/47' was expanded from interface-range 'range-1'
## 
ge-10/0/47 {
    ##
    ## '256' was expanded from interface-range 'range-1'
    ##
    mtu 256;
}

Member Interfaces Inheriting Configuration from Configuration Groups

Interface range member interfaces inherit the config-groups configuration like any other foreground configuration. interface-range is similar to any other foreground configuration statement. The only difference is that the interface-range goes through a member interfaces expansion before Junos OS reads this configuration.

groups {global {interfaces {<*> {hold-time up 10;}}}apply-groups [global];interfaces {interface-range range-1 {member-range ge-1/0/0 to ge-10/0/47;mtu 256;}}}

The hold-time configuration is applied to all members of interface-range range-1.

This can be verified with show interfaces | display inheritance as follows:

user@host# show interfaces | display inheritance
ge-1/0/0 {
    ##
    ## '256' was expanded from interface-range 'range-1'
    ##
    mtu 256;
    ##
    ## 'hold-time' was inherited from group 'global'
    ## '10' was inherited from group 'global'
    ##
    hold-time up 10;
}
ge-1/0/1 {
    ##
    ## '256' was expanded from interface-range 'range-1'
    ##
    mtu 256;
    ##
    ## 'hold-time' was inherited from group 'global'
    ## '10' was inherited from group 'global'
    ##
    hold-time up 10;
}
ge-10/0/47 {
    ##
    ## '256' was expanded from interface-range 'range-1'
    ##
    mtu 256;
    ##
    ## 'hold-time' was inherited from group 'global'
    ## '10' was inherited from group 'global'
    ##
    hold-time up 10;
}

Interfaces Inheriting Common Configuration

If an interface is a member of several interface ranges, that interface will inherit the common configuration from all of those interface ranges.

[edit]
interfaces {interface-range range-1 {member-range ge-1/0/0 to ge-10/0/47;mtu 256;}}interfaces {interface-range range-1 {member-range ge-10/0/0 to ge-10/0/47;hold-time up 10;}}

In this example, interfaces ge-10/0/0 through ge-10/0/47 will have both hold-time and mtu.

Configuring Inheritance Range Priorities

The interface ranges are defined in the order of inheritance priority, with the first interface range configuration data taking priority over subsequent interface ranges.

[edit]
interfaces {interface-range int-grp-one {member-range ge-0/0/0 to ge-4/0/40;member ge-1/1/1;/*Common config is added part of the interface-range definition*/mtu 256;hold-time up 10;}}interfaces {interface-range int-grp-two {member-range ge-5/0/0 to ge-10/0/40;member ge-1/1/1;mtu 1024;}}

Interface ge-1/1/1 exists in both interface-range int-grp-one and interface-range int-grp-two. This interface inherits mtu 256 from interface-range int-grp-one because it was defined first.

Configuration Expansion Where Interface Range Is Used

In this example, interface-range range-1 is used under the protocols hierarchy:

[edit]
interfaces {interface-range range-1 {member ge-10/1/1;member ge-5/5/1;mtu 256;hold-time up 10;ether-options {flow-control;speed {100m;}802.3ad primary;}}protocols {dot1x {authenticator {interface range-1 {retries 1;}}}}}

The interface node present under authenticator is expanded into member interfaces of the interface-range range-1 as follows:

protocols {dot1x {authenticator {interface ge-10/1/1 {retries 1;}interface ge-5/5/1 {retries 1;}}}}

The interface range-1 statement is expanded into two interfaces, ge-10/1/1 and ge-5/5/1, and configuration retries 1 is copied under those two interfaces.

This configuration can be verified using the show protocols dot1x | display inheritance command.

 

Related Documentation

 

Published: 2014-04-23

 

Related Documentation

 

Published: 2014-04-23