Skip to content

cambrianworks/gigswitch-examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gigswitch-examples

This repository is a public-facing collection of examples and tools for the GigSwitch platform. This includes example configuration documentation, setup recipes, tools and other tips for GigSwitch.

Getting Started

This repository is best used on a Linux machine with network access to a GigSwitch device and common tools installed such as Python 3, curl, jq and ssh. However, any machine with firewall access can connect to the GigSwitch using:

  • http(s)://{GS_IP} - general web interface
  • ssh admin@{GS_IP} - ICLI (command line) or shell interface
  • http(s)://{GS_IP}/json_rpc - JSON RPC interface

To clone this repository to your local machine:

git clone https://github.com/cambrianworks/gigswitch-examples.git

Documentation

Documentation for configuration, recipes and quick tips are all in the docs/ subdirectory.

Start here: docs/README.md - Complete documentation index and navigation guide.

Helper Scripts

The bin/ directory contains useful scripts:

  • gs-rpc: JSON-RPC helper tool for switch configuration (see docs/helper-tool-gs-rpc.md)
  • upload-switch-config.sh: Upload and apply configs via HTTP (see docs/http-config-upload.md)
  • download-switch-config.sh: Download configs from switch via HTTP
  • setup_tftpd.sh: Automated TFTP server setup for file transfers
  • serial-config-restore.exp: Restore config via serial console when network is down
  • debug_trace_capture.exp: Automated debug trace capture via serial console
  • gs-grab-running-config: Grab running config from switch using expect script
  • gs-grab-running-config-wrapper: Wrapper for gs-grab-running-config

Example usage:

# Upload and apply config to running-config (with merge=true)
./bin/upload-switch-config.sh config.txt http://{GS_IP} running-config true

# Set up TFTP server to support file transfers
./bin/setup_tftpd.sh 6069 ~/tftp-files

# Restore config via serial console (emergency recovery)
./bin/serial-config-restore.exp /dev/ttyUSB0 backup-config.txt

# Capture debug traces via serial console
# (assumes GigSwitch serial port connected to /dev/ttyUSB0)
./bin/debug_trace_capture.exp /dev/ttyUSB0

# Download config from switch
./bin/download-switch-config.sh http://{GS_IP} startup-config backup.txt

License

Licensed under either of

at your option.

Contributing

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

About

Example configuration documentation, setup recipes, tools and other tips for GigSwitch.

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors