Snowpack

Tutorial for multi-route configuration

Snowpack currently also supports user-defined configuration for multiple paths, on which, user can:

Usage

To enable this function, user needs to execute Snowpack with the following arguments:

./snowpack-cli user -mr <config_file_path>

with config_file_path is the path to configuration file. An explanation of detail format of configuration file can be found in the following section.

Configuration file format

The configuration file is in JSON format. If no version number is provided in the file, it is considered to be in v0 format
Noted that configurations introduced in later versions cannot be parsed with older version numbers and will be ignored.
Only version 0 and 1.0 are currently supported.
An example of the config file v0 can be found below.

{
  "ROUTE1": {
    "Id": 1,
    "Route": {
      "Pu1": "192.168.9.92",
      "Ps1": "192.168.9.94",
      "Pu2": "192.168.9.97",
      "Ps2": "192.168.9.95",
      "PR": "192.168.9.96"
    },
    "Protocols":
    [
      {
        "name": "udp",
        "not daddr": ["35.180.139.74", "1.1.1.1"],
        "not dport": ["8081", "2000-2050", "3000-4000"]
      }
    ]
  },
  "ROUTE2": {
    "Id": 2,
    "Route": {
      "Pu1": "192.168.9.92",
      "Ps1": "192.168.9.95",
      "Ps2": "192.168.9.94",
      "public_ip_country": "France"
    },
    "Protocols":
    [
      {
        "name": "icmp"
      },
      {
        "name": "tcp",
        "daddr": ["8.8.8.8"],
        "dport": ["8081", "2000-2050", "3000-4000"]
      }
    ]
  }
}

In the version v1.0, new configuration entry_country is introduced and the file format is modified to include version and config field.

{ 
  "version": "1.0",
  "config": {
      "ROUTE1": {
        "Id": 1,
        "Route": {
          "entry_country": "Poland",
          "Ps1": "192.168.9.94",
          "Ps2": "192.168.9.95",
          "PR": "192.168.9.96"
        },
        "Protocols":
        [
          {
            "name": "udp",
            "not daddr": ["35.180.139.74", "1.1.1.1"],
            "not dport": ["8081", "2000-2050", "3000-4000"]
          }
        ]
      }
  }
}

Each element of json object is the configuration of a route accompanied by the data characteristics traversing through it. Each route must contain the following information.

Access info to create your own config file

You can use the following commands to get info on the existing nodes:

./snowpack-cli exit_country_info
./snowpack-cli public_ip_info
./snowpack-cli nodes_info