1
0
Fork 0
mirror of https://gitlab.com/netravnen/NetworkLabNotes.git synced 2024-12-17 20:37:55 +00:00
NetworkLabNotes/code/l3switch/resetvlans-tcl.txt

13 lines
328 B
Plaintext
Raw Normal View History

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