LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-04-2015, 03:03 AM   #1
person_of_interest
LQ Newbie
 
Registered: Feb 2015
Posts: 19

Rep: Reputation: Disabled
Telnet / Postfix connection refused question for CENTOS 6.4


Good Morning! I am supporting the coffee and Doritos industry with my frustration with this problem. I have been battling it for two months. I have several Red Hat books, the official Red Hat study guide, and have searched the forums for weeks with no avail. I was wondering if you have ever had this?

I am trying to "telnet server.example.com 25" or telnet in general. Both servers are running on a KVM on the 192.168.122.0/24 network.


[root@server ~]# telnet server.example.com
Trying 127.0.0.1...
telnet: connect to address 127.0.0.1: Connection refused
Trying 192.168.122.191...
telnet: connect to address 192.168.122.191: Connection refused


I can ssh, run NFS, and also run internal postfix e-mails.

IPTABLES IS TURNED OFF ON BOTH CLIENTS

Postfix and Telnet is configured on both clients, with both listening:

[root@server ~]# netstat -tulpn |grep :25
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 1802/


When I Telnet from client named 'Server' to client named 'ISCSI', tpcdump on client 'ISCSI' gives the following:

19:01:23.579330 STP 802.1d, Config, Flags [none], bridge-id 8000.52:54:00:2e:85:0e.8003, length 43
19:01:23.632750 IP server.57477 > iscsi.example.com.telnet: Flags [S], seq 2403459934, win 14600, options [mss 1460,sackOK,TS val 2679191 ecr 0,nop,wscale 6], length 0
19:01:23.632882 IP iscsi.example.com.telnet > server.57477: Flags [R.], seq 0, ack 2403459935, win 0, length 0
19:01:24.428091 IP server.57478 > iscsi.example.com.telnet: Flags [S], seq 942066757, win 14600, options [mss 1460,sackOK,TS val 2679990 ecr 0,nop,wscale 6], length 0
19:01:24.428163 IP iscsi.example.com.telnet > server.57478: Flags [R.], seq 0, ack 942066758, win 0, length 0
19:01:25.006222 IP server.57479 > iscsi.example.com.telnet: Flags [S], seq 2689610466, win 14600, options [mss 1460,sackOK,TS val 2680564 ecr 0,nop,wscale 6], length 0
 
Old 02-04-2015, 05:55 AM   #2
person_of_interest
LQ Newbie
 
Registered: Feb 2015
Posts: 19

Original Poster
Rep: Reputation: Disabled
Update

I noticed that my paste showed a bad connection on the telnet loop.

Here is the correction. I think I found the problem

From client ISCSI:

[root@iscsi ~]# telnet iscsi.example.com 25
Trying 192.168.122.136...
telnet: connect to address 192.168.122.136: Connection refused
[root@iscsi ~]# vim /etc/sysconfig/network
[root@iscsi ~]# vim /etc/resolv.conf
[root@iscsi ~]# telnet iscsi.example.com
Trying 192.168.122.136...
telnet: connect to address 192.168.122.136: Connection refused

[root@iscsi ~]# telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 iscsi.example.com ESMTP Sendmail 8.14.4/8.14.4; Tue, 3 Feb 2015 21:55:21 -0500



Loop from client "Server"

[root@server ~]# telnet server.example.com 25
Trying 127.0.0.1...
Connected to server.example.com.
Escape character is '^]'.
220 server.example.com ESMTP Sendmail 8.14.4/8.14.4; Tue, 3 Feb 2015 21:53:25 -0500
 
Old 02-04-2015, 05:59 AM   #3
person_of_interest
LQ Newbie
 
Registered: Feb 2015
Posts: 19

Original Poster
Rep: Reputation: Disabled
The loop now works for both clients. The /etc/host looks like this:

client "ISCSI"

[root@iscsi ~]# cat /etc/hosts
127.0.0.1 localhost.localdomain localhost
127.0.0.1 iscsi iscsi.example.com
::1 localhost6.localdomain6 localhost6
192.168.122.136 iscsi iscsi.example.com
192.168.122.191 server server.example.com


client "Server"
[root@server ~]# cat /etc/hosts
127.0.0.1 localhost.localdomain localhost
127.0.0.1 server server.example.com
192.168.122.191 server server.example.com
::1 localhost6.localdomain6 localhost6
192.168.122.136 iscsi iscsi.example.com
 
Old 02-04-2015, 06:03 AM   #4
person_of_interest
LQ Newbie
 
Registered: Feb 2015
Posts: 19

Original Poster
Rep: Reputation: Disabled
Now when I telnet, the TCPDUMP output is:

22:05:27.111413 IP iscsi.42519 > server.telnet: Flags [S], seq 1215495062, win 14600, options [mss 1460,sackOK,TS val 623072 ecr 0,nop,wscale 6], length 0
22:05:27.114956 IP server.telnet > iscsi.42519: Flags [R.], seq 0, ack 1215495063, win 0, length 0
22:05:28.669995 IP iscsi.42520 > server.telnet: Flags [S], seq 3574758482, win 14600, options [mss 1460,sackOK,TS val 624630 ecr 0,nop,wscale 6], length 0
22:05:28.672073 IP server.telnet > iscsi.42520: Flags [R.], seq 0, ack 3574758483, win 0, length 0
 
Old 02-04-2015, 12:19 PM   #5
person_of_interest
LQ Newbie
 
Registered: Feb 2015
Posts: 19

Original Poster
Rep: Reputation: Disabled
Update

So I built two more VMs. "Server2" and "Client2". I can telnet on port 22, but no other port:

[root@server2 ~]# telnet client2 22
Trying 192.168.122.5...
Connected to client2.
Escape character is '^]'.
SSH-2.0-OpenSSH_5.3
^\
Connection closed by foreign host.
[root@server2 ~]# telnet client2 23
Trying 192.168.122.5...
telnet: connect to address 192.168.122.5: Connection refused
[root@server2 ~]# telnet client2 24
Trying 192.168.122.5...
telnet: connect to address 192.168.122.5: Connection refused
[root@server2 ~]# telnet client2 25
Trying 192.168.122.5...
telnet: connect to address 192.168.122.5: Connection refused
[root@server2 ~]# telnet client2 26
Trying 192.168.122.5...
telnet: connect to address 192.168.122.5: Connection refused
[root@server2 ~]# telnet client2 27
Trying 192.168.122.5...
telnet: connect to address 192.168.122.5: Connection refused
[root@server2 ~]# telnet client2 28
Trying 192.168.122.5...
telnet: connect to address 192.168.122.5: Connection refused
[root@server2 ~]# telnet client2 29
Trying 192.168.122.5...
telnet: connect to address 192.168.122.5: Connection refused
[root@server2 ~]# telnet client2 69
Trying 192.168.122.5...
telnet: connect to address 192.168.122.5: Connection refused
 
Old 02-04-2015, 12:32 PM   #6
descendant_command
Senior Member
 
Registered: Mar 2012
Posts: 1,876

Rep: Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643
So what are you trying to achieve?

You can't connect to a port that doesn't have a listening process attached.
 
Old 02-04-2015, 12:33 PM   #7
person_of_interest
LQ Newbie
 
Registered: Feb 2015
Posts: 19

Original Poster
Rep: Reputation: Disabled
Update,
So for no reason whatsoever, I put in the FQDN and it worked from client2 --> server2. However, still can't go from server2 --> client2

[root@client2 ~]# telnet server2.example.com 25
Trying 192.168.122.33...
Connected to server2.example.com.
Escape character is '^]'.
220 server2.example.com ESMTP Postfix
^]



[root@server2 ~]# telnet client2 25
Trying 192.168.122.5...
telnet: connect to address 192.168.122.5: Connection refused



server2 netstat

[root@server2 ~]# netstat -ln |grep :25
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN
tcp 0 0 :::25 :::* LISTEN

client2 netstat
[root@client2 ~]# netstat -ln |grep :25
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN

Last edited by person_of_interest; 02-04-2015 at 12:35 PM.
 
Old 02-04-2015, 12:37 PM   #8
person_of_interest
LQ Newbie
 
Registered: Feb 2015
Posts: 19

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by descendant_command View Post
So what are you trying to achieve?

You can't connect to a port that doesn't have a listening process attached.
Thank you for your reply!

I am trying to troubleshoot postfix within an internal network. I am using telnet to troubleshoot. I need to open a listener, like in httpd. I will research that. Thank you!
 
Old 02-04-2015, 12:47 PM   #9
person_of_interest
LQ Newbie
 
Registered: Feb 2015
Posts: 19

Original Poster
Rep: Reputation: Disabled
Update,
I did a reboot on both, and now I have two sets of listening ports....I wonder why it only worked after a reboot.

[student@client2 ~]$ netstat -ln |grep :25
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN
tcp 0 0 :::25 :::* LISTEN


[student@server2 ~]$ netstat -ln |grep :25
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN
tcp 0 0 :::25 :::* LISTEN
 
Old 02-04-2015, 12:56 PM   #10
person_of_interest
LQ Newbie
 
Registered: Feb 2015
Posts: 19

Original Poster
Rep: Reputation: Disabled
SOLVED....I guess?

So I did a reboot, and now it works. I have rebooted literally hundreds of time over the past eight weeks, so I'm not sure why today is the special day, but I can telnet and use postfix on port 25 without a firewall on. Now I will turn on IPTABLES and make sure that works. The only thing that I can think is that my BIND/NAMED hasn't been configured, and I am setting up my DNS wrong. Thanks again for your time!

[root@client2 ~]# netstat -ln |grep :25
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN
tcp 0 0 :::25 :::* LISTEN


[root@client2 ~]# mail
Heirloom Mail version 12.4 7/29/08. Type ? for help.
"/var/spool/mail/root": 2 messages 2 new
>N 1 root Wed Feb 4 12:04 18/570 "loop"
N 2 root Wed Feb 4 13:48 21/803 "3client2"


[root@server2 ~]# netstat -ln |grep :25
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN
tcp 0 0 :::25 :::* LISTEN




[root@server2 ~]# mail
Heirloom Mail version 12.4 7/29/08. Type ? for help.
"/var/spool/mail/root": 5 messages 5 new
>N 1 root Wed Feb 4 12:06 18/594 "loop"
N 2 Mail Delivery System Wed Feb 4 12:06 75/2551 "Undelivered Mail Returned to Sender"
N 3 root Wed Feb 4 13:24 21/775 "2srv2"
N 4 root Wed Feb 4 13:31 21/775 "2srv2"
N 5 root Wed Feb 4 13:48 21/772 "3srv2"
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Postfix telnet: connection refused from remote wchawaguta Linux - Software 1 11-02-2012 04:00 AM
telnet connection refused Marcusj2 Linux - Networking 22 09-07-2006 10:35 PM
telnet connection refused hcmk Linux - Networking 13 09-02-2006 02:31 PM
connection refused telnet 25 on FC 4 mmondragon Fedora 1 04-27-2006 03:58 AM
Telnet connection refused naveenpn Linux - Networking 2 02-17-2004 07:16 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:08 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration