cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2433
Views
0
Helpful
3
Replies

TCL script for traceroute

pravin.sridhur
Level 1
Level 1

Hi Folks, 

  I'm looking for a script that can run traceroutes to multiple IP addresses. I could only find script for ping which works absolutely fine, but need one for trace. Any help will be much appreciated.

Thanks

Prav

3 Replies 3

Mark Malone
VIP Alumni
VIP Alumni

Hi

This is how you do it , make sure brackets are correct  as below or it will fail , I just tested this on my vss it works fine for traces

RouterA(tcl)#foreach address {
+>172.21.33.254
+>172.21.3.254
+>172.21.199.254
+>} { traceroute $address
+>}

Hi Mark,

 Thanks for your response. Sorry I should've made it clear, the problem I have is with extended traceroute on a specific platforms such as 3750 4500 etc, i.e when you want to use a source address. I came across just one post online which dint work

So I'm looking for something like this which works on most platforms just fine but not on 3750 and most of our distribution/edge devices are 3750/4500

foreach address {
10.10.60.3
10.11.40.2
10.12.20.3} {traceroute $address source <source ip> 
}

Also would you know how to redirect a tcl script output to a file.

so I should be able to say this

router#tclsh ping.tcl

and all the output should be stored to a different file in flash.

Thanks

Prav

Hi

I have never saved to flash this doc shows how  so cant offer much there but the doc may explain it----https://mellowd.co.uk/ccie/?p=2583

 but this is how you do trace from source ip just tested it working  

xxxxxxx(tcl)#foreach i {
+>172.21.3.254
+>172.21.3.254
+>172.21.33.254
+>} { traceroute $i source 172.21.229.65 }