TCL Script Example
Router# tclsh
foreach var {
X.X.X.X
Y.Y.Y.Y
Z.Z.Z.Z
} {
ping $var }
! Start the TCL shell
! Begin the foreach loop
! Array element
! action against $var
Setting up an interface
interface <int>
go up when initialized
description ...
interface
ip address <ip> <subnet mask>
including the subnet mask
clock rate <clock>
bandwidth <bw>
computation
no shutdown
! Loopbacks will automatically
! Optional description for the
! The address of the interface,
! Clock rate in Kb/s
! EIGRP needs bandwidth to do
! Open the interface
ipv6 address <ipv6>
ivp6 rip <NAME> enable
! Set an IPV6 address
! Enable RIPv1 via IPV6
tunnel source <int>
tunnel destination <ip>
tunnel mode ipv6ip
! The tunnel source interface
! The tunnel destination IP
! Allow IPV6 through the Tunnel
Routing
Gateway of Last Resort
ip route 0.0.0.0 0.0.0.0 <int>
interface
! The the quad zero exit
Floating Static Routes
ip route <network> <subnet> <destination ip>
ip route <network> <subnet> <destination ip> <priority>
Create BGP Autonomous System (AS)
router bgp <AS>
no synchronization
convergence
neigbor <ip> remote-as <AS>
neigbor <ip> route-map <route-map> in
neighbor
no auto-summary
network <summary>
ip route <network> <subnet> null0
! Initialize the BGP AS
! Only announce if local
! Declare neighbor
! Set route-maps for
! Disable summarization
! Announce a network
! Add the nullroute
clear ip bgp
something doesn't update)
! Refresh BGP (Use this if
route-map <routemap> <permit|deny> <no>
set local-preference <no>
Create EIGRP Autonomous System (AS)
router eigrp <AS>
network <network> [wildcard]
broadcast
passive-interface default
ALL EIGRP routing updates
neighbor <DEST-IP> <INT>
manually setup neigbor
no passive-interface <int>
on this interface
no auto-summary
interface <int>
Hello interval
ip hello-interval eigrp <AS> <sec>
same in each end
key chain <KEYCHAIN>
config mode
key 1
key-string <KEY>
! Initialize the EIGRP AS
! Add the networks to be
! Set all interfaces to suppress
! If passive interface is set,
! Re-enable the routing updates
! Disable summarization
! Enter the interface to set
! Hello interval, must be the
! MD5 on EIGRP
! Create a new keychain in
! First key
! Keystring
interface <int>
ip authentication mode eigrp <AS> md5
ip authentication key-chain eigrp <AS> <KEYCHAIN>
! Setup MD5 for link
Create OSPF
interface <interface>
! Select the interface for Point
to Point
ip ospf network point-to-point
! Setup OSPF point-to-point
router ospf <AS>
! Initialize the OSPF AS
router-id <id>
! Set the Router-ID (Do this
before creating networks)
area <no> range <start-ip> <end-ip>
! Optionally setup the Area
network <network> [wildcard] area <no>
! Add the networks to broadcast
passive-interface default
no passive-interface <int>
redistribute <routing protocol> <no> subnets metric <no>
distribute-list <acl> <direction>
default-information originate always
interface <int>
ip ospf network broadcast
! Set OSPF to broadcast on the
interface.
ip ospf priority <priority>
! Set priority (force DR)
ip ospf network point-to-point
! Loopbacks must be point-topoint to broadcast correct mask
access-list <no> <deny|permit> <network wildcard|any> ! Remember to Deny,
then Permit
router ospf <AS>
area <no> stub
area <no> nssa
area <no> stub no-summary
area <no> nssa no-summary
router ospf <AS>
Backbone, otherwise create virtual link
area <AS>
virtual-link <dest ip>
- also opposite direction
!
!
!
!
!
STUB, on ABR
NSSA, on ABR
Totally STUB, on ABR
Totally NSSA, on ABR
All areas must connect to
! Transit area (between 0 and X)
IPv6 Routing
ipv6 unicast-routing
ipv6 router rip <process>
interface <int>
ipv6 rip <process> enable
!
!
!
!
Initialize routing for IPv6
Initialize RIP for the process
Select interface
Enable process on interface