Ask Your Question

Cannot telnet to a port

asked 2017-11-01 07:41:16 -0500

mak87 gravatar image


I am using the following command to telnet to a port on localhost, but it say the following

telnet localhost 50015
telnet: connect to address Connection refused
Trying ::1...
telnet: connect to address ::1: No route to host

The main issue is, when I am trying to connect to a DB2 database on that port it shows the below message and there is no other port that I can use.

Cannot connect to 'localhost' on port 50015

I have disabled the firewall and checkd its the same, actually the port is not at all showing up

netstat -tap | grep 50015

Do I need to make that port LISTEN?Do I have to create a service, if so then what service should I create? I am really confused with what to do.

I would really appreciate any help regarding this.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2017-11-01 11:52:17 -0500

villykruse gravatar image

You have to go through the procedure of setting up a DB2 server, the details of which I no longer remember. You will need to read the install guide provided by IBM.

I should add the -n option to netstat; otherwise the portnumber may be translated to a service name, and the grep would not work. Thus:

netstat -tapn | grep 50015

alternatively, using the newer and more powerful command

ss -tapn | grep 50015

And yes, you do need to make the listen port, and you do that by installing the DB2 server and configure it.

edit flag offensive delete link more


Thanks for replying!

Both of the command shows nothing. Previously I used to connect to the remote DB2 server using a DB client from windows where DB2 was installed locally and it worked properly. The same thing I am doing in fedora and it's not working.

Just to let you know that I am using tunneling to connect to the remote DB2.

I do not have the DB2 server locally which I am trying to connect to, it's a remote DB2 server. I am just using DBVisualizer to connect to it, do I still have to setup the DB2 server in my local machine.

mak87 gravatar imagemak87 ( 2017-11-02 00:56:53 -0500 )edit

DBVisualizer works fine with DB2, But you would need to specify the real host name or IP number of the server where the DB2 database is installed. Using tunnelling complicates things quite a bit, but whoever set up the tunnel should be able to tell you the host name and port number you should be connecting to to reach the DB2 server.

villykruse gravatar imagevillykruse ( 2017-11-02 07:03:16 -0500 )edit

I tried to connect a couple of times with DBVisualizer, but it didn't worked, I also have all the DB2 drivers in place. The issue was same

Cannot connect to 'localhost' on port 50015

Hence I started to find the port(50015), it just did not show up in my local. So my main concern was that, tunneling is the second priority, first one is at least I should get a ping from localhost and that port. Al least it should be in a LISTNING state(correct me if I am wrong).

Just no idea of how to proceed with this. Please let me know if have any other alternative.

mak87 gravatar imagemak87 ( 2017-11-02 07:54:50 -0500 )edit

As I wrote: specify the real host name or IP number. The server is not running on localhost so you would not be able to connect to it at localhost. If the DB2 server is running on a system with IP number, then you connect DBVisualizer to instead of localhost.

villykruse gravatar imagevillykruse ( 2017-11-02 10:50:44 -0500 )edit

You say you are using tunnelling, but you don't say how you set that up.

ssieb gravatar imagessieb ( 2017-11-02 16:49:38 -0500 )edit

Question Tools

1 follower


Asked: 2017-11-01 07:41:16 -0500

Seen: 300 times

Last updated: Nov 01 '17