You can use a simple configlet to allow multiple selected physical interfaces to be disabled or enabled.
Similar to the Add Lag Member configlet, this configlet supports multiple selected interfaces across multiple devices. You can also select whether to have 802.3ah LFM protocol information added when enabling an interface, or remove the associated protocol information when disabling an interface.
The configlet has been written so that you can also call it through the NBI.
NOTE: The NBI doesn’t support an array of interfaces to be processed (unless you implement a workaround), unlike with the GUI where multiple interfaces can be used.
(Although, to overcome this limitation, I’ve updated the configlet so that it will support multiple interfaces through the NBI, but by using the format ge-1/0/0;ge-1/0/1;ge-1/0/2;... . The configlet just processes the string to create an array when called through the NBI, and ignores that step when called through the GUI.)
01
<?
xml
version
=
"1.0"
encoding
"UTF-8"
?><
cli-configlets
>
02
<
cli-configlet
03
<!-- mandatory -->
name
>Interface Physical Deactivation</
04
category
>Ops</
05
context
>/device/interface-information/physical-interface</
06
device-family
>ACX/J/M/MX/T/TX/PTX/EX92xx</
07
description
>Deactivates one or multiple interfaces.</
08
execution-type
>Grouped</
09
preview-show-parameters
>false</
10
preview-show-configuration
>true</
11
postview-show-parameters
12
postview-show-configuration
13
cli-configlet-pages
<!-- At least one configlet page required -->
14
cli-configlet-page
15
page-number
>1</
16
cli-text
>## $INTERFACE is an array when called via GUI but scalar when called via NBI
17
## Convert to an array when not called via GUI
18
## To support multiple interfaces via the NBI, use the format ge-1/0/0;ge-1/0/1;ge-1/0/2;...
19
#if ( !$CONTEXT )
20
#set ( $INTERFACE = $INTERFACE.split(";") )
21
#end
22
interfaces {
23
#foreach ( $INTF in $INTERFACE )
24
$INTF {
25
disable;
26
}
27
28
}</
29
</
30
31
cli-configlet-params
32
33
34
35
>Interface Physical Activation</
36
37
38
39
>Activates one or multiple interfaces.</
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
delete: disable;
58
59
60
61
62
63
64
65
66