netcat is blocked, telnet gets connection

2

I'm trying to install an svn server on my linux machine (ubuntu 9.04). I copied a line to start svnserve to the inetd.conf file and restarted inetd. But I'm not able to connect with an svn client to the server. I always get the error message

connection refused

Now comes the strange part: If I call

netcat localhost 3690

the connection is refused, too. But if I call

telnet localhost 3690

I get some responses from svnserve.

Any ideas what could be the cause of this - and how I can make my svnserver work?


Some more details:

  • I installed inetutils-inetd (Version 2:1.6-1)
  • netstat gives me the line

    tcp6 0 0 :::3690 :::* LISTEN

  • If I disable all the "special IPv6 addresses" in /etc/hosts, telnet stops to work and gives me a "connection refused", too.

  • I tried to activate the daytime service of inetd (port 13). Same behaviour: netcat isn't able to connect, telnet is.
  • As far as I can see there is no firewall (ufw is installed but not enabled).

tangens

Posted 2010-09-30T20:31:01.533

Reputation: 1 230

Answers

1

Netcat only does IPv4, and the server is only listening on IPv6.

Try setting this kernel option, then killing and restarting inetd:

sysctl net.ipv6.bindv6only=0

(And change the inetd service line to tcp. About time you start using v6)

user1686

Posted 2010-09-30T20:31:01.533

Reputation: 283 655

net.ipv6.bindv6only is already 0. But I found a bug report, that inetutils-inetd only listens to ipv6 if not specified otherwise. – tangens – 2010-09-30T21:20:23.707

@tangens: I recommend switching to xinetd, it works well with both v4 and (if flags = IPv6) v6. – user1686 – 2010-10-01T18:10:29.293

xinetd was installed by default, but I'm not familiar with its syntax, so I switched back to good old inetd. Perhaps I should give xinetd a try... – tangens – 2010-10-01T18:26:53.013

@tangens: xinetd does support the inetd.conf syntax and will read the file. Although I'm not sure how it interprets tcp in it. – user1686 – 2010-10-01T19:54:23.900

0

I found the answer myself...

The problem was this line in the inetd.conf:

svn stream tcp nowait subversion /usr/bin/svnserve svnserve -i -r /home/svn

After switching the keyword tcp to tcp4 everything works fine. Now netstat gives me this output:

tcp        0      0 0.0.0.0:3690            0.0.0.0:*               LISTEN

tangens

Posted 2010-09-30T20:31:01.533

Reputation: 1 230