I'm unable to run telnet on localhost 25, how do I fix it? [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 daemonsmtpports = 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!

20 Replies

post the output of the following (run as root)

/sbin/ifconfig -a

netstat -anp |grep " LISTEN "

grep "^[^#]" /etc/hosts

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)?

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

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

ifup lo

then restarting exim, and try telnet again. You're missing a key line, here's part of mine:

[email protected]:~$ /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.

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.

ifup gets me:

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….

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

````
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


ifcfg-eth0:

BOOTPROTO='dhcp'
STARTMODE='auto'
NAME=''
BROADCAST=''
ETHTOOLOPTIONS='' IPADDR='' MTU='' NETWORK='' REMOTEIPADDR=''
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.

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?

OK seems lo is not coming up:

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?

try bringing up lo by hand:

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

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..

@mwalling:

try bringing up lo by hand:

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?

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.

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

By setting

# grep DEBUG /etc/sysconfig/network/config
DEBUG="yes"

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

# 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.

SuSE is wireless happy. They insist on adding all sorts of wireless functionality to a server.

We might have to take this over to the Novell people. At least I have a support contract with them!

I found what was causing the error, in 'ifup' @ line 1033 it calls 'ip link …" which fails.

# ip link set up dev lo
RTNETLINK answers: Invalid argument

Have not been able to discover the reason for the failure. This line is suppose to bring up the interface. 'ifconfig $INTERFACE up' will also bring up the interface.

Until I get a real fix for 'ip link set …", I have changed the following starting at line 1033 in /sbin/ifup

         #if ! ip link set up dev $INTERFACE \
         #        ${LLADDR:+address $LLADDR} $LINK_OPTIONS; then
         # 'ip link set' is broken using ifconfig SB
         if ! ifconfig $INTERFACE up; then

This gets me a lo and starts eth0 at the proper location. (Eth0 was also failing initially, then kick-started in the DHCP section a bit later.)

In setting up eth0 there is one other location that "ip …" will fail. But it is not currently causing me an issue so I will not look into that until later.

I going to be submitting a ticket with Linode to get this looked at, I believe it is a problem specific to the linode build as I do not see the issue on other systems that I have with SUSE 11.0 on them.

This seems to be an issue with the 'Latest 2.6 Series (2.6.18.8-linode10)' kernel.

Mike from Linode support suggested that I try rebooting with '2.6.27.4-linode14' as the kernel selected. With this kernel, startup scripts look to be working as expected.

@seanmb:

This seems to be an issue with the 'Latest 2.6 Series (2.6.18.8-linode10)' kernel.

Mike from Linode support suggested that I try rebooting with '2.6.27.4-linode14' as the kernel selected. With this kernel, startup scripts look to be working as expected.

No other issues around the different kernel?

BTW good find there.

I switched kernels and rebooted and lo came up perfectly. Thanks for sharing that info!

BTW: I like how if you launch the ajax console before booting you can watch the boot process.

@Bedevere:

BTW: I like how if you launch the ajax console before booting you can watch the boot process.

You should be able to do that as well if you ssh to your [email protected]

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct