Wednesday, August 15, 2012

Work Around: Copying Files from a Windows Local Machine to DataPower via CLI

I encountered a situation with DataPower where we can't access the WebGUI and the quickest way to fix it was to reinitialize the box and restore from backup. To be able to do this, I needed to copy a firmware image into the box via CLI, execute reinit <image_file_name>, reconfigure the appliance, and then restore from backup.

I had a problem copying the firmware image from one of the RHEL servers to DataPower and found out that there is a known issue when copying via SCP. Because of this, I thought of placing the firmware image inside an HTTP server. Then, instead of using SCP/SFTP, I copied using HTTP protocol.

1. Install WAMPServer or any HTTP server that your familiar with.
2. Configured the httpd.conf to grant all access to the www folder where I placed the firmware image (do something similar to your choice of HTTP Server)
3. Restarted the WAMPServer
4. The file should be located under http://{YOUR_IP}/{FILENAME}
5. Run the following commands via SSH in DataPower

test tcp-connection {YOUR_IP} 80 //make sure DataPower can communicate with your machine
config
copy http://{YOUR_IP}/{FILENAME}  image:///{FILENAME}

After copying the firmware image, I just followed the guide for resetting DataPower. As long as you have a RJ45 to USB cable, it should be easy-as-pie to reinitialize.

No comments: