Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #226317 > unrolled thread

Cannot see a process listening on 127.0.0.1

Started byVictor Sudakov <vas@sibptus.ru>
First post2020-08-20 07:30 +0200
Last post2020-08-26 04:20 +0200
Articles 9 — 5 participants

Back to article view | Back to linux.debian.user


Contents

  Cannot see a process listening on 127.0.0.1 Victor Sudakov <vas@sibptus.ru> - 2020-08-20 07:30 +0200
    Re: Cannot see a process listening on 127.0.0.1 Dan Ritter <dsr@randomstring.org> - 2020-08-20 13:00 +0200
      Re: Cannot see a process listening on 127.0.0.1 Victor Sudakov <vas@sibptus.ru> - 2020-08-20 13:10 +0200
        Re: Cannot see a process listening on 127.0.0.1 Dan Ritter <dsr@randomstring.org> - 2020-08-20 13:20 +0200
          Fw: Cannot see a process listening on 127.0.0.1 Matthew Campbell <trenix25@pm.me> - 2020-08-20 14:40 +0200
    Re: Cannot see a process listening on 127.0.0.1 Andy Smith <andy@strugglers.net> - 2020-08-20 14:50 +0200
      Re: Cannot see a process listening on 127.0.0.1 Victor Sudakov <vas@sibptus.ru> - 2020-08-25 05:40 +0200
        Re: Cannot see a process listening on 127.0.0.1 Anssi Saari <as@sci.fi> - 2020-08-25 10:20 +0200
          Re: Cannot see a process listening on 127.0.0.1 Victor Sudakov <vas@sibptus.ru> - 2020-08-26 04:20 +0200

#226317 — Cannot see a process listening on 127.0.0.1

FromVictor Sudakov <vas@sibptus.ru>
Date2020-08-20 07:30 +0200
SubjectCannot see a process listening on 127.0.0.1
Message-ID<AFLjb-42c-5@gated-at.bofh.it>

[Multipart message — attachments visible in raw view] — view raw

Dear Colleagues,

There is a process listening on 127.0.0.1:8081 but for some reason
netstat/sockstat/ss do not show it listening on IPv4. Is this a bug or a
feature?

root@test4:~# telnet 127.0.0.1 8081
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
dd
HTTP/1.1 400 Bad Request
Connection: close

Connection closed by foreign host.
root@test4:~# netstat -lpn | grep 8081
tcp6       0      0 :::8081                 :::*                    LISTEN      10872/node /home/ad 
root@test4:~# 


Debian GNU/Linux 9.13 (stretch)

-- 
Victor Sudakov,  VAS4-RIPE, VAS47-RIPN
2:5005/49@fidonet http://vas.tomsk.ru/

[toc] | [next] | [standalone]


#226322

FromDan Ritter <dsr@randomstring.org>
Date2020-08-20 13:00 +0200
Message-ID<AFQsx-6XI-1@gated-at.bofh.it>
In reply to#226317
Victor Sudakov wrote: 
> Dear Colleagues,
> 
> There is a process listening on 127.0.0.1:8081 but for some reason
> netstat/sockstat/ss do not show it listening on IPv4. Is this a bug or a
> feature?
> 
> root@test4:~# telnet 127.0.0.1 8081
> Trying 127.0.0.1...
> Connected to 127.0.0.1.
> Escape character is '^]'.
> dd
> HTTP/1.1 400 Bad Request
> Connection: close
> 
> Connection closed by foreign host.
> root@test4:~# netstat -lpn | grep 8081
> tcp6       0      0 :::8081                 :::*                    LISTEN      10872/node /home/ad 

Feature-bug. It's listening on both IPv4 and IPv6; if you want to
see them differently, add the 4 or 6 flag to netstat

-dsr-

[toc] | [prev] | [next] | [standalone]


#226323

FromVictor Sudakov <vas@sibptus.ru>
Date2020-08-20 13:10 +0200
Message-ID<AFQCd-7gd-1@gated-at.bofh.it>
In reply to#226322

[Multipart message — attachments visible in raw view] — view raw

Dan Ritter wrote:
> > 
> > There is a process listening on 127.0.0.1:8081 but for some reason
> > netstat/sockstat/ss do not show it listening on IPv4. Is this a bug or a
> > feature?
> > 
> > root@test4:~# telnet 127.0.0.1 8081
> > Trying 127.0.0.1...
> > Connected to 127.0.0.1.
> > Escape character is '^]'.
> > dd
> > HTTP/1.1 400 Bad Request
> > Connection: close
> > 
> > Connection closed by foreign host.
> > root@test4:~# netstat -lpn | grep 8081
> > tcp6       0      0 :::8081                 :::*                    LISTEN      10872/node /home/ad 
> 
> Feature-bug. It's listening on both IPv4 and IPv6; if you want to
> see them differently, add the 4 or 6 flag to netstat

Nope, the -4 flag does not help:

root@test4:~# telnet localhost 8081
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
dd
HTTP/1.1 400 Bad Request
Connection: close

Connection closed by foreign host.
root@test4:~# netstat -4lpn | grep 8081
root@test4:~# 

-- 
Victor Sudakov,  VAS4-RIPE, VAS47-RIPN
2:5005/49@fidonet http://vas.tomsk.ru/

[toc] | [prev] | [next] | [standalone]


#226324

FromDan Ritter <dsr@randomstring.org>
Date2020-08-20 13:20 +0200
Message-ID<AFQLT-7jm-7@gated-at.bofh.it>
In reply to#226323
Victor Sudakov wrote: 
> Dan Ritter wrote:
> > > 
> > > There is a process listening on 127.0.0.1:8081 but for some reason
> > > netstat/sockstat/ss do not show it listening on IPv4. Is this a bug or a
> > > feature?
> > > 
> > > root@test4:~# telnet 127.0.0.1 8081
> > > Trying 127.0.0.1...
> > > Connected to 127.0.0.1.
> > > Escape character is '^]'.
> > > dd
> > > HTTP/1.1 400 Bad Request
> > > Connection: close
> > > 
> > > Connection closed by foreign host.
> > > root@test4:~# netstat -lpn | grep 8081
> > > tcp6       0      0 :::8081                 :::*                    LISTEN      10872/node /home/ad 
> > 
> > Feature-bug. It's listening on both IPv4 and IPv6; if you want to
> > see them differently, add the 4 or 6 flag to netstat
> 
> Nope, the -4 flag does not help:
> 
> root@test4:~# telnet localhost 8081
> Trying 127.0.0.1...
> Connected to localhost.
> Escape character is '^]'.
> dd
> HTTP/1.1 400 Bad Request
> Connection: close
> 
> Connection closed by foreign host.
> root@test4:~# netstat -4lpn | grep 8081
> root@test4:~# 
> 

That's a bug, then.

-dsr-

[toc] | [prev] | [next] | [standalone]


#226328

FromMatthew Campbell <trenix25@pm.me>
Date2020-08-20 14:40 +0200
Message-ID<AFS1k-7Yb-7@gated-at.bofh.it>
In reply to#226324

[Multipart message — attachments visible in raw view] — view raw

It looks like you've got a web server listening there. Try GET / HTTP/1.1 to see what it returns. You might also try port scanning 127.0.0.1 with nmap to see what it can find.

name=Matthew%20Campbell&email=trenix25%40pm.me

-------- Original Message --------
On Aug 20, 2020, 4:17 AM, Dan Ritter wrote:

> Victor Sudakov wrote:
>> Dan Ritter wrote:
>> > >
>> > > There is a process listening on 127.0.0.1:8081 but for some reason
>> > > netstat/sockstat/ss do not show it listening on IPv4. Is this a bug or a
>> > > feature?
>> > >
>> > > root@test4:~# telnet 127.0.0.1 8081
>> > > Trying 127.0.0.1...
>> > > Connected to 127.0.0.1.
>> > > Escape character is '^]'.
>> > > dd
>> > > HTTP/1.1 400 Bad Request
>> > > Connection: close
>> > >
>> > > Connection closed by foreign host.
>> > > root@test4:~# netstat -lpn | grep 8081
>> > > tcp6 0 0 :::8081 :::* LISTEN 10872/node /home/ad
>> >
>> > Feature-bug. It's listening on both IPv4 and IPv6; if you want to
>> > see them differently, add the 4 or 6 flag to netstat
>>
>> Nope, the -4 flag does not help:
>>
>> root@test4:~# telnet localhost 8081
>> Trying 127.0.0.1...
>> Connected to localhost.
>> Escape character is '^]'.
>> dd
>> HTTP/1.1 400 Bad Request
>> Connection: close
>>
>> Connection closed by foreign host.
>> root@test4:~# netstat -4lpn | grep 8081
>> root@test4:~#
>>
>
> That's a bug, then.
>
> -dsr-

[toc] | [prev] | [next] | [standalone]


#226329

FromAndy Smith <andy@strugglers.net>
Date2020-08-20 14:50 +0200
Message-ID<AFSaZ-81y-1@gated-at.bofh.it>
In reply to#226317
Hi Victor,

On Thu, Aug 20, 2020 at 12:09:03PM +0700, Victor Sudakov wrote:
> There is a process listening on 127.0.0.1:8081 but for some reason
> netstat/sockstat/ss do not show it listening on IPv4. Is this a bug or a
> feature?

I think it's listening on an IPv4-mapped IPv6 address so it can
accept either v4 or v6. Does this answer your question?

    https://unix.stackexchange.com/questions/152612/netstat-why-are-ipv4-daemons-listening-to-ports-listed-only-in-a-inet6

Daemons that want to receive connections will do the equivalent of:

    bind(address, port)

The address will determine the interface and whether it is v4 or v6
or whatever. If they instead do:

    bind(INADDR_ANY, port)

then this will bind to every interface whether it's v4 or v6 and the
daemon will get udp6 or tcp6 sockets that can from fromn/to a v4 address.

If you daemon instead had an explicit list of address/port pairs to
listen on then it would do multiple binds and I believe the IPv4
ones would show up in netstat etc as being tcp4.

Cheers,
Andy

-- 
https://bitfolk.com/ -- No-nonsense VPS hosting

[toc] | [prev] | [next] | [standalone]


#226483

FromVictor Sudakov <vas@sibptus.ru>
Date2020-08-25 05:40 +0200
Message-ID<AHxYt-3hl-3@gated-at.bofh.it>
In reply to#226329

[Multipart message — attachments visible in raw view] — view raw

Andy Smith wrote:
> 
> On Thu, Aug 20, 2020 at 12:09:03PM +0700, Victor Sudakov wrote:
> > There is a process listening on 127.0.0.1:8081 but for some reason
> > netstat/sockstat/ss do not show it listening on IPv4. Is this a bug or a
> > feature?
> 
> I think it's listening on an IPv4-mapped IPv6 address so it can
> accept either v4 or v6. Does this answer your question?
> 
>     https://unix.stackexchange.com/questions/152612/netstat-why-are-ipv4-daemons-listening-to-ports-listed-only-in-a-inet6
> 
> Daemons that want to receive connections will do the equivalent of:
> 
>     bind(address, port)
> 
> The address will determine the interface and whether it is v4 or v6
> or whatever. If they instead do:
> 
>     bind(INADDR_ANY, port)
> 
> then this will bind to every interface whether it's v4 or v6 and the
> daemon will get udp6 or tcp6 sockets that can from fromn/to a v4 address.

Thank you, Andy, that explains it. 

It's different in *BSD which got me confused. In *BSD, even if you bind
to INADDR_ANY, you'll see something like this in sockstat output:

root     dovecot    39601 21 tcp4   *:110                 *:*
root     dovecot    39601 22 tcp6   *:110                 *:*
root     dovecot    39601 23 tcp4   *:995                 *:*
root     dovecot    39601 24 tcp6   *:995                 *:*

-- 
Victor Sudakov,  VAS4-RIPE, VAS47-RIPN
2:5005/49@fidonet http://vas.tomsk.ru/

[toc] | [prev] | [next] | [standalone]


#226485

FromAnssi Saari <as@sci.fi>
Date2020-08-25 10:20 +0200
Message-ID<AHClr-61l-7@gated-at.bofh.it>
In reply to#226483
Victor Sudakov <vas@sibptus.ru> writes:

> It's different in *BSD which got me confused. In *BSD, even if you bind
> to INADDR_ANY, you'll see something like this in sockstat output:
>
> root     dovecot    39601 21 tcp4   *:110                 *:*
> root     dovecot    39601 22 tcp6   *:110                 *:*
> root     dovecot    39601 23 tcp4   *:995                 *:*
> root     dovecot    39601 24 tcp6   *:995                 *:*

Well, what about using ss instead of netstat on Linux? I don't seem to
have any daemon running that would show different with netstat or ss so
can't check.

[toc] | [prev] | [next] | [standalone]


#226488

FromVictor Sudakov <vas@sibptus.ru>
Date2020-08-26 04:20 +0200
Message-ID<AHTcB-7HV-1@gated-at.bofh.it>
In reply to#226485

[Multipart message — attachments visible in raw view] — view raw

Anssi Saari wrote:
> Victor Sudakov <vas@sibptus.ru> writes:
> 
> > It's different in *BSD which got me confused. In *BSD, even if you bind
> > to INADDR_ANY, you'll see something like this in sockstat output:
> >
> > root     dovecot    39601 21 tcp4   *:110                 *:*
> > root     dovecot    39601 22 tcp6   *:110                 *:*
> > root     dovecot    39601 23 tcp4   *:995                 *:*
> > root     dovecot    39601 24 tcp6   *:995                 *:*
> 
> Well, what about using ss instead of netstat on Linux? I don't seem to
> have any daemon running that would show different with netstat or ss so
> can't check.

Basically the same:

root@test4:~# netstat -lpn | grep 8081
tcp6       0      0 :::8081                 :::*                    LISTEN      10872/node /home/ad 
root@test4:~# ss -ln | grep 8081
tcp    LISTEN     0      128      :::8081                 :::*
root@test4:~# 


-- 
Victor Sudakov,  VAS4-RIPE, VAS47-RIPN
2:5005/49@fidonet http://vas.tomsk.ru/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.user


csiph-web