djohnson104
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.
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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"
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"
ASKER
Not an actual script but it allowed me to write my own.
http://coding.derkeiler.com/Archive/Tcl/comp.lang.tcl/2006-06/msg00094.html
Refer another example here.
Cheers,
Rajesh