mirror of
https://gitlab.com/netravnen/NetworkLabNotes.git
synced 2024-11-23 19:17:54 +00:00
Added script to reset vlan configuration with
This commit is contained in:
parent
c091d25bca
commit
539bf0caf3
12
code/l2switch/resetvlans-tcl.txt
Normal file
12
code/l2switch/resetvlans-tcl.txt
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
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
|
12
code/l3switch/resetvlans-tcl.txt
Normal file
12
code/l3switch/resetvlans-tcl.txt
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
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
|
Loading…
Reference in a new issue