12

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

2

1 Answer 1

17

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.

5
  • 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
    Commented Feb 19, 2017 at 5:50
  • 1
    One last, do you the meaning difference between *:3000 and localhost:3000
    – G.S
    Commented Feb 19, 2017 at 6:32
  • More canonically: iana.org/assignments/service-names-port-numbers/…
    – Jeff Schaller
    Commented Feb 19, 2017 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. Commented Feb 19, 2017 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
    Commented Feb 19, 2017 at 19:43

Not the answer you're looking for? Browse other questions tagged .