With the exception of the special running-config case, the config/icfg_conf_upload endpoint allows upload of a local file to /switch/icfg.
You can use the web interface or the upload-switch-config.sh helper script in the bin directory. The helper script requires
some standard command line tools including curl.
The helper script is based around this basic form of curl command:
SRC_PATH="$1"
FILENAME=$(basename "$SRC_PATH")
curl -u admin:PASSWD -X POST \
-F "file_name=${FILENAME}" \
-F "merge=false" \
-F "source_file=@${SRC_PATH};type=application/octet-stream" \
-F "file_name_radio=" \
-F "new_file_name=${FILENAME}" \
-L "http[s]://{SWITCH_IP}/config/icfg_conf_upload"
merge=true applies only to the special case of running-config.
The switch web interface provides HTTP endpoints for config upload and activation. This activation of an immediate settings in the running config has two steps and requires session cookies.
Endpoint: POST /config/icfg_conf_upload
Form data:
file_name- Source filenamenew_file_name- Destination filename (e.g., "running-config", "startup-config", "myconfig.txt")merge- "true" or "false" (only relevant for "running-config")source_file- The actual file (multipart)
Result: File written to /switch/icfg/new_file_name
Session state saved: merge setting, filename stored in cookies
Endpoint: GET /config/icfg_conf_activate
Requires: Cookies from upload step
Result: Applies /switch/icfg/running-config to actual running-config (and erases temp file)
Status responses:
DONE- SuccessRUN- Still processing (poll again)ERR- Completed with errorsSYNERR- Syntax errors, not activatedIDLE- No activation pending
In iCLI commands, flash:filename refers to files in /switch/icfg/ directory.
Examples:
flash:myconfig.txt=/switch/icfg/myconfig.txtflash:startup-config=/switch/icfg/startup-config
The documented upload script can be used to directly update the running-config or startup-config. However, it's arguably safer to first copy a config to the switch and then activate it with iCLI.
Below, the syntax-check argument will prevent the full copy operation if the input doesn't pass a syntax check. If you copy over top of a running-config without the syntax-check argument then you could apply only part of a config up to the point of the syntax error.
WARNING: There are some distinct differences in what is supported via the iCLI copy command and http endpoint.
- The
copycommand will ALWAYS usemergewhen the destination is therunning-config - The
copycommand supports remote files withtftp - The
copycommand supports thesyntax-checkargument to help avoid activating a corrupt config
Usage:
# Apply config from flash to running-config (MERGE is implied)
copy flash:myconfig.txt running-config [syntax-check]
# Copy to startup-config
copy flash:myconfig.txt startup-config [syntax-check]Filename "running-config" is special:
- Web UI shows Replace/Merge radio buttons (only for this filename)
- After upload, Web UI auto-redirects to activation page
- Activation applies the file to actual
running-config
merge=true: Merges commands into existing running-config (additive) merge=false: Replaces running-config (full replacement)
Other filenames:
- Upload creates file in
/switch/icfg/new_file_name - No automatic activation
- Apply manually (later with iCLI):
copy flash:filename running-config
The upload and activate are separate HTTP requests. Session state is maintained via cookies:
Upload POST → Sets cookie with:
- filename=running-config
- merge=true/false
Activate GET → Reads cookie to know:
- What file to activate
- How to apply it (merge vs replace)
Without cookies, activation doesn't know what to do and is a no-op!
See the helper script in ../bin/upload-switch-config.sh.
upload-switch-config.sh changes.txt http://{GS_IP} running-config trueResult: Config merged into running-config immediately
upload-switch-config.sh newconfig.txt http://{GS_IP} running-config falseResult: Running-config completely replaced
./upload-switch-config.sh myconfig.txt http://{GS_IP}Result: File at /switch/icfg/myconfig.txt, must apply manually or might use for other purposes.
| Method | Steps | Reboot? | Best For |
|---|---|---|---|
| HTTP Upload (running-config) | Upload + Activate | No | Scriptable, immediate application |
| HTTP Upload (other files) | Upload + manual copy | No | Staging configs |
| TFTP direct | copy tftp://... running-config |
No | iCLI one-liner but requires tftp |
| iCLI persist running config | copy running-config startup-config |
No | iCLI sets current config as startup-config |
| TFTP + reload | copy tftp://... startup-config + reload cold |
Yes | iCLI remote setting of startup-config |
For "running-config":
- Temporary file at
/switch/icfg/running-config - Applied to actual
running-config - File removed after activation
For other filenames:
- Permanent file at
/switch/icfg/filename - Stays until deleted
- Must apply manually
For immediate config changes via HTTP:
- Upload to "running-config" with merge=true/false
- Call activate endpoint with same cookies
- Check status response
- Config applied immediately, no reboot needed
For staging configs:
- Upload to custom filename
- No activation step
- Apply later with:
copy flash:filename running-config
The script upload-switch-config.sh handles all of this automatically!