Zyxel GS1200-5/8 stuck in upgrade mode

updated 2 min read #tutorial #networking

This note shows how I got a Zyxel GS1200 switch out of a failed firmware upgrade by uploading the firmware with curl instead of the web interface.

I tried to upgrade a brand-new GS1200-5 from firmware V2.00(ABKM.1)C0 to V2.00(ABKM.2)C0, using Firefox on Linux. After I clicked the upgrade button, the switch port LED flashed rapidly, but the upgrade failed when a 30-second timer ran out. Cancelling the upgrade rebooted the switch, but the web interface stayed stuck in firmware upgrade mode.

A reset and a power cycle didn’t change anything.

In the end, I looked at the page source and used curl to upload the firmware:

curl -F 'firmware=<firmware.bin' --output curl.out 'http://192.168.1.3/httpupg.cgi?cmd=fw_upgrade'

-F sends a multipart/form-data POST, like a submitted web form, with the form field firmware that the upgrade page uses. The < before the file name tells curl to read the file’s contents into that field as a plain text field. With @ instead, curl would attach the file as a file upload, including its file name. Because < sends no file name, renaming the file to firmware.bin beforehand, as I did, wasn’t necessary. --output curl.out writes the response to a file; otherwise curl refuses to print binary output to the terminal.

Result#

The upload took longer than 30 seconds, but it went through, and the switch came back up with the new firmware and a normal web interface. I suspect the timeout in the web page’s code is simply too short for this upload.

Sources#

cd ~/writing