Client: Difference between revisions

From Bondix Wiki
No edit summary
No edit summary
 
(3 intermediate revisions by one other user not shown)
Line 1: Line 1:
The Bondix SANE client is the software that you install on your router, which establishes a connection to the [[Server|server]] using multiple WAN links. The software itself is a linux userspace program, but installation packages for different routers are available, that take care of most of the configuration.  
The Bondix SANE client is the software that you install on your router, which establishes a connection to the [[Server|server]] using multiple WAN links. The software itself is a linux userspace program, but installation packages for different routers are available, that take care of most of the configuration.  


If you would like to install the client on one of our supported routers: 
This page covers the barebone linux application. Please check out the [[Teltonika]] page for installation & usage on these routers.


* [[Teltonika]]
==Configuration==
* [[Advantech]]
 
 
The rest of this page covers usage of the barebone linux application.
 
== Configuration ==
Configuration is done using [https://www.json.org/ JSON] commands. These can either be sent via a raw TCP socket (localhost:5113), or written to a configuration file (in a json-array) that is parsed on start-up.
Configuration is done using [https://www.json.org/ JSON] commands. These can either be sent via a raw TCP socket (localhost:5113), or written to a configuration file (in a json-array) that is parsed on start-up.


By default, SANE checks for the existence of a configuration file in its installation directory (e.g. <code>/opt/bondix/client/saneclient.json</code>) and at <code>/etc/saneclient.json</code>. If you want SANE to load a configuration from a different location, you can specify it using a command line parameter.
By default, SANE checks for the existence of a configuration file in its installation directory (e.g. <code>/opt/bondix/client/saneclient.json</code>) and at <code>/etc/saneclient.json</code>. If you want SANE to load a configuration from a different location, you can specify it using a command line parameter.


=== Quick Start ===
===Quick Start===
This example provides the minimal necessities to get a tunnel up and running:
This example provides the minimal necessities to get a tunnel up and running:
  <nowiki>[
  <nowiki>[
  {"action": "create", "target": "tunnel", "name": "TUNNELNAME", "password": "TUNNELPASSWORD"},
    {"action": "create", "target": "tunnel", "name": "TUNNELNAME", "password": "TUNNELPASSWORD"},
  {"action": "add-server", "target": "tunnel", "host": "ENDPOINTSERVER", "port": "443"},
    {"action": "add-server", "target": "tunnel", "host": "ENDPOINTSERVER", "port": "443"},
  {"action": "create-interfaces", "target": "tunnel", "interfaces": {
    {"action": "create-interfaces", "target": "tunnel", "interfaces": {
    "eth1": "mobileAggressive",
      "eth1": "mobileAggressive",
    "wwan0": "mobileAggressive",
      "wwan0": "mobileAggressive",
    "wwan1": "mobileAggressive"
      "wwan1": "mobileAggressive"
  }},
    }},
  {"target": "tunnel", "action": "set-preset", "preset": "bonding"}
    {"target": "tunnel", "action": "set-preset", "preset": "bonding"}
]
  ]
</nowiki>
  </nowiki>


=== Configuration Commands ===
===Configuration Commands===
For a complete reference list of available commands, see [[Client Configuration]].
For a complete reference list of available commands, see [[Client Configuration]].


=Running =
===Tunnel Configuration===
Tunnels and channels have many configurable values, that are managed using [[Presets]].
 
=Running=
The software can be run in the shell using <code>/opt/bondix/client/saneclient</code>, where it will run in the foreground. However, it is recommended to start the service automatically on startup, which can be different depending on the platform.
The software can be run in the shell using <code>/opt/bondix/client/saneclient</code>, where it will run in the foreground. However, it is recommended to start the service automatically on startup, which can be different depending on the platform.


=== Parameters ===
===Parameters===
{| class="wikitable"
{| class="wikitable"
|-
|-
| <code>--daemon</code>||Runs the software as a daemon.
|<code>--daemon</code>||Runs the software as a daemon.
|-
|-
|<code>--nopid</code> ||Does not attempt to create a pid-file at <code>/var/run/saneclient.pid</code>
|<code>--nopid</code>|| Does not attempt to create a pid-file at <code>/var/run/saneclient.pid</code>
|-
|-
|<code>--listflags</code>||Lists available feature flags
|<code>--listflags</code>||Lists available feature flags
Line 45: Line 42:
|<code>--flags <FLAG1> <FLAG2>... </code>||Enables the specified flag(s). Multiple flags are separated using space.
|<code>--flags <FLAG1> <FLAG2>... </code>||Enables the specified flag(s). Multiple flags are separated using space.
|-
|-
|<code></path/to/filename.json></code>|| JSON configuration file that should be used
|<code></path/to/filename.json></code>||JSON configuration file that should be used
|}
|}


=== Feature Flags ===
===Feature Flags===
Feature flags are switches that enable certain features that are otherwise unavailable. These features are usually experimental and should be used with caution.
Feature flags are switches that enable certain features that are otherwise unavailable. These features are usually experimental and should be used with caution.
{| class="wikitable"
{| class="wikitable"
|-
|-
|useBlake||Switches from SHA256 to the "blake" hashing algorithm.  
|useBlake||Switches from SHA256 to the "blake" hashing algorithm.
|-
|-
|useBlake3||Switches to the "blake3" hashing algorithm.  
|useBlake3||Switches to the "blake3" hashing algorithm.
|-
|-
|disableHash|| Disables hashing completely
|disableHash||Disables hashing completely
|-
|-
|useMMSG||uses useMMSG linux socket API to send & receive multiple UDP packets at once.  
|useMMSG||uses useMMSG linux socket API to send & receive multiple UDP packets at once.
|-
|-
|channelRoutes||Makes the client create specific routes for each channel. Experimental, do not use.
|channelRoutes||Makes the client create specific routes for each channel. Experimental, do not use.
|-
|-
|bondingProxy||Enables the TCP [[Bonding Proxy]].
|bondingProxy||<s>Enables the TCP [[Bonding Proxy]]</s>. Now always enabled
|}
|}


Line 68: Line 65:
bndutil is a command line utility that allows to query and modify SANE during runtime. It uses the configuration TCP socket  
bndutil is a command line utility that allows to query and modify SANE during runtime. It uses the configuration TCP socket  
  <nowiki>root@Teltonika-RUTX12:/opt/bondix/client# ./bndutil
  <nowiki>root@Teltonika-RUTX12:/opt/bondix/client# ./bndutil
Usage:
  Usage:
    bndutil [--json] <command>
    bndutil [--json] <command>
            --json  switch to JSON output
              --json  switch to JSON output
 
Available commands:
  Available commands:
  * bndutil status
    * bndutil status
  * bndutil get
    * bndutil get
  * bndutil set <propertyName1> <propertyValue1> [propertyName2] [propertyValue2] ...
    * bndutil set <propertyName1> <propertyValue1> [propertyName2] [propertyValue2] ...
  * bndutil get-interface <index>
    * bndutil get-interface <index>
  * bndutil set-interface <index> <propertyName1> <propertyValue1> [propertyName2] [propertyValue2] ...
    * bndutil set-interface <index> <propertyName1> <propertyValue1> [propertyName2] [propertyValue2] ...
  * bndutil shutdown
    * bndutil shutdown
  * bndutil restart  
    * bndutil restart  
    (tunnel reset & reconnect)
      (tunnel reset & reconnect)
</nowiki>
  </nowiki>


==speedtest==
==speedtest==
Speedtest is a small utility that downloads (and discards) data via HTTP(s) using one or more WAN interfaces. It is useful to compare performance of each individual interface and the combined bandwidth over SANE's virtual tunnel interface.  
Speedtest is a small utility that downloads (and discards) data via HTTP(s) using one or more WAN interfaces. It is useful to compare performance of each individual interface and the combined bandwidth over SANE's virtual tunnel interface.  
  <nowiki>root@Teltonika-RUTX12:/opt/bondix/client# ./speedtest
  <nowiki>root@Teltonika-RUTX12:/opt/bondix/client# ./speedtest
Usage: speedtest [--json] <download-url> <intf1> [intf2] ...</nowiki>
  Usage: speedtest [--json] <download-url> <intf1> [intf2] ...</nowiki>


E.g., to test performance of each WAN interface directly:
E.g., to test performance of each WAN interface directly:

Latest revision as of 11:58, 16 July 2024

The Bondix SANE client is the software that you install on your router, which establishes a connection to the server using multiple WAN links. The software itself is a linux userspace program, but installation packages for different routers are available, that take care of most of the configuration.

This page covers the barebone linux application. Please check out the Teltonika page for installation & usage on these routers.

Configuration

Configuration is done using JSON commands. These can either be sent via a raw TCP socket (localhost:5113), or written to a configuration file (in a json-array) that is parsed on start-up.

By default, SANE checks for the existence of a configuration file in its installation directory (e.g. /opt/bondix/client/saneclient.json) and at /etc/saneclient.json. If you want SANE to load a configuration from a different location, you can specify it using a command line parameter.

Quick Start

This example provides the minimal necessities to get a tunnel up and running:

[
    {"action": "create", "target": "tunnel", "name": "TUNNELNAME", "password": "TUNNELPASSWORD"},
    {"action": "add-server", "target": "tunnel", "host": "ENDPOINTSERVER", "port": "443"},
    {"action": "create-interfaces", "target": "tunnel", "interfaces": {
      "eth1": "mobileAggressive",
      "wwan0": "mobileAggressive",
      "wwan1": "mobileAggressive"
    }},
    {"target": "tunnel", "action": "set-preset", "preset": "bonding"}
  ]
  

Configuration Commands

For a complete reference list of available commands, see Client Configuration.

Tunnel Configuration

Tunnels and channels have many configurable values, that are managed using Presets.

Running

The software can be run in the shell using /opt/bondix/client/saneclient, where it will run in the foreground. However, it is recommended to start the service automatically on startup, which can be different depending on the platform.

Parameters

--daemon Runs the software as a daemon.
--nopid Does not attempt to create a pid-file at /var/run/saneclient.pid
--listflags Lists available feature flags
--flags <FLAG1> <FLAG2>... Enables the specified flag(s). Multiple flags are separated using space.
</path/to/filename.json> JSON configuration file that should be used

Feature Flags

Feature flags are switches that enable certain features that are otherwise unavailable. These features are usually experimental and should be used with caution.

useBlake Switches from SHA256 to the "blake" hashing algorithm.
useBlake3 Switches to the "blake3" hashing algorithm.
disableHash Disables hashing completely
useMMSG uses useMMSG linux socket API to send & receive multiple UDP packets at once.
channelRoutes Makes the client create specific routes for each channel. Experimental, do not use.
bondingProxy Enables the TCP Bonding Proxy. Now always enabled

bndutil

bndutil is a command line utility that allows to query and modify SANE during runtime. It uses the configuration TCP socket

root@Teltonika-RUTX12:/opt/bondix/client# ./bndutil
  Usage:
     bndutil [--json] <command>
              --json  switch to JSON output
  
  Available commands:
    * bndutil status
    * bndutil get
    * bndutil set <propertyName1> <propertyValue1> [propertyName2] [propertyValue2] ...
    * bndutil get-interface <index>
    * bndutil set-interface <index> <propertyName1> <propertyValue1> [propertyName2] [propertyValue2] ...
    * bndutil shutdown
    * bndutil restart 
      (tunnel reset & reconnect)
  

speedtest

Speedtest is a small utility that downloads (and discards) data via HTTP(s) using one or more WAN interfaces. It is useful to compare performance of each individual interface and the combined bandwidth over SANE's virtual tunnel interface.

root@Teltonika-RUTX12:/opt/bondix/client# ./speedtest
  Usage: speedtest [--json] <download-url> <intf1> [intf2] ...

E.g., to test performance of each WAN interface directly:

./speedtest http://speed.hetzner.de/100MB.bin wwan0 wwan1 wwan2

Testing performance of the tunnel:

./speedtest http://speed.hetzner.de/100MB.bin tun0