Sample Header Ad - 728x90

How to connect to Oracle 9i through SSH tunnel if TNS protocol issues a REDIRECT to a random port?

0 votes
0 answers
153 views
Inspecting packets exchanged between SQLDeveloper and Oracle 9i I noticed that, in the beginning of the connection negotiation, the server issues a REDIRECT back to the client, pointing a port different from 1521. The client then connects using this new port. This is apparently a normal behavior of TNS protocol. Because of this behavior it's difficult to connect remotely via SSH tunnel or through firewalls. client sends this: tns.connect_data = (DESCRIPTION=(CONNECT_DATA=(SID=xyz)(CID=(PROGRAM=SQL Developer)(HOST=__jdbc__)(USER=abc)))(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.100.100)(PORT=1521))) and receives this: tns.redirect_data = (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.100.100)(PORT=1236)) Is there a way to disable this redirect? Or at least limit the redirection to a few known ports? According to this there are 2 solutions: 1. use shared server and configure the dispatchers 2. use connection manager Regarding **1. shared servers**, I created a new shared server an tried to configure the dispatchers like this and this : alter system set DISPATCHERS='(PROTOCOL = TCP)(ADDRESS=(PROTOCOL=tcp)(HOST=myHost)(PORT=5000))' scope=spfile sid='xyz'; But I get errors like: 02065. 00000 - "illegal option for ALTER SYSTEM" Cause: The option specified for ALTER SYSTEM is not supported Removing the scope and sid: 00101. 00000 - "invalid specification for system parameter DISPATCHERS" Cause: The syntax for the DISPATCHERS parameter is incorrect. removing the (PROTOCOL = TCP): 00105. 00000 - "too many dispatcher configurations" Cause: Too many dispatcher configurations have been specified. No more can be added. Regarding **2. connection manager** I enabled the cman and cman admin services, created cman.ora as: cman = (ADDRESS_LIST= (ADDRESS=(PROTOCOL=tcp)(HOST=myHost)(PORT=1630)(QUEUESIZE=32)) ) cman_admin = (ADDRESS=(PROTOCOL=tcp)(HOST=myHost)(PORT=1830)) and followed this . I always get connection refused. I could connect to port 1630, after putting it in the listener. In the end the port redirect still happened.
Asked by Gustavo (173 rep)
Jul 3, 2022, 08:51 PM