Connecting across a firewall

There are restrictions on connections when the client application is on one side of a firewall, and the server is on the other. Firewall software filters network packets according to network port. Also, it is common to disallow UDP packets from crossing the firewall.

When connecting across a firewall, you must use a set of protocol options in the CommLinks (LINKS) connection parameter of your application's connection string.

  • Host   Set this parameter to the host name on which the database server is running. You can use the short form IP.

  • ServerPort   If your database server is not using the default port of 2638, you must specify the port it is using. You can use the short form Port.

  • ClientPort   Set this parameter to a range of allowed values for the client application to use. You can use the short form CPort. This option may not be necessary depending on the firewall's configuration.

  • DoBroadcast=NONE   Set this parameter to prevent UDP from being used when connecting to the server.

The firewall must be configured to allow TCP/IP traffic between the SQL Anywhere server's address and all the SQL Anywhere clients' addresses. The SQL Anywhere server's address is the IP address of the computer running the SQL Anywhere server (the HOST parameter) and the SQL Anywhere server's IP port number (the ServerPort protocol option, default 2638). Each SQL Anywhere client's address consists of the IP address of the client computer, and the range of the client IP ports (the ClientPort protocol option). For the simplest configuration, all client ports can be allowed. If only specific client ports are allowed, specify a range with more ports than the maximum number of concurrent connections from each client computer, since there is a several minute timeout before a client port can be reused.

See ClientPort protocol option [CPORT].

Example

The following connection string fragment restricts the client application to ports 5050 through 5060, and connects to a server named myeng running on the computer at address myhost using the server port 2020. No UDP broadcast is performed because of the DoBroadcast option.

ENG=myeng;LINKS=tcpip(ClientPort=5050-5060;HOST=myhost;PORT=2020;DoBroadcast=NONE)
See also