Automated config loader

I have recently began the journey again after a three month standstill. Since it was taking a lot of time to shift around the configs, I decided to try to automate as much as possible, so I created a small script:

for (( i=$routerstart, k=$portstart; i<=$routerend, k<=$portend; i++, k++ )) ; do
echo R$i status;
(printf "\n"; echo "enable"; echo "configure replace bootflash:/INE/$DIRECTORY/R$i.txt force ignorecase"; sleep 1; echo "quit" ) | telnet $k | grep -i R$i;

Which really does the job. I have uploaded all config file to routers and this script just uses configure replace pointing to the right directory and txt file.

Pretty neat, since it only takes me 10 seconds to load the configs on all routers.

Please keep in mind that I am using telnet to the port mapped to the serial console of the router. So no matter what config is applied, I should always have access to change it.

I also needed to add some config lines for all config files:


#sed -i '6i version 15.4 \nplatform console serial\nlicense boot level premium' INE-config-files/*/*/*/*.txt


Leave a Reply

Your email address will not be published. Required fields are marked *