1

On Server A CentOS 7, I enabled an iscsi target at portal 192.168.1.101:3260 (that ip is one of A's ips), so that from another Server B I can mount that iscsi target on Server A successfully.

From both Server B and Server A I can also do telnet 192.168.1.101 3260 successfully.

However, on server A lsof -i -P |grep 3260 show nothing!

Selinux is enabled, although disabling it does not make any difference.

There are multiple interfaces configured on Server A, maybe that was the reason? How to view that working port in lsof?

Edit: all commands were run in the root account.

Thomas
  • 4,155
  • 5
  • 21
  • 28
John
  • 369
  • 1
  • 4
  • 13

1 Answers1

1

It seems that target daemon is not actually listening on that port, a kernel module does the listening. The netstat and its modern substitute ss start from the available sockets so they will show an open socket.

On the other hand lsof starts from a list of processes and from there digs to their files and sockets, so it has a problem to actually find all open sockets/files on a system.

kubanczyk
  • 13,502
  • 5
  • 40
  • 55
  • Ok, this would explain the symptom if true, so I accepted your reply. On the other hand then it would be quite disturbing that lsof does not show all the running applications and their open ports. How do I find the mapping of that port 3260 to the application then? – John Aug 04 '17 at 18:00
  • You find (via `ss -lntp` or `netstat -lntp`) that no user-space process listens on this socket, but the socket is indeed open and listening. A kernel module is not an "application" and how to survey all the kernel-space sockets is beyond me. A [similar answer](https://serverfault.com/a/355859/9461). – kubanczyk Aug 04 '17 at 21:56
  • Ok, the above answer and the link are very helpful, thanks. – John Aug 05 '17 at 04:25