โดยดัดแปลงจาก internetworkexpert
router#tclsh
router(tcl)#
set l [llength [ exec "sh ip int brie | e down|unassig|Status" ]]
set x [ exec "sh ip int brie | e down|unassig|Status" ]
foreach dst {
150.1.1.1
150.1.2.2
} {
set c 0
puts "##########################################"
while {$c<=$l} {
set src [lindex $x $c]
if { [regexp "(^\[0-9]+\.\[0-9]+\.\[0-9]+\.\[0-9]+)" $src] } {
puts "========================================"
puts "ping ip $dst source $src repeat 3"
puts ["ping ip $dst source $src repeat 3"]
}
incr c
}
}
Wednesday, June 6, 2007
[Cisco] TCL script สำหรับ ping ระบุ source จาก ip ทุกๆ interface
Subscribe to:
Posts (Atom)