From owner-freebsd-stable@FreeBSD.ORG Thu Mar 15 20:26:28 2007 Return-Path: X-Original-To: freebsd-stable@FreeBSD.ORG Delivered-To: freebsd-stable@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DFB9D16A510 for ; Thu, 15 Mar 2007 20:26:28 +0000 (UTC) (envelope-from hartzell@alerce.com) Received: from merlin.alerce.com (merlin.alerce.com [64.62.142.94]) by mx1.freebsd.org (Postfix) with ESMTP id C2C4D13C455 for ; Thu, 15 Mar 2007 20:26:28 +0000 (UTC) (envelope-from hartzell@alerce.com) Received: from merlin.alerce.com (localhost [127.0.0.1]) by merlin.alerce.com (Postfix) with ESMTP id 5B79D33C70; Thu, 15 Mar 2007 13:07:52 -0700 (PDT) Received: from satchel.alerce.com (unknown [192.168.72.178]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "satchel.alerce.com", Issuer "alerce.com" (verified OK)) by merlin.alerce.com (Postfix) with ESMTP id 13AC233C5B; Thu, 15 Mar 2007 13:07:52 -0700 (PDT) Received: from satchel.alerce.com (localhost [127.0.0.1]) by satchel.alerce.com (8.13.8/8.13.8) with ESMTP id l2FGOd1S002334 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 15 Mar 2007 09:24:39 -0700 (PDT) (envelope-from hartzell@satchel.alerce.com) Received: (from hartzell@localhost) by satchel.alerce.com (8.13.8/8.13.8/Submit) id l2FGOdth002329; Thu, 15 Mar 2007 09:24:39 -0700 (PDT) (envelope-from hartzell) From: George Hartzell MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <17913.29510.964120.616304@satchel.alerce.com> Date: Thu, 15 Mar 2007 09:24:38 -0700 To: Willy@Offermans.Rompen.nl In-Reply-To: <20070315133346.GA5645@wiz> References: <20070314104732.GA5794@wiz> <45F7D727.2080301@unsane.co.uk> <20070315133346.GA5645@wiz> X-Mailer: VM 7.19 under 21.4 (patch 20) "Double Solitaire" XEmacs Lucid X-Virus-Scanned: ClamAV using ClamSMTP Cc: Vince , freebsd-stable@FreeBSD.ORG, openvpn-users@lists.sourceforge.net Subject: Re: tap device at boot time X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: hartzell@alerce.com List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Mar 2007 20:26:29 -0000 Willy Offermans writes: > On Wed, Mar 14, 2007 at 11:06:15AM +0000, Vince wrote: > > Willy Offermans wrote: > > > Dear FreeBSD friends, > > > > > > Is it possible to add and configure a tap device at boot time of > > > FreeBSD? I mean the same as a normal NIC. In my rc.conf: > > > > > > > > > ... > > > ifconfig_xl0="inet 192.168.0.2 promisc netmask 255.255.255.0" > > > ifconfig_rl0="inet 192.168.4.2 netmask 255.255.255.0" > > > ifconfig_tap0="inet 10.8.0.1 netmask 255.255.255.0" > > > ... > > > > > > > > try adding > > cloned_interfaces="tap0" > > > > to your rc.conf > > > > Vince > > > and in my /boot/loader.conf: > > > > > > ... > > > if_tap_load="YES" > > > ... > > > > > > > > > if_xl0 and if_rl0 are compiled into the kernel. > > > > > > Maybe it is even possible to set the MAC address of the tap device!? > > > > > > The tap device should be available before named and dhcpd have been > > > started. In that way I can provide IP addresses over the tap device > > > and add appropriate DNS entries. > > > > > > I like to run openvpn with tap devices and want to use the dhcpd server > > > to provide IP addresses and update the named. This works quite well. > > > However after reboot I always have to restart named and dhcpd again > > > since the tap device becomes available after these services have started > > > during boot. I guess this problem will be solved if the tap device is > > > already available and configured before named and dhcpd have started. > > > > > > > Hello Vince, > > Thank you for your response, but unfortunately adding > cloned_interfaces="tap0" to my rc.conf did not solve the issue. The > tap0 device only appeared after I started the openvpn daemon. Is there > a way to determine the order to start the daemons. Maybe I can solve > the problem in that way. > > I wonder why it is so hard to accomplish this. FreeBSD is usually very > intuitive in initialising device support. Naively I would think: load > the kernel_module and run ifconfig and you are there. For xl0 and rl0 > it will work like this, I guess, but for tap0 certainly not. What kind > of a kick does this tap device need? Is it that special? Openvpn needs > to know which tap to use, but that is it, I guess. The rest is up to > the kernel to do the trick, isn't it? Maybe I have to dig in the source > code of openvpn to find out how to initialise the tap device. > [...] Are you sure that you need to initialize the tap0 device like this? I use tun's instead of tap's, but in my openvpn server config I have a line that says dev tun and a bit further down I have a line that says server 10.8.0.0 255.255.255.0 and openvpn takes care of setting up the device itself. Everything I've read suggests that it should work the same way for a tap device. g.