Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
how to force mount to use a specific port in nfs?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
DaggyStyle
Watchman
Watchman


Joined: 22 Mar 2006
Posts: 5587

PostPosted: Tue Mar 23, 2010 1:16 pm    Post subject: how to force mount to use a specific port in nfs? Reply with quote

I have my portage defined as nfs on my server, when I want to mount the nfs on my laptop so I can sync, for some reason, the client uses random and different ports, that is a problem because the firewall blocks the packets.
I've tried adding port=port to fstab but it doesn't matters...
how can I force the client to use a specific port?
_________________
Only two things are infinite, the universe and human stupidity and I'm not sure about the former - Albert Einstein
Back to top
View user's profile Send private message
richard.scott
Veteran
Veteran


Joined: 19 May 2003
Posts: 1497
Location: Oxfordshire, UK

PostPosted: Tue Mar 23, 2010 2:07 pm    Post subject: Reply with quote

From googling this up:

Quote:
port=num — Specifies the numeric value of the NFS server port. If num is 0 (the default), then mount queries the remote host's portmapper for the port number to use. If the remote host's NFS daemon is not registered with its portmapper, the standard NFS port number of TCP 2049 is used instead


I would assume that you would have to re-configure your nfs server to listen on that port. Also, you need to allow portmapper through your firewall to allow connections. Perhaps your firewall is miss-configured rather than the NFS setup being a problem
?
Where is the firewall that is causing problems? on the server, on the laptop or in between?

Is it possible to put the laptop on the same network as the NFS server (without firewall) and test?
Back to top
View user's profile Send private message
fangorn
Veteran
Veteran


Joined: 31 Jul 2004
Posts: 1886

PostPosted: Tue Mar 23, 2010 2:14 pm    Post subject: Reply with quote

Quote:
, for some reason

The reason is design. :wink:

NFS up to version 3 uses multiple daemons. Responsible for this behaviour is portmap. AFAIK you cannot fix NFS v3.x to a specific port.

NFS v4 AFAIK has the ability to specify a port and protocol for the connection - amongst multiple other changes/improvements/annoyances :twisted:

In short:
If you have to go through a firewall, you are better off using Samba.
_________________
Video Encoding scripts collection | Project page
Back to top
View user's profile Send private message
DaggyStyle
Watchman
Watchman


Joined: 22 Mar 2006
Posts: 5587

PostPosted: Tue Mar 23, 2010 2:29 pm    Post subject: Reply with quote

richard.scott wrote:
From googling this up:

Quote:
port=num — Specifies the numeric value of the NFS server port. If num is 0 (the default), then mount queries the remote host's portmapper for the port number to use. If the remote host's NFS daemon is not registered with its portmapper, the standard NFS port number of TCP 2049 is used instead


I would assume that you would have to re-configure your nfs server to listen on that port. Also, you need to allow portmapper through your firewall to allow connections. Perhaps your firewall is miss-configured rather than the NFS setup being a problem
?
Where is the firewall that is causing problems? on the server, on the laptop or in between?

Is it possible to put the laptop on the same network as the NFS server (without firewall) and test?

sadly, I've seen this but it is no go...

fangorn wrote:
Quote:
, for some reason

The reason is design. :wink:

NFS up to version 3 uses multiple daemons. Responsible for this behaviour is portmap. AFAIK you cannot fix NFS v3.x to a specific port.

NFS v4 AFAIK has the ability to specify a port and protocol for the connection - amongst multiple other changes/improvements/annoyances :twisted:

In short:
If you have to go through a firewall, you are better off using Samba.

samba is mainly for windows... I don't want to refrain from that. both machines are linux
_________________
Only two things are infinite, the universe and human stupidity and I'm not sure about the former - Albert Einstein
Back to top
View user's profile Send private message
depontius
Advocate
Advocate


Joined: 05 May 2004
Posts: 3450

PostPosted: Tue Mar 23, 2010 4:43 pm    Post subject: Reply with quote

DaggyStyle wrote:

fangorn wrote:
Quote:
, for some reason

The reason is design. :wink:

NFS up to version 3 uses multiple daemons. Responsible for this behaviour is portmap. AFAIK you cannot fix NFS v3.x to a specific port.

NFS v4 AFAIK has the ability to specify a port and protocol for the connection - amongst multiple other changes/improvements/annoyances :twisted:

In short:
If you have to go through a firewall, you are better off using Samba.

samba is mainly for windows... I don't want to refrain from that. both machines are linux


Can you move to NFS V4? It sounds as if it has the port specification capability you need. In addition, since you appear to be talking about a non-LAN connection to the laptop, NFS V4 also supports CacheFS. (I run NFS V4 on my home LAN, though I haven't gotten around to CacheFS, yet.)
_________________
.sigs waste space and bandwidth
Back to top
View user's profile Send private message
DaggyStyle
Watchman
Watchman


Joined: 22 Mar 2006
Posts: 5587

PostPosted: Tue Mar 23, 2010 4:47 pm    Post subject: Reply with quote

depontius wrote:
DaggyStyle wrote:

fangorn wrote:
Quote:
, for some reason

The reason is design. :wink:

NFS up to version 3 uses multiple daemons. Responsible for this behaviour is portmap. AFAIK you cannot fix NFS v3.x to a specific port.

NFS v4 AFAIK has the ability to specify a port and protocol for the connection - amongst multiple other changes/improvements/annoyances :twisted:

In short:
If you have to go through a firewall, you are better off using Samba.

samba is mainly for windows... I don't want to refrain from that. both machines are linux


Can you move to NFS V4? It sounds as if it has the port specification capability you need. In addition, since you appear to be talking about a non-LAN connection to the laptop, NFS V4 also supports CacheFS. (I run NFS V4 on my home LAN, though I haven't gotten around to CacheFS, yet.)

what's a non lan laptop?
_________________
Only two things are infinite, the universe and human stupidity and I'm not sure about the former - Albert Einstein
Back to top
View user's profile Send private message
depontius
Advocate
Advocate


Joined: 05 May 2004
Posts: 3450

PostPosted: Tue Mar 23, 2010 5:10 pm    Post subject: Reply with quote

DaggyStyle wrote:

what's a non lan laptop?


I got (somehow?) the impression that your laptop was an NFS client, but it was going to be routed to your NFS server instead of plugged into the same immediate network. I guess others talked about firewalls and port filtering, not you. But it left me with the impression of having a laptop on the road, wanting to VPN into your home NFS server. (But then again, if you're using a VPN to get in, you're in, and you don't have to worry about port numbers.)
_________________
.sigs waste space and bandwidth
Back to top
View user's profile Send private message
DaggyStyle
Watchman
Watchman


Joined: 22 Mar 2006
Posts: 5587

PostPosted: Tue Mar 23, 2010 5:21 pm    Post subject: Reply with quote

depontius wrote:
DaggyStyle wrote:

what's a non lan laptop?


I got (somehow?) the impression that your laptop was an NFS client, but it was going to be routed to your NFS server instead of plugged into the same immediate network. I guess others talked about firewalls and port filtering, not you. But it left me with the impression of having a laptop on the road, wanting to VPN into your home NFS server. (But then again, if you're using a VPN to get in, you're in, and you don't have to worry about port numbers.)

I'll try to keep is simple.
I have a desktop which is a binhost.
I have a laptop which has no portage tree, I use nfs to mount the tree when updating the laptop.
problem is that mount nfs uses random ports.
_________________
Only two things are infinite, the universe and human stupidity and I'm not sure about the former - Albert Einstein
Back to top
View user's profile Send private message
depontius
Advocate
Advocate


Joined: 05 May 2004
Posts: 3450

PostPosted: Tue Mar 23, 2010 6:58 pm    Post subject: Reply with quote

Then the question becomes, "What freedom do you have to configure the machines?"
I'm presuming the problem here is that the desktop is running a firewall, and you want to keep it that way.
From the man page :
Code:
       port=n         The  numeric value of the server's NFS service port.  If
                      the server's NFS service is not available on the  speci-
                      fied port, the mount request fails.

                      If  this  option  is  not specified, or if the specified
                      port value is 0, then the NFS client uses the  NFS  ser-
                      vice port number advertised by the server's rpcbind ser-
                      vice.  The mount request fails if the  server's  rpcbind
                      service  is  not  available, the server's NFS service is
                      not registered with its rpcbind service, or the server's
                      NFS service is not available on the advertised port.

       mountport=n    The  numeric  value of the server's mountd port.  If the
                      server's mountd service is not available on  the  speci-
                      fied port, the mount request fails.

                      If  this  option  is  not specified, or if the specified
                      port value is 0, then  the  mount(8)  command  uses  the
                      mountd  service  port  number advertised by the server's
                      rpcbind  service.   The  mount  request  fails  if   the
                      server's  rpcbind service is not available, the server's
                      mountd service is not registered with its  rpcbind  ser-
                      vice, or the server's mountd service is not available on
                      the advertised port.

                      This option can be used  when  mounting  an  NFS  server
                      through a firewall that blocks the rpcbind protocol.

Presuming you can tweak the nfs server, tweak the client, and tweak the firewall to match, does this do what you need?
_________________
.sigs waste space and bandwidth
Back to top
View user's profile Send private message
DaggyStyle
Watchman
Watchman


Joined: 22 Mar 2006
Posts: 5587

PostPosted: Tue Mar 23, 2010 7:24 pm    Post subject: Reply with quote

mmm, I've missed the mountport thingie, thanks will try later but it will take time as I won't be home for the next two weeks due to holiday.
_________________
Only two things are infinite, the universe and human stupidity and I'm not sure about the former - Albert Einstein
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum