Perhaps you are like me and sometimes have the need to create many loopback interfaces to be used in your lab. So, I made a little script that can create these loopback interfaces automatically for you.
The Script
proc inf_config {x} {for {set n 1} {$n<=$x} {incr n 1} {puts [ ios_config "interface Loopback$n" "ip address 192.168.$n.1 255.255.255.0" ]}}
R2#tclshR2(tcl)#proc inf_config {x} {+>for {set n 1} {$n<=$x} {incr n 1} {+>$ “interface Loopback$n” “ip address 192.168.$n.1 255.255.255.0″ ]+>}+>}Router(tcl)#inf_config 2
interface Loopback1ip address 192.168.1.1 255.255.255.0!interface Loopback2ip address 192.168.2.1 255.255.255.0!and so on….