Some databases require connections to multiple ports simultaneously. DB2 is a good example of this as you can see in the table below.
|Function||Port (non-TLS)||TLS Port|
The above table has been reproduced from the IBM documentation for explanatory purposes. The complete documentation can be found here:
Ports That Must Be Open to Make an ODBC, Data Transfer, OLE DB, ADO.Net, or JDBC Connection through a Firewall
The challenge arose when trying to create an SSH tunnel from Data Virtuality to a DB2. I mistakenly created a single SSH tunnel for port 449. When I tried to connect, DB2 would refuse the connection because the driver could not establish connections on the other ports.
The solution turned out to be quite simple. Create SSH tunnels for each port.
create procedure views.create_db2_tunnels() as
loop on (
SELECT cast(item as integer) as port
CALL UTILS.arrayToTable(items => (449, 8470, 8475, 8476, 8471))
) as cur
"name" => 'ssh_db2_' || cur.port,
"localHost" => 'localhost', -- this will usually be localhost
"localPort" => cur.port,
"remoteHost" => '10.11.12.13', -- this is the IP address of the DB2 server
"remotePort" => cur.port,
"host" => 'email@example.com', -- This is IP address of the SSH proxy (aka SSH jump box)
"sshKeyPairId" => 1 -- I created an RSA key pair inside of DV and this is the ID
For additional information see our documentation:
Please sign in to leave a comment.