Interface Ranges for Physical Interfaces
Junos OS Evolved enables 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. Interface ranges reduce the number of configuration statements required. They save time and produce a compact configuration.
Configure Interface Ranges
To configure an interface range, use the
interface-range
statement at the [edit
interfaces]
hierarchy level. The interface-range
statement accepts only physical networking interface names in its definition. Junos
OS Evolved supports interface ranges for Ethernet interfaces:
et-fpc/pic/port
.
To configure an interface range:
-
Use the
interface-range
statement at the[edit interfaces]
hierarchy level. Include the name you have chosen for your interface range.[edit] user@device# edit interfaces interface-range range-name
For example, to configure an interface range named "range1":
[edit] user@device# edit interfaces interface-range range1
-
To specify a member range, use the
member-range start-range to end-range
statement at the[edit interfaces interface-range range-name]
hierarchy level. For example:[edit interfaces interface-range range1] user@device# set member-range et-1/0/0 to et-4/0/40
- To specify an individual member, use the
member
statement at the[edit interfaces interface-range range-name]
hierarchy level. For example:[edit interfaces interface-range range1] user@device# set member et-0/0/0
- You can specify a list of interface range members using regular expressions
with the
member range of interface names
statement. A range for a member statement can 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 from low to high. Specifies a range of sequential interfaces. -
[num1, num2, num3]
—Numbersnum1
,num2
, andnum3
specify multiple specific interfaces.
Regular expressions and wildcards are not supported for interface-type prefixes. For example, prefixes
et
andxe
must be mentioned explicitly.For example:
[edit interfaces interface-range range1] user@device# set member et-0/*/* set member et-0/[1-10]/0 set member et-0/[1,2,3]/3
-
An interface-range
definition can contain both
member
and member-range
statements within it.
There is no limit on the number of member
or
member-range
statements within an
interface-range
definition. However, at least one
member
or member-range
statement must exist
within an interface-range
definition.
An interface-range
definition having just member
or
member-range
statements and no common configuration statement
is valid. However, you can optionally add a common configuration statement to an
interface range as a part of the interface-range
definition. For
example:
[edit] interfaces { + interface-range range1 { + member-range et-1/0/0 to et-4/0/40; + member et-0/0/0; + member et-0/*/*; + member et-0/[1-10]/0; + member et-0/[1,2,3]/3; /*Common configuration is added as part of interface-range definition*/ mtu 500; ether-options { flow-control; speed { 100m; } 802.3ad primary; } } }
These defined interface ranges can be used in other configuration hierarchies in
places where an interface
node exists. For example:
protocols { dot1x { authenticator { interface range1 { retries 1; } } } }
In the preceding example, the interface
node can accept both
individual interfaces and interface ranges.
To view an interface range in expanded configuration, use the (show |
display inheritance)
command.
Expanded Interface Range Statements
The operating system expands all member
and member-range
statements in an interface range definition to generate the final list of interface
names for the specified interface range.
An example configuration looks like this before it is expanded:
[edit] interfaces { interface-range range1 { member-range et-0/0/0 to et-4/0/20; member et-10/1/1; member et-5/[0-5]/*; /*Common configuration is added as 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 et-0/0/0 to et-4/0/20
expands to:
[et-0/0/0, et-0/0/1 ... et-0/0/max_ports et-0/1/0 et-0/1/1 ... et-0/1/max_ports et-0/2/0 et-0/2/1 ... et-0/2/max_ports . . et-0/MAX_PICS/0 ... et-0/max_pics/max_ports et-1/0/0 et-1/0/1 ... et-1/0/max_ports . et-1/MAX_PICS/0 ... et-1/max_pics/max_ports . . et-4/0/0 et-4/0/1 ... et-4/0/max_ports]
The following member
statement:
et-5/[0-5]/*
expands to:
et-5/0/0 ... et-5/0/max_ports et-5/1/0 ... et-5/0/max_ports . . et-5/5/0 ... et-5/5/max_ports
The following member
statement:
et-5/1/[2,3,6,10]
expands to:
et-5/1/2 et-5/1/3 et-5/1/6 et-5/1/10
Configuration Inheritance Priority
The interface ranges are defined in the order of inheritance priority. The first interface range configuration data takes priority over subsequent interface ranges.
In this example, interface et-1/1/1
exists in both interface range
int-grp-one
and interface range
int-grp-two
:
[edit] interfaces { interface-range int-grp-one { member-range et-0/0/0 to et-4/0/47; member et-1/1/1; /*Common config is added part of the interface-range definition*/ mtu 500; hold-time up 10; } interface-range int-grp-two { member-range et-5/0/0 to et-7/0/47; member et-1/1/1; mtu 1024; } }
Interface et-1/1/1
inherits mtu 500
from
interface range int-grp-one
because it was defined first.
Configuration Inheritance for Member Interfaces
When Junos OS Evolved 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 operating system copies the
common configuration to all the interface range's member interfaces.
Foreground interface configuration takes priority over configuration that the interface inherits from the interface range configuration.
In this example, interface et-1/0/1
has an MTU value of 1024 because
that is its foreground configuration:
interfaces { interface-range range1 { member-range et-1/0/0 to et-7/0/47; mtu 500; } et-1/0/1 { mtu 1024; } }
You can verify this in the output of the show interfaces | display inheritance
command:
user@host: show interfaces | display inheritance ## ## 'et-1/0/0' was expanded from interface-range 'range1' ## et-1/0/0 { ## ## '500' was expanded from interface-range 'range1' ## mtu 500; } et-1/0/1 { mtu 1024; } ## ## 'et-1/0/2' was expanded from interface-range 'range1' ## et-1/0/2 { ## ## '500' was expanded from interface-range 'range1' ## mtu 500; } ......... ......... ## ## 'et-10/0/47' was expanded from interface-range 'range1' ## et-10/0/47 { ## ## '500' was expanded from interface-range 'range1' ## mtu 500; }
Common Configuration Inheritance
If an interface is a member of multiple interface ranges, that interface will inherit the common configuration from all of those interface ranges.
For example:
[edit] interfaces { interface-range int-grp-one { member-range et-0/0/0 to et-4/0/40; mtu 256; } interface-range int-grp-two { member-range et-4/0/0 to et-4/0/40; hold-time up 10; } }
In this example, interfaces et-4/0/0
through et-4/0/40
have
both hold-time
and mtu
configured.
Configuration Group Inheritance
Interface range member interfaces inherit configurations from configuration groups like any other
foreground configuration. The only difference is that the
interface-range
goes through a member interfaces expansion
before the operating system reads this configuration.
In this example, Junos OS Evolved applies the
hold-time
configuration to all members of the interface range
range1
:
groups { global { interfaces { <*> { hold-time up 10; } } } } apply-groups [global]; interfaces { interface-range range1 { member-range et-1/0/0 to et-7/0/47; mtu 500; } }
You can verify this with show interfaces | display inheritance
, as follows:
user@host# show interfaces | display inheritance [...] ## ## 'et-1/0/0' was expanded from interface-range 'range1' ## et-1/0/0 { ## ## '500' was expanded from interface-range 'range1' ## mtu 500; ## ## 'hold-time' was inherited from group 'global' ## '10' was inherited from group 'global' ## hold-time up 10; } ## ## 'et-1/0/1' was expanded from interface-range 'range1' ## et-1/0/1 { ## ## '500' was expanded from interface-range 'range1' ## mtu 500; ## ## 'hold-time' was inherited from group 'global' ## '10' was inherited from group 'global' ## hold-time up 10; } ## ## 'et-7/0/47' was expanded from interface-range 'range1' ## et-7/0/47 { ## ## '500' was expanded from interface-range 'range1' ## mtu 500; ## ## 'hold-time' was inherited from group 'global' ## '10' was inherited from group 'global' ## hold-time up 10; }
Configuration Expansion Where Interface Range Is Used
In this example, interface-range range1
is used under the
protocols
hierarchy:
[edit] interfaces { interface-range range1 { member et-7/1/1; member et-5/0/1; mtu 500; hold-time up 10; ether-options { flow-control; speed { 100m; } 802.3ad primary; } } protocols { dot1x { authenticator { interface range1 { retries 1; } } } } }
The interface
node present under authenticator
expands into
member interfaces of the interface range range1
as follows:
protocols { dot1x { authenticator { interface et-7/1/1 { retries 1; } interface et-5/0/1 { retries 1; } } } }
The interface range-1
statement is expanded into two
interfaces, et-7/1/1 and et-5/0/1, and the operating system copies the configuration
retries 1
under those two interfaces.
You can verify this configuration using the show protocols dot1x | display
inheritance
command.