Obtaining Cisco software directly from a Server

Recently I’ve been updating Cisco ASA FirePOWER modules and I ran into a situation where I was attempting to do this tethered to my phone. Pushing GBs of files over my weak 4G signal wasn’t going to cut it. I’m vaguely familiar with Wget having used it on the odd occasion over the years and simply searched for “wget cisco”. This awesome blog post by Nick Bettison provided the solution I was looking for. I’m posting this here simply for posterity.

Old method:
Cisco -> My local machine -> Server -> ASA

New method:
Cisco -> Server -> ASA

Instead of downloading images to my local machine then uploading it to a server and eventually the ASAs, I would skip the first step and obtain the Cisco software from my server instead. This is where Wget comes into play.

It’s a bit of hacky solution but it works well. Go through the download process like you typically would, once you’ve initiated the download you can then obtain the download link. Nick recommends using Firefox for this as Chrome doesn’t seem to provide that information. On the Downloads page simply right click on whatever it is you’re downloading and select “copy download link”. From this point you can cancel the download then move onto your *nix box. (Unfortunately you can’t simply copy and paste a download link directly from Cisco as you have to agree to Cisco’s terms and conditions as a prerequisite to the download becoming available. Even then there’s no direct link, it just launches the download). On your *nix box execute the following command:

wget -O name-of-file.pkg "https://link-you-have-just-copied.cisco.com"

  • The double quotes are important!

I also stumbled upon another solution using curl:

curl -JLO http://www.vim.org/scripts/download_script.php?src_id=9750

-O uses the remote name, and -J forces the -O to get that name from the content-disposition header rather than the URL, and -L follows redirects if needed.

If anyone has a better suggestion please let me know.