0

I am looking for some clarification on the following netstat results. The following results are showing 3 java processes. Is there a way to find which java programs are they referring to?

Another clarification I am looking for is, I have completed disabled tcp6 in my machine. However, the netstat results still show tcp6 in the output. Why so?

# netstat -tulpn
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:8080            0.0.0.0:*               LISTEN      7605/java
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      820/sshd
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      2020/master
tcp        0      0 0.0.0.0:8443            0.0.0.0:*               LISTEN      7605/java
tcp        0      0 0.0.0.0:9990            0.0.0.0:*               LISTEN      7605/java
tcp6       0      0 :::80                   :::*                    LISTEN      823/httpd
tcp6       0      0 :::22                   :::*                    LISTEN      820/sshd
tcp6       0      0 ::1:25                  :::*                    LISTEN      2020/master
udp        0      0 0.0.0.0:34754           0.0.0.0:*                           623/dhclient
udp        0      0 0.0.0.0:68              0.0.0.0:*                           623/dhclient
udp6       0      0 :::31623                :::*                                623/dhclient
  • 1
    That seems to be a single process (PID 7605) that is listening on 3 ports (HTTP + HTTPS + ??) - you might get more information by searching the PID e.g. ps -fp 7605 – steeldriver Jun 20 '18 at 13:41
  • @steeldriver, certain services are listening in the loopback address 127.0.0.1:8080 and certain things looks like this 0.0.0.0:8080, is there any difference between this two ? – Gokulnath Kumar Jun 21 '18 at 7:04
  • 0.0.0.0:8080 will accept connections on the machine's external network interfaces, whereas 127.0.0.1:8080 would only accept loopback (internal) connections – steeldriver Jun 21 '18 at 7:13
1

Use --protocol flag for filter by tcp4.

netstat --protocol inet -4 will show you only ipv4 sockets.

As for Java processes you have PIDS in netstat output. Use it by ps command find your Java programs.

  • My question was not about filtering ipv4 sockets. As i have disabled ipv6 in my machine, why am I seeing ipv4 sockets in the result? – Gokulnath Kumar Jun 20 '18 at 17:30
1

The listening on ipv6 sockets are built into those processes. That is the characteristic of those processes itself and I think can't be disabled unless you compile those applications with the relevant ipv6 configuration.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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