LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 10-12-2011, 06:28 AM   #1
gettons1980
LQ Newbie
 
Registered: Jun 2008
Posts: 21

Rep: Reputation: 0
lsof and nfs connections


Hi all,


while I was playing with lsof and netstat I noticed something strange, or at least something I couldn't figure it out.

I have an nfs v3 share mounted and I can see the connection established with the server by running netstat.
Quote:
[root@MYHOST ~]# netstat -natpl | grep ':2049'
tcp 0 0 0.0.0.0:2049 0.0.0.0:* LISTEN -
tcp 0 152 10.241.95.183:667 10.241.95.101:2049 ESTABLISHED -
tcp 0 0 10.241.95.183:1005 10.241.95.101:2049 ESTABLISHED -
tcp 0 0 10.200.31.195:1011 10.241.102.135:2049 ESTABLISHED -
tcp 0 0 10.241.95.183:985 10.241.95.100:2049 ESTABLISHED -
tcp 0 0 10.241.95.183:909 10.241.95.100:2049 ESTABLISHED -
tcp 0 0 10.241.95.183:937 10.241.95.100:2049 ESTABLISHED -
tcp 0 0 10.241.95.183:817 10.241.95.100:2049 ESTABLISHED -
I was expecting to see this connection also by running lsof, but this is not the case.

[QUOTE]
-
[root@MYHOST ~]# lsof -nn -P -i | grep '2049'
[root@MYHOST ~]# lsof -nn -P | grep '2049'



Could you clarify this point to me please ?
 
Old 10-12-2011, 06:50 AM   #2
foodown
Member
 
Registered: Jun 2009
Location: Texas
Distribution: Slackware
Posts: 611

Rep: Reputation: 220Reputation: 220Reputation: 220
You need to add the -N flag.

Last edited by foodown; 10-12-2011 at 07:00 AM.
 
Old 10-12-2011, 07:27 AM   #3
gettons1980
LQ Newbie
 
Registered: Jun 2008
Posts: 21

Original Poster
Rep: Reputation: 0
Hi there,


actually lsof -N displays just nfs files related, but by running lsof it should pick all type of files.
I have also tried -N option anyway but nothing changed ( see below )
What I am looking for is not the open file ( in this case the test file I am editing with vi ) but the actual tcp connection established with the nfs server.

Quote:
[root@MYHOST ~]# lsof -nn -P| grep '10.241.121.82'
sshd 3936 root 3u IPv6 42305517 TCP 10.200.31.87:22->10.241.121.82:37833 (ESTABLISHED)
sshd 3941 lcp25o 3u IPv6 42305517 TCP 10.200.31.87:22->10.241.121.82:37833 (ESTABLISHED)
vim 22169 root 3u REG 0,28 12288 18087950 /media/.test.swp (10.241.121.82:/media)
sshd 22189 root 3u IPv6 42340155 TCP 10.200.31.87:22->10.241.121.82:39429 (ESTABLISHED)
sshd 22191 lcp25o 3u IPv6 42340155 TCP 10.200.31.87:22->10.241.121.82:39429 (ESTABLISHED)

[root@MYHOST ~]# lsof -nn -P -N | grep '10.241.121.82'
vim 22169 root 3u REG 0,28 12288 18087950 /media/.test.swp (10.241.121.82:/media)
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
NFS problem, no tcp connections port 2049. pacowe Linux - Networking 16 05-04-2011 04:47 AM
[SOLVED] NFS mount fails (times out): NFS server is in DMZ, NFS client is in intranet Hiroshi Linux - Networking 2 05-24-2010 10:22 AM
NFS: not recovering from dropped connections Kropotkin Linux - Networking 5 01-10-2008 01:15 PM
Active connections conundrum involving lsof / netstat output uncle-c Linux - Newbie 8 12-09-2007 10:56 AM
ssh and nfs connections refused by Linux host running RedHat 9.0 and having 2 NIC erinduffy Linux - Networking 1 01-21-2005 11:13 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 04:53 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration