Configuration

The Gateway Configuration File

The IBM Aspera fasp.io Gateway configuration file, gateway.toml, is located here:

Linux, macOS:
/usr/local/etc/fasp.io/gateway.toml
Windows:
C:\Program Files\IBM\fasp.io Gateway\config\gateway.toml

The gateway.toml file included in the installation is provided as a template. Modify this file to specify your ports, host names, and so on.

Note: Every time you modify gateway.toml to make changes for your configuration, you must restart the IBM fasp.io Gateway service. For information on starting and stopping the Gateway service, see Launching fasp.io Gateway.
Note: The version of the FASP protocol included in fasp.io Gateway uses a single UDP port. Whatever port you configure for your FASP connection over the WAN must have the same UDP port open on any firewalls along the connection path.

Configuration Examples

Example: Client to Server

In this configuration, two Gateways are used to bridge a TCP connection from TCP clients to a TCP server over FASP:

Given a server listening on port 12345, configure your client to point to Gateway 1 (GW1 IP) and port 12345:

GW1 Configuration GW2 Configuration
[[bridge]]
   [bridge.local]
       protocol = "tcp"
           host = "0.0.0.0"
           port = 12345
  
   [bridge.forward]
       protocol = "fasp"
           host = "GW2"
           port = 12345
[[bridge]]
   [bridge.local]
       protocol = "fasp"
           host = "0.0.0.0"
           port = 12345

   [bridge.forward]
       protocol = "tcp"
           host = "Server"
           port = 12345
protocol
The transfer protocol type, either "tcp" or "fasp". The protocol type must be quoted.
host
The host name or IP address, always quoted.
port
Either of these:
  • Port number (quoting optional)
  • Known port/service name (quoting required), such as "http" or "ftp-data"
You can specify a range of numbered ports using a hyphen; for example, 100-110. Details:
  • The range of port numbers must be ascending (low to high); for example, 100-110, but not 100-90.
  • The size of the range cannot exceed 50 ports.
  • If a port range is used, the range for the local port and the forward port must be the same size.
  • The ranges do not need to consist of the same ports. For example, the local range could be 501-509 and the forward range could be 511-519; however, the forward range could not be 511-520.

Example: Forwarding to the first Available Host

For bridge.forward, Gateway can loop through an array of specified host names or IP addresses and forward to the first available host it finds. For example:

[bridge.forward]
       protocol = "fasp"
           host = ["GW2", "10.0.0.2"]
           port = 12345

A hostname can resolve to multiple IP addresses. If a hostname is specified—either as a single entry or as an entry within the array—each of its IP addresses are tried until a connection is established.

Example: Server to Server

For some use cases, such as DB replication or messaging services (like MQ or Event Streams), communication must be established by both sides. In this mode, each server initiates a connection to the other:

GW1 Configuration GW2 Configuration
[[bridge]]
   name = "Outbound"
   [bridge.local]
       protocol = "tcp"
           host = "0.0.0.0"
           port = 12345

   [bridge.forward]
       protocol = "fasp"
           host = "GW2"
           port = 12345

[[bridge]]
   name = "Inbound"
   [bridge.local]
       protocol = "fasp"
           host = "0.0.0.0"
           port = 54321

   [bridge.forward]
       protocol = "tcp"
           host = "Server1"
           port = 54321
[[bridge]]
   name = "Outbound"
   [bridge.local]
       protocol = "tcp"
           host = "0.0.0.0"
           port = 54321

   [bridge.forward]
       protocol = "fasp"
           host = "GW1"
           port = 54321

[[bridge]]
   name = "Inbound"
   [bridge.local]
       protocol = "fasp"
           host = "0.0.0.0"
           port = 12345

   [bridge.forward]
       protocol = "tcp"
           host = "Server2"
           port = 12345



Gateway Configuration Options

Gateway can also be configured with multiple bridges, multiple ports, multiple destinations, and multiple services. The image below shows a single gateway configured with examples of these combinations.
Gateway Configuration Options
Bridge: HTTP-Out Bridge: Smtp-Out Bridge: MQ-In
[[bridge]]
   name = "Http-Out"
   [bridge.local]
      protocol = "tcp"
        host = "0.0.0.0"
        port = "http"

   [bridge.forward]
      protocol = "fasp"
        host = "GW2"
        port = "http"
[[bridge]]
   name = "Smtp-Out"
   [bridge.local]
      protocol = "tcp"
        host = "0.0.0.0"
        port = 25

   [bridge.forward]
      protocol = "fasp"
        host = "GW3"
        port = 25
[[bridge]]
   name = "MQ-In"
   [bridge.local]
      protocol = "fasp"
        host = "0.0.0.0"
        port = 8414

   [bridge.forward]
      protocol = "tcp"
        host = "Server1"
        port = 8414

Logging Configuration File

Logging configuration is defined in logging.toml, which is located here:

Linux, macOS:
/usr/local/etc/fasp.io/logging.toml
Windows:
C:\Program Files\IBM\fasp.io Gateway\config\logging.toml

Error, warning, and info logs are sent to the console by default. In the default logging.toml file, four loggers are made available:

  • gateway – High-level logger for the gateway.
  • s2s – Stream-to-stream session class logger.
  • fasp.io-cpp – Logger for the Asio/C++ FASP SDK.
  • fasp.io-c – Logger for the FASP protocol.
Note: Every time you modify logging.toml, you must restart the fasp.io Gateway service.

For more information on how to configure logging, see the full reference at:

https://github.com/guangie88/spdlog_setup

Notes:
  • The level setting is optional for both sinks and loggers.
  • The level for error logging is err, not error.
  • The _st suffix means single-threaded.
  • The _mt suffix means multi-threaded.
  • syslog_sink is thread-safe by default. No _mt suffix is required.
The spdlog default logging format is:
[2014-10-31 23:46:59.678] [loggername] [info] message

For information on how to customize spdlog formatting, see:

https://github.com/gabime/spdlog/wiki/3.-Custom-formatting