From owner-freebsd-questions@freebsd.org Wed Sep 2 15:58:47 2020 Return-Path: Delivered-To: freebsd-questions@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 338A03DB299 for ; Wed, 2 Sep 2020 15:58:47 +0000 (UTC) (envelope-from freebsd@qeng-ho.org) Received: from bede.qeng-ho.org (bede.qeng-ho.org [217.155.128.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4BhTBZ4WNZz4vD6 for ; Wed, 2 Sep 2020 15:58:46 +0000 (UTC) (envelope-from freebsd@qeng-ho.org) Received: from arthur.home.qeng-ho.org (arthur.home.qeng-ho.org [172.23.1.2]) by bede.qeng-ho.org (Postfix) with ESMTP id 71C9810635; Wed, 2 Sep 2020 16:58:45 +0100 (BST) Subject: Re: rpcbind opening random insecure(?) ports? To: Yuri Pankov , FreeBSD-Questions References: <6831e7a5-dc1c-2495-b2ce-a5d1eae6606c@qeng-ho.org> From: Arthur Chance Message-ID: <09031802-22b8-a0d8-0692-7ec0cbb51057@qeng-ho.org> Date: Wed, 2 Sep 2020 16:58:45 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4BhTBZ4WNZz4vD6 X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of freebsd@qeng-ho.org designates 217.155.128.241 as permitted sender) smtp.mailfrom=freebsd@qeng-ho.org X-Spamd-Result: default: False [-1.98 / 15.00]; RCVD_TLS_LAST(0.00)[]; ARC_NA(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:217.155.128.240/29]; NEURAL_HAM_LONG(-1.07)[-1.068]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[qeng-ho.org]; NEURAL_HAM_MEDIUM(-0.98)[-0.982]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; NEURAL_HAM_SHORT(-0.63)[-0.632]; RCPT_COUNT_TWO(0.00)[2]; FREEMAIL_TO(0.00)[xsmail.com,freebsd.org]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:13037, ipnet:217.155.0.0/16, country:GB]; SUBJECT_ENDS_QUESTION(1.00)[]; MAILMAN_DEST(0.00)[freebsd-questions]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Sep 2020 15:58:47 -0000 On 02/09/2020 16:55, Yuri Pankov wrote: > Arthur Chance wrote: >> I have a multi-homed server that I use, amongst other things, as an NFS >> server for my lan. To stop them being visible on the other interfaces >> rpcbind, nfsd and mountd all have -h command arguments restricting them >> to the lan's IPv4 and IPv6 addresses. This works fine for nfsd and >> mountd, but sockstat -l shows rpcbind opening unrestricted ports >> >> USER     COMMAND    PID   FD PROTO  LOCAL ADDRESS         FOREIGN ADDRESS >> root     rpcbind    18959 5  stream /var/run/rpcbind.sock >> root     rpcbind    18959 6  udp6   ::1:111               *:* >> root     rpcbind    18959 7  udp6   2a02:8010:64c9:1::3:111 *:* >> root     rpcbind    18959 8  udp6   *:765                 *:* >> root     rpcbind    18959 9  tcp6   ::1:111               *:* >> root     rpcbind    18959 10 tcp6   2a02:8010:64c9:1::3:111 *:* >> root     rpcbind    18959 11 udp4   127.0.0.1:111         *:* >> root     rpcbind    18959 12 udp4   172.23.1.3:111        *:* >> root     rpcbind    18959 13 udp4   *:778                 *:* >> root     rpcbind    18959 14 tcp4   127.0.0.1:111         *:* >> root     rpcbind    18959 15 tcp4   172.23.1.3:111        *:* >> root     rpcbind    18959 17 udp6   *:*                   *:* >> >> Note the *:765 and *:* ports listening on udp6 and *:778 port on udp4. >> >> Why is it doing this and how do I stop it? >> >> This is on amd64 12.1-RELEASE-p8, not using NFSv4. > > What does `rpcinfo -p` think about it? It only shows the port 111 sockets: root@nas:0# rpcinfo -p program vers proto port service 100000 4 tcp 111 rpcbind 100000 3 tcp 111 rpcbind 100000 2 tcp 111 rpcbind 100000 4 udp 111 rpcbind 100000 3 udp 111 rpcbind 100000 2 udp 111 rpcbind 100000 4 local 111 rpcbind 100000 3 local 111 rpcbind 100000 2 local 111 rpcbind 100005 1 udp 954 mountd 100005 3 udp 954 mountd 100005 1 tcp 954 mountd 100005 3 tcp 954 mountd 100003 2 udp 2049 nfs 100003 3 udp 2049 nfs 100003 2 tcp 2049 nfs 100003 3 tcp 2049 nfs -- The number of people predicting the demise of Moore's Law doubles every 18 months.