7

This question already has an answer here:

I simply open an http server from my terminal (with node) listening on port 3000, which is obviously working if I request localhost:3000 in a browser.

Now, I want to see this connection so I use netstat.
I'm supposed to see server connection on port 3000, and client connection on another port:

$ netstat -p tcp
Proto Recv-Q Send-Q  Local Address          Foreign Address        (state) 
tcp6       0      0  localhost.hbci         localhost.50215        ESTABLISHED
tcp6       0      0  localhost.50215        localhost.hbci         ESTABLISHED
tcp6       0      0  localhost.hbci         localhost.50214        ESTABLISHED
tcp6       0      0  localhost.50214        localhost.hbci         ESTABLISHED
tcp6       0      0  localhost.hbci         localhost.50213        ESTABLISHED
tcp6       0      0  localhost.50213        localhost.hbci         ESTABLISHED
tcp6       0      0  localhost.hbci         localhost.50211        ESTABLISHED
tcp6       0      0  localhost.hbci         localhost.50212        ESTABLISHED
tcp6       0      0  localhost.50212        localhost.hbci         ESTABLISHED
tcp6       0      0  localhost.50211        localhost.hbci         ESTABLISHED
tcp6       0      0  localhost.hbci         localhost.50210        ESTABLISHED
tcp6       0      0  localhost.50210        localhost.hbci         ESTABLISHED

No entries about the server connection on port 3000. But the localhost.hbci, switching from a local to a foreign address, seems to be my server connection. And if I type:

$ lsof -i TCP:3000
COMMAND  PID        USER   FD   TYPE DEVICE             SIZE/OFF  NODE NAME
node    1144 garysounigo   11u  IPv6 0x6d9a12e1e288efc7 0t0       TCP  *:hbci (LISTEN)

I'm sure that hbci represent my port 3000.

Does anyone know something about what hbci means or refers to?
Is it a port for local server ? A protocol for s local connection?
I find anythings everywhere ( on any port.. ;) )

marked as duplicate by Jeff Schaller, Satō Katsura, Kusalananda, GAD3R, countermode Feb 20 '17 at 8:59

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • Note netstat by default does not display TCP (including TCP6) sockets in LISTEN state; to see them add -a to any version, or -l (ell) to the version usually used on Linux as your tags say but I believe not OSX as your text says. (lsof does include LISTEN, as you see.) – dave_thompson_085 Feb 19 '17 at 15:50
  • Related:   Is the same port acting as both client and server? – G-Man Oct 18 '17 at 4:40
11

Does anyone know what hbci means or refers to?

HBCI stands for "Home Banking Computer Interface", see http://openhbci.sourceforge.net/. The same port number is also used by the "RemoteWare Client", at least according to http://www.networksorcery.com/enp/protocol/ip/ports03000.htm.

The reason you are seeing it is because netstat and similar utilities look up port numbers in a database that maps them to symbolic names (usually, /etc/services).

To suppress this behavior in netstat, one can pass the --numeric-ports option, or just -n which also makes some other things numeric.

  • 2
    Amaaazing .. You are right !! Actually I think -- option are not available in OSX and dont find the equivalent - for numeric ports option for netstats in OSX. BUUUT for lsof its juts -P so with lsof -P -i TCP:3000 you gave me TCP *:3000 (LISTEN) – G.S Feb 19 '17 at 5:50
  • One last, do you the meaning difference between *:3000 and localhost:3000 – G.S Feb 19 '17 at 6:32
  • More canonically: iana.org/assignments/service-names-port-numbers/… – Jeff Schaller Feb 19 '17 at 12:26
  • 1
    @G;S: *:port is usable only for LISTEN state and means accept connections on any address and thus any interface. localhost:port or 127.0.0.1:port or ::1:port or possibly [::1]:port in LISTEN means accept on the loopback address/interface only but in other states simply means that connection is using the loopback address/interface. See man ip. – dave_thompson_085 Feb 19 '17 at 15:54
  • @dave_thompson_085 Thanks a lot; im a newbie but already see the lo network interface. This interface is used to intern service connections if i remember well – G.S Feb 19 '17 at 19:43

Not the answer you're looking for? Browse other questions tagged or ask your own question.