Link to home
Start Free TrialLog in
Avatar of djohnson104
djohnson104Flag for United States of America

asked on

TCL script to write access-list for a Cisco router.

we have a few users in that need to apply a access list on each router. I want to create a TCL script that will write the access-list out and have an input variable for the third octet of the IP in the access-list.
Avatar of rsivanandan
rsivanandan
Flag of India image

I'm by no means a programmer but I think it would be much easier to work with expect scripts than tcl for this.

http://coding.derkeiler.com/Archive/Tcl/comp.lang.tcl/2006-06/msg00094.html

Refer another example here.

Cheers,
Rajesh
Avatar of djohnson104

ASKER

These are routers that will have no access to tftp. I need this script to be on a USB drive and ran from within the router. I pretty much have it figured out i just need to put it togather.
ASKER CERTIFIED SOLUTION
Avatar of rsivanandan
rsivanandan
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
saved the following lines bellow as test.tcl and ran tclsh test.tcl from the ios command line.
ios_config "ip route 0.0.0.0 0.0.0.0 cell 0/1/0"
      
ios_config "no ip http server"

ios_config "ip nat inside source list 115 interface cell 0/1/0 overload"
      
ios_config "access-list 1 permit any log"
Not an actual script but it allowed me to write my own.