linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.com>
To: Joachim Banzhaf <joachim.banzhaf@googlemail.com>,
	linux-nfs@vger.kernel.org
Cc: "joachim.banzhaf" <joachim.banzhaf@googlemail.com>
Subject: Re: rpcbind allowed port range on linux
Date: Fri, 02 Dec 2016 11:14:38 +1100	[thread overview]
Message-ID: <87h96n6vbl.fsf@notabene.neil.brown.name> (raw)
In-Reply-To: <CABW3MLd5Bo-xBtLqtB4e-pD2hCYAuRaBBsqBFTiws5-HohjPTw@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1734 bytes --]

On Fri, Dec 02 2016, Joachim Banzhaf wrote:

> Hi list,
>
> my problem is, rpcbind gave a tcp port to nlockmgr where I assumed
> this port is reserved.

That isn't how it works. rpcbind doesn't give ports to anyone.

lockd chooses a port, and asks rpcbind to register it against the
nlockmgr service.
If lockd is choosing a port that you don't want it to, you need to
get lockd to change its behavior.

One way is to explicitly tell lockd what port to use.  The "--nlm-port"
option to rpc.statd can do this.

By default, a number will be chosen from the range given in
  /proc/sys/net/ipv4/ip_local_port_range 

You can change that range, and that will affect all sockets which don't
ask for an explicit port.

NeilBrown


>
> Now, I didn't find the spec that says which ports rpcbind is allowed
> to use, but I thought it is the ephemeral ports, on linux defined with
> the range in kernel configuration net.ipv4.ip_local_reserved_ports
> minus exclusions from net.ipv4.ip_local_reserved_ports.
>
> So, my questions are
> 1) Is my assumption about allowed ports correct?
> 2) If not: how can I define that range?
> 3) If yes: was there a fix for that since my rather old SLES 12
> version rpcbind-0.2.1_rc4 (kernel 3.12.55)? I didn't find something
> obvious to me in the changelog.
>
> Bonus question: would it have been safe/possible to free up the port,
> e.g. with rpcbind -d? I only found out about that option after a
> reboot...
>
> BR,
> Joachim
>
> (please keep me in cc)
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

  reply	other threads:[~2016-12-02  0:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-01 16:51 rpcbind allowed port range on linux Joachim Banzhaf
2016-12-02  0:14 ` NeilBrown [this message]
2016-12-02  0:50   ` Trond Myklebust
2016-12-02  8:32     ` Joachim Banzhaf
2016-12-02 17:33       ` Joachim Banzhaf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87h96n6vbl.fsf@notabene.neil.brown.name \
    --to=neilb@suse.com \
    --cc=joachim.banzhaf@googlemail.com \
    --cc=linux-nfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).