ā06-13-2019 08:51 AM
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.
ā06-13-2019 10:06 AM
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.
ā06-13-2019 10:11 AM
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?
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide