cancel
Showing results for 
Search instead for 
Did you mean: 

Script to find untagged Vlan and what port it's on.

Script to find untagged Vlan and what port it's on.

Justsomebodi
New Contributor III
Hi peeps

I was given this script by the kind guys at Extreme, but i now want to modify it to find untagged Vlans and which port they are on so i can feed it into a limit-learning command.

My scripting knowledge is very basic so was wondering if there is any scripty guys out there that could give me a few pointers.

#This script updates the interval on eljrp-client sessions
# set the variable below
#This only works on EXOS 16.1 forward
set var int 3
disable clip
show elrp
set var CLI.OUT 0
show elrp
set var s $TCL(split ${CLI.OUT} "\n")
set var i $TCL(lsearch $s *----*)
set var i ($i + 1)
set var e $TCL(lsearch $s *Print,*)
set var e ($e - 1)
while ($i < $e) do
set var l $TCL(lindex $s $i)
set var v $TCL(lindex $l 1)
set var p $TCL(lindex $l 2)
set var n $TCL(lindex $l 3)
set var a $TCL(lindex $l 😎
set var d $TCL(lindex $l 9)
set var t $TCL(regexp {\-} $d)
set var t1 $TCL(regexp {L} $a)
set var t2 $TCL(regexp {T} $a)
set var t3 $TCL(regexp {E} $a)
set var t4 $TCL(regexp {I} $a)
set var t5 $TCL(expr $t1 && $t2)
set var lt "log"
set var ie ''
if ($t2) then
set var lt "trap"
endif
if ($t5) then
set var lt "log-and-trap"
endif
if ($t3) then
set var ie "egress"
endif
if ($t4) then
set var ie "ingress"
endif
set var recmd $TCL(concat "config elrp-client periodic" $v "ports" $p "interval" $int $lt)
if (!$t) then
set var recmd $TCL(concat $recmd "disable-port" $ie)
set var t $TCL(regexp {\d+} $d)
if ($t) then
set var d $TCL(concat "duration" $d)
endif
set var recmd $TCL(concat $recmd $d)
endif
unconfig elrp $v
$recmd
set var i ($i + 1)
endwhile

Any pointers would be gratelly appreciated.
1 REPLY 1

Joseph_Burnswor
New Contributor III
I know in 16.x i use grep to find what I need on most things

show config vlan | grep

Doing the above command will show you the VLAN you are looking for and will also show you them both tagged and untagged
GTM-P2G8KFN