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


Groups > linux.debian.user > #226329

Re: Cannot see a process listening on 127.0.0.1

From Andy Smith <andy@strugglers.net>
Newsgroups linux.debian.user
Subject Re: Cannot see a process listening on 127.0.0.1
Date 2020-08-20 14:50 +0200
Message-ID <AFSaZ-81y-1@gated-at.bofh.it> (permalink)
References <AFLjb-42c-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

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

csiph-web