1
0
Fork 0
mirror of https://gitlab.com/netravnen/NetworkLabNotes.git synced 2024-11-11 18:39:40 +00:00
NetworkLabNotes/code/l3switch/resetvlans-tcl.txt

13 lines
328 B
Plaintext

tclsh
puts [ open "flash:resetvlans.tcl" w+ ] {
foreach vlanItem [regexp -all -line -inline "^\[0-9\]+" [exec "show vlan brief"]] {
if { ($vlanItem == 1) || (($vlanItem >= 1002) && ($vlanItem <= 1005)) } {
puts "Skipping VLAN $vlanItem"
} else {
puts "Removing VLAN $vlanItem"
ios_config "no vlan $vlanItem"
}
}
}
tclquit