1
0
Fork 0
mirror of https://gitlab.com/netravnen/NetworkLabNotes.git synced 2024-12-23 20:57:53 +00:00

Added script to reset vlan configuration with

This commit is contained in:
chhan11 2017-05-22 13:38:59 +02:00
parent c091d25bca
commit 539bf0caf3
2 changed files with 24 additions and 0 deletions

View 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

View 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