Thursday, December 29, 2011

Transfer file via tftp for Cisco, Netscaler and Linux box

Once the TFTP server installed. We have to start do some test to perform the backup..
Here I do face some error or failure when transfering..
Do some twit and tune around and here the some way to do it..
Do advise most of the information do plug from some other blog..
Appreciate for their solution and option..


Now... let's get back to business..
Do notes, my tftp server IP is 192.168.1.250
1. Backup for Cisco devices...

Cisco#write net
This command has been replaced by the command:
'copy system:/running-config '
Address or name of remote host []? 192.168.1.250
Destination filename [ cisco-config ]? cisco-config
Write file tftp://192.168.1.250/cisco-config? [confirm]y!! [OK]
Cisco#


2. Backup for Netscaler devices..
For the netscaler devices, if do not have any function for tftp, then required to login to shell mode of the devices. From there, we required to write 2 script for the backup.

i. Create a folder to store backup script.
mkdir /var/backup

ii. create Script backup.sh - backup all the configuration, license and ssl certificate


#!/bin/sh

cd /nsconfig
tar -zcf /tmp/ns-backup.tar ns.conf license/ ssl/
cd /tmp
tftp < /var/backup/tftp.cmd
rm ns-backup.tar


iii. Create Script tftp.cmd - for run the tftp command


connect 192.168.1.250
binary
put ns-backup.tar
quit

iv. If intent to perform the backup daily, can consider to add a crontab for the script run base on your preference time.


3. Backup for Linux Box..
For this option, I do face some error such as Transfer timed out or nothing transfer. Therefore if face some of the issue, might try to perform some tuning on the client machine.

i. At the client machine add the ip_conntrack_tftp
modprobe ip_conntrack_tftp

ii. Then run tftp to put the file into the server.
root@ client[~]# tftp 192.168.1.250
tftp> put my.cnf
tftp> quit

If intent to do some auto backup, do advise use the same solution as suggest on Netscaler Backup solution.



No comments: