Linode Forum
https://forum.linode.com/

Telnet localhost 25 test not working - SOLVED!
https://forum.linode.com/viewtopic.php?f=19&t=3766
Page 1 of 2

Author:  Bedevere [ Fri Dec 26, 2008 7:43 pm ]
Post subject:  Telnet localhost 25 test not working - SOLVED!

Maybe someone can clear this mystery up.

I am running SuSe 11.1 and am testing out an Exim config, and wanted to confirm everything. I ran "telnet localhost 25" and got "trying 127.0.0.1...." and it just sits there. My local carrier seems to block outbound 25 so i knew testing from home was a waste.

I have already received mail form the system so I know it is working but I am troubled that I cannot telnet locally. I also want to be sure it will accept incoming mail before I move the domain dns over.

* I have tried without a firewall installed
* I have confirmed exim is set up on 25 and 587 (using daemon_smtp_ports = 25 : 587) I have been able to telenet in from home on port 587.
* Exim hostlist contains 127.0.0.1
* Telnet doesn't seem to want to work for anything local!

Anyway if I am missing something please let me know. I have been running SuSE 10x servers for work and at home without any issue so I am a little baffled.

As an aside I did remove the default SuSE firewall and am using Firehol, but as I mentioned above even without a firewall installed localhost telnet doesn't seem to work.

Thanks in advance!

Author:  Alucard [ Fri Dec 26, 2008 7:52 pm ]
Post subject: 

post the output of the following (run as root)

/sbin/ifconfig -a
netstat -anp |grep " LISTEN "
grep "^[^#]" /etc/hosts

Author:  Bedevere [ Sat Dec 27, 2008 3:26 am ]
Post subject: 

First I hope you dont mind I Xed out my IP. Secondly I noticed that in my hosts has my IP as "server1.oi-guild.com" but I havn't moved my domain over yet. Should I make that the default Linode DNS entry (The members.linode.com one)?

Code:
server1:~ # /sbin/ifconfig -a
dummy0    Link encap:Ethernet  HWaddr 1E:0E:F8:67:6D:A7
          BROADCAST NOARP  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

eth0      Link encap:Ethernet  HWaddr FE:FD:CF:C0:46:9E
          inet addr:XXX.XXX.XXX.XXX  Bcast:XXX.XXX.XXX.XXX  Mask:255.255.255.0
          inet6 addr: fe80::fcfd:cfff:fec0:469e/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3212 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2427 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:825890 (806.5 Kb)  TX bytes:2044446 (1.9 Mb)

gre0      Link encap:UNSPEC  HWaddr 00-00-00-00-3A-34-36-39-00-00-00-00-00-00-00-00
          NOARP  MTU:1476  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

ip6tnl0   Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
          NOARP  MTU:1460  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

lo        Link encap:Local Loopback
          LOOPBACK  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

sit0      Link encap:IPv6-in-IPv4
          NOARP  MTU:1480  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

teql0     Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
          NOARP  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:100
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

tunl0     Link encap:IPIP Tunnel  HWaddr
          NOARP  MTU:1480  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)


server1:~ # netstat -anp |grep " LISTEN "
tcp        0      0 0.0.0.0:587             0.0.0.0:*               LISTEN      3448/exim
tcp        0      0 0.0.0.0:21              0.0.0.0:*               LISTEN      3602/vsftpd
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      4574/sshd
tcp        0      0 0.0.0.0:25              0.0.0.0:*               LISTEN      3448/exim
tcp        0      0 :::587                  :::*                    LISTEN      3448/exim
tcp        0      0 :::80                   :::*                    LISTEN      3582/httpd2-prefork
tcp        0      0 :::22                   :::*                    LISTEN      4574/sshd
tcp        0      0 :::25                   :::*                    LISTEN      3448/exim

server1:~ # grep "^[^#]" /etc/hosts
127.0.0.1       localhost
::1             localhost ipv6-localhost ipv6-loopback
fe00::0         ipv6-localnet
ff00::0         ipv6-mcastprefix
ff02::1         ipv6-allnodes
ff02::2         ipv6-allrouters
ff02::3         ipv6-allhosts
XXX.XXX.XXX.XXX  server1.oi-guild.com server1


Author:  Alucard [ Sat Dec 27, 2008 10:31 am ]
Post subject: 

Ok, that confirms that exim is listening on all available addresses (ipv4 and v6) on ports 25 and 587. Try:
Code:
ifup lo

then restarting exim, and try telnet again. You're missing a key line, here's part of mine:
Code:
alucard@thrawn:~$ /sbin/ifconfig lo
lo        Link encap:Local Loopback 
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          [snip]


The name in /etc/hosts shouldn't matter unless you need to use the old server1.oi-guild.com from this Linode.

Author:  weave [ Sat Dec 27, 2008 5:13 pm ]
Post subject:  Other reasons

There's a lot of reasons why you can't connect to a port even though it's showing as listening. Some other areas to check besides what's been already mentioned are /etc/hosts.deny and any firewall rules (iptables -L -n)

Also check your /var/log/messages and secure files for hints.

Author:  Bedevere [ Sat Dec 27, 2008 11:27 pm ]
Post subject: 

ifup gets me:
Code:
server1:~ # ifup lo
    lo
RTNETLINK answers: Invalid argument
Cannot enable interface lo.
interface lo is not up


Guess that explains part of it.

I have been letting Linode manage my IP via dhcp and have not set my address to static, which I guess I should.

/etc/hosts.deny:
http-rman : ALL EXCEPT LOCAL

/etc/hosts.allow is completely remarked out.



/var/log/warn had this:
Dec 27 21:55:37 server1 ifup: Cannot enable interface lo.
Dec 27 21:55:37 server1 ifup-route: interface lo is not up
Dec 27 21:55:51 server1 ifup: Cannot enable interface lo.
Dec 27 21:55:51 server1 ifup-route: interface lo is not up

I think we have a problem....

Author:  weave [ Sun Dec 28, 2008 9:27 am ]
Post subject:  ifcfg-lo

Do you have an ifcfg-lo file somewhere? On my distro (Centos) it's in /etc/sysconfig/network-scripts. If so, what is in it? Mine says...

DEVICE=lo
IPADDR=127.0.0.1
NETMASK=255.0.0.0
NETWORK=127.0.0.0
# If you're having problems with gated making 127.0.0.0/8 a martian,
# you can change this to something else (255.255.255.255, for example)
BROADCAST=127.255.255.255
ONBOOT=yes
NAME=loopback

On my ubuntu install at home it has a file /etc/network/interfaces and it contains this...

auto lo
iface lo inet loopback

Author:  Bedevere [ Sun Dec 28, 2008 11:13 am ]
Post subject: 

Code:
ifcfg-lo:

# Loopback (lo) configuration
IPADDR=127.0.0.1
NETMASK=255.0.0.0
NETWORK=127.0.0.0
BROADCAST=127.255.255.255
IPADDR_2=127.0.0.2/8
STARTMODE=onboot
USERCONTROL=no
FIREWALL=no


Code:
ifcfg-eth0:

BOOTPROTO='dhcp'
STARTMODE='auto'
NAME=''
BROADCAST=''
ETHTOOL_OPTIONS=''
IPADDR=''
MTU=''
NETWORK=''
REMOTE_IPADDR=''
USERCONTROL='no'
NETMASK=''


I have tried to set my static address to the settings I see in my control panel but I get an error on the netmask onm reboot...then its back to the ajax console...and I need to reset the character set because that screen isn't easy.

I am confised as to why "IPADDR_2=127.0.0.2/8" i in there....

Also should I have a "NAME=loopback" in the ifcfg-lo? I thought Name was an optional field.

Author:  Bedevere [ Sun Dec 28, 2008 11:16 am ]
Post subject: 

I am seeing soemthing about the ifroute-lo file that one might need to put "127/8" in it.

Any thoughts on that?


EDIT: Ignore this - I have that already...


To add tot he mystery mySQL is connecting via localhost fine. So it may be purely a telnet issue?

Author:  Bedevere [ Sun Dec 28, 2008 11:40 am ]
Post subject: 

OK seems lo is not coming up:

Code:
FireHOL: Saving your old firewall to a temporary file: OK
FireHOL: Processing file /etc/firehol/firehol.conf: OK
FireHOL: Activating new firewall (355 rules): OK
Setting up network interfaces:
    lo
RTNETLINK answers: Invalid argument
Cannot enable interface lo.
interface lo is not up                                               failed
    eth0
RTNETLINK answers: Invalid argument
    eth0      (DHCP) . . IP/Netmask: 'xxx.xxx.xxx.xxx' / '255.255.255.0' ('lixx-xxx')
RTNETLINK answers: Invalid argument
Cannot enable interface eth0.                                        failed
    gre0
              No configuration found for gre0                        unused
    ip6tnl0
              No configuration found for ip6tnl0                     unused
    teql0
              No configuration found for teql0                       unused
    tunl0
              No configuration found for tunl0                       unused
    eth0
    eth0      DHCP client (dhcpcd) is running
    eth0      IP address: XXX.XXX.XXX.XXX/24                          done
Setting up service network  .  .  .  .  .  .  .  .  .  .  .  .  .  . done.
Starting vsftpd                                                      done
Starting CRON daemon                                                 done
Starting SSH daemon                                                  done
Starting service xdm                                                 unused
Initializing SMTP port (exim)                                        done
Starting service MySQL                                               done
Starting httpd2 (prefork)                                            done
Master Resource Control: runlevel 5 has been                         reached
Skipped services in runlevel 5:                                acpid xdm


Welcome to openSUSE 11.0 (i586) - Kernel 2.6.18.8-linode10 (tty1).


(note: Xs are mine)
Now what seems odd is if eth0 is not up how am I connecting?

Author:  mwalling [ Sun Dec 28, 2008 12:20 pm ]
Post subject: 

try bringing up lo by hand:
Code:
ifconfig lo 127.0.0.1 netmask 255.0.0.0

see if its a real problem, or overcomplicated do everything including cleaning the kitchen sink distro networking scripts

Author:  Internat [ Sun Dec 28, 2008 6:07 pm ]
Post subject: 

When you said you can connect to mysql on localhost, are you typing "localhost" or "127.0.0.1" ?

If you use "localhost", it will connect via Unix Sockets, rather then via the Loop back adapter, where as if you use 127.0.0.1 it connects via TCP..

Author:  Bedevere [ Sun Dec 28, 2008 10:08 pm ]
Post subject: 

mwalling wrote:
try bringing up lo by hand:
Code:
ifconfig lo 127.0.0.1 netmask 255.0.0.0

see if its a real problem, or overcomplicated do everything including cleaning the kitchen sink distro networking scripts


This worked!

I was able to telnet localhost after I ran that....so how to fix it?

Author:  mwalling [ Sun Dec 28, 2008 11:02 pm ]
Post subject: 

well, somethings screwed up somewhere in your distro's configs. using ifconfig to bring it up is really a band-aid... you should see what is broken and fix it.

Author:  seanmb [ Mon Dec 29, 2008 2:26 am ]
Post subject: 

I am seeing the same behavior on recent SUSE 11.0 linode distribution load.

By setting
Code:
# grep DEBUG /etc/sysconfig/network/config
DEBUG="yes"

I was able to get a bit more details out of 'ifup'

Code:
# ifup lo -o rc onboot
lo -o rc onboot

lo
lo lo -o rc onboot
unknown option rc ignored
'lo' is not wireless, exiting
RTNETLINK answers: Invalid argument
Cannot enable interface lo.
lo lo -o rc onboot
interface lo is not up
lo lo -o rc onboot
unknown option rc
No services to handle for 'lo lo'
executing additional global start script if-up.d/60-dhcp6c
executing additional global start script if-up.d/SuSEfirewall2
executing additional global start script if-up.d/freeswan


(the parameters on 'ifup' are as it is called in /etc/init.d/network)

Some how it seems to want to go into a section that is trying to set wireless parameters and errors out. I am plugging away trying to trace this down, but my ability to read shell scrips as complex as 'ifup' is a little weak. So the going is rather slow. Anyone with a suggestion on where to look would be welcome.

Page 1 of 2 All times are UTC-04:00
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/