cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1610
Views
0
Helpful
2
Replies

TCL script for traceroute with source IP address - 3750v2

Jaca
Level 1
Level 1

Trying to create a TCL script to run a traceroute from a specific IP address on Cisco 3750v2; Software Version: 12.2(55)SE8; Software Image: C3750-IPBASEK9-M

 

I'd like to be able to run the script to traceroute to a certain IP outside of the network from a SVI IP address located on the switch. At this time I just need one external IP to traceroute to. Running the script without ~ source 2.2.2.2 ~ works fine.  

 

Current code:

tclsh
!
foreach IP {
1.1.1.1
} { traceroute $IP source 2.2.2.2 }

 

This script returns: 

invalid command name "traceroute" ^
% Invalid input detected at '^' marker.

 

2.2.2.2 is SVI on device. 

 

This same script works with Ping without issue:

 

foreach IP {
1.1.1.1

3.3.3.3

4.4.4.4
} { ping $IP source 2.2.2.2 repeat 10 }
!

 

Any assistance would be appreciated. 

 

 

2 Replies 2

Hi @Jaca,

Does your Catalyst Switch support the

Switch# traceroute 1.1.1.1 source 2.2.2.2

command in IOS CLI?

There are some IOS versions where the source parameter of the traceroute command on Catalyst Switches is not there yet.

Regards.

Thanks for the reply Hector.

Switch#traceroute 1.1.1.1 source 2.2.2.2
^
% Invalid input detected at '^' marker.

 

The switch does not support that command and now explains the error presented with the TCL script I was using.

Any recommendations for a better traceroute TCL script?