From: Brian Dennis (bdennis@internetworkexpert.com)
Date: Fri Jul 14 2006 - 14:31:25 ART
Here are two options:
1) Add the interface to the ping command that is being executed assuming
your IOS supports the source interface option on the command line.
tclsh
foreach ip {
192.168.1.1
192.168.2.1
192.168.10.1 } {ping $ip source lo 0}
2) Use a nested foreach loop:
tclsh
foreach ip {
192.168.1.1
192.168.2.1
192.168.10.1} {foreach int {
lo0 lo1
} {ping $ip source $int}
}
Another option could be to try a local policy but that's getting a
little too complicated.
HTH,
Brian Dennis, CCIE #2210 (R&S/ISP-Dial/Security)
bdennis@internetworkexpert.com
Internetwork Expert, Inc.
http://www.InternetworkExpert.com
Toll Free: 877-224-8987
Direct: 775-745-6404 (Outside the US and Canada)
-----Original Message-----
From: nobody@groupstudy.com [mailto:nobody@groupstudy.com] On Behalf Of
Vazman
Sent: Friday, July 14, 2006 2:05 AM
To: Prakash Sosle R; Cisco certification
Subject: Re: Sample TCL script
Is there a way to specify different source IP's in the script?
Thanks.
On 7/14/06, Prakash Sosle R <psosle@gmail.com> wrote:
>
> HI,
>
> I am sure you will have plenty of scripts in the GS archives ,
> the one I used in my exam was :
>
> tclsh foreach pl{
> 192.168.1.1
> 192.168.2.1
> 192.168.10.1 } {ping $pl}
>
>
> Cheers !
>
> Prakash R
> ccie# 16471
>
>
> On 7/14/06, Vazman <vazman@gmail.com> wrote:
> >
> > Can someone please post a sample TCL script to ping a few addresses
> > from different source addresses. I have one but its not working on
12.3T.
> >
> > Thanks.
> >
> > ____________________________________________________________________
> > ___ Subscription information may be found at:
> > http://www.groupstudy.com/list/CCIELab.html
This archive was generated by hypermail 2.1.4 : Tue Aug 01 2006 - 07:13:47 ART