How to do Traffic Shaping on Ubiquiti EdgeSwitch.

Traffic shaping on each Ethernet port (or on a Vlan) is down in two sections.

Upload (ingress) is done via Access Control List.
Short summary, acl list configuration is defined as a global configuration
Appropriate acl package is applied to the specific Ethernet / Vlan port

e.g…below are the cli config snippets

mac access-list extended up10
permit any any rate-limit 10240 128
exit

mac access-list extended up20
permit any any rate-limit 25600 128
exit

interface 0/1
mac access-group up20 in 1
exit

interface 0/4
traffic-shape 11
mac access-group up10 in 1
exit

Download Traffic shaping (egress) is done via command ‘traffic-shape XX’, where xx = percentage of total port bandwidth.
i.e. for a 1G port, figure of 10 = 10% approx 100meg and or figure of 5 = 5% i.e. 5meg

The above can be done via CLI (telnet / ssh) or via SNMP.

How to program a Netonix Switch if you only have a config.txt file.

Prelude:-

Configuration of Netonix Switches can be backed up in a couple of different ways.

1) Use the GUI, Utilities / Backup option, this will output/save a file with a name something like 192.168.1.20_WS-12-250-AC_Netonix-Switch.NCFG.

2) Using a Configuration Backup program like Unimus, Rancid, or Telnet/SSH Scripting, which can save a config.txt file (output of the show config cli command).

Apparently there is no good documentation on how to restore the config to another switch if you have a backup done using option # 2 above.

It turns out to be rather simple on how to ‘restore’ a config if you have the output of show config cli command.

Process:-

1) Connect to the CLI using Web interface (Device / Console ) or your favorite Telnet / SSH client (putty etc) or Serial Connection.
2) Issue ‘cmdline’ command to drop down to the Busybox command line shell
3) You should be now at the :/www# prompt .. you can use ‘ls’ command to see the file list.
4) Use VI or nano to open up the config.json file … ‘vi config.json’ or ‘nano config.json’
5) You can delete all the exiting content and replace it with the contents of you backup (config.txt) file.
6) Save file, exit out of the editor.
7) Reboot your Switch.

Note: vi editor build-in in busybox is a limited version..
use ‘insert’ key to enter edit mode
use ‘dd’ to delete file
use <esc> key to exit edit mode
‘:wq’ to exit after saving the file edit
‘:q!’ to exit without saving file

Another alternative method :-
Do you backup and Restore using the Web GUI, which produces a .NCFG file. This is actually a tar.gz file. One can rename .ncfg file to .tar.gz, un-tar it, replaced the content of config.json file under the ‘www’ folder
re-create the tar.gz file again, and upload / restore the file to the switch.