From owner-freebsd-fs@FreeBSD.ORG Mon Dec 28 23:25:47 2009 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3E12810656A3 for ; Mon, 28 Dec 2009 23:25:47 +0000 (UTC) (envelope-from marco@tols.org) Received: from tols.org (goofy.tols.org [83.163.60.200]) by mx1.freebsd.org (Postfix) with ESMTP id BF6418FC12 for ; Mon, 28 Dec 2009 23:25:46 +0000 (UTC) Received: from donald.home.tols.org (localhost [127.0.0.1]) by donald.home.tols.org (8.14.3/8.14.3) with ESMTP id nBSMqSIn006569 for ; Mon, 28 Dec 2009 22:52:28 GMT (envelope-from marco@donald.home.tols.org) Received: (from marco@localhost) by donald.home.tols.org (8.14.3/8.14.3/Submit) id nBSMqSOZ006568 for freebsd-fs@freebsd.org; Mon, 28 Dec 2009 23:52:28 +0100 (CET) (envelope-from marco) Date: Mon, 28 Dec 2009 23:52:28 +0100 From: Marco van Tol To: freebsd-fs@freebsd.org Message-ID: <20091228225228.GA1114@donald.home.tols.org> Mail-Followup-To: freebsd-fs@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.3i Subject: zfs sharenfs to multiple subnets - found a dirty looking hack X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Dec 2009 23:25:47 -0000 Hi there, I would like to refer to a thread in this list about zfs exporting to multiple subnets using sharenfs. The thread I mean is this one: http://lists.freebsd.org/pipermail/freebsd-fs/2008-September/005158.html I wasn't subscribed at the time, so I'm just referencing to the thread. I was testing and needed to also export a filesystem to multiple subnets, and found something out that may or may not be allowed. What happens is you start to type zfs set sharenfs=" and don't close the double quote. The result on the following lines will literally make it to /etc/zfs/exports, and make it work as desired. A full session would look like: (Bear with me for typo's, I didn't copy-paste) zfs set sharenfs="-maproot=root -network 10.0.0.0/24 > /path/to/mountpoint -maproot=root -network 192.168.0.0/24 > /path/to/mountpoint -maproot=root -network 172.16.0.0/24" pool0/space This translates to an /etc/zfs/exports like: ----< cut here >---- /path/to/mountpoint -maproot=root -network=10.0.0.0/24 /path/to/mountpoint -maproot=root -network=192.168.0.0/24 /path/to/mountpoint -maproot=root -network=172.16.0.0/24 ----< cut here >---- The resulting "zfs get sharenfs" looks like: ----< cut here >---- pool0/space sharenfs -maproot=root -network=10.0.0.0/24 /path/to/mountpoint -maproot=root -network=192.168.0.0/24 /path/to/mountpoint -maproot=root -network=172.16.0.0/24 local ----< cut here >---- This all makes it work so that it exports the pool to multiple subnets, possibly with their own properties. Question is however, how desirable is it that this works? ;-) Kind regards, Marco van Tol -- It's fried rice, you plick. -- Lethal Weapon 4