1

I'm trying to connect to an Oracle DB from Entity Framework, but the DB rejects direct connections from the PC. I need to connect through a jump server / gateway.

Here's what's working:

  1. From the gateway server I can connect to the DB using both sqlplus and EF. The gateway has a ssh server.

  2. From the local PC I can start an ssh session on the gateway server (and from the ssh session I can continue with connecting to the DB using sqlplus).

This question is similar, but doesn't work (I get timeouts):

How can I connect to Oracle Database 11g server through ssh tunnel chain (double tunnel, server in company network)?

In particular, when I run plink -N -L localport:dbserver:dbport yourname@connectionserver locally on the PC, I get "session granted", but when connecting with EF from the PC, the connection request gets time out. In that case I use the gateway server as DataSource.

I've checked firewall settings, and port 1521 is open on both PC and gateway server.

UPDATED INFO: When, instead of using ssh port forwarding on the gateway, I use socat tcp-listen:1521,reuseaddr,fork,tcp:<db_server:port> as port forwarding (on the gateway), I get a response with tnsping <gateway_server> on the local PC.

EricaC
  • 131
  • 1
  • 11
  • Can you check if the database has both remote and local listener? On RAC it is the SCAN listener (remote listener) that uses port 1521 and the client gets redirected to the local listener after it connects to port 1521. You can create an ssh tunnel directly to use the local listener instead of the one using port 1521 and connect to the local listener directly from your client. – oisene Feb 02 '23 at 19:05
  • Quering the database for local_listener and for listener (remote listener) yields no results, so it seems there's no remote or local listener. Thanks. – EricaC Feb 02 '23 at 19:39

0 Answers0