From owner-freebsd-stable@FreeBSD.ORG Thu Mar 15 13:33:39 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 8611516A403 for ; Thu, 15 Mar 2007 13:33:39 +0000 (UTC) (envelope-from willy@Offermans.Rompen.nl) Received: from psmtp14.wxs.nl (psmtp14.wxs.nl [195.121.247.46]) by mx1.freebsd.org (Postfix) with ESMTP id 2065913C45B for ; Thu, 15 Mar 2007 13:33:38 +0000 (UTC) (envelope-from willy@Offermans.Rompen.nl) Received: from jerry.offrom.nl (ip5652b794.speed.planet.nl [86.82.183.148]) by psmtp14.wxs.nl (8.13.8/8.12.10) with ESMTP id l2FDXaPm011738; Thu, 15 Mar 2007 14:33:37 +0100 Received: from wiz.offrom.nl (wizvpn.offromvpn.nl [10.8.0.18]) by jerry.offrom.nl (8.13.6/8.13.6) with ESMTP id l2FDXYEu001203; Thu, 15 Mar 2007 14:33:34 +0100 (CET) (envelope-from willy@offrom.nl) Received: from willy by wiz.offrom.nl with local (Exim 4.50) id 1HRq5S-0001fF-La; Thu, 15 Mar 2007 14:33:46 +0100 Date: Thu, 15 Mar 2007 14:33:46 +0100 From: Willy Offermans To: Vince Message-ID: <20070315133346.GA5645@wiz> References: <20070314104732.GA5794@wiz> <45F7D727.2080301@unsane.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <45F7D727.2080301@unsane.co.uk> User-Agent: Mutt/1.5.9i X-Virus-Scanned: ClamAV 0.90/2841/Thu Mar 15 12:11:45 2007 on jerry.offrom.nl X-Virus-Status: Clean X-Spam-Status: No, score=-4.2 required=10.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.8 X-Spam-Checker-Version: SpamAssassin 3.1.8 (2007-02-13) on jerry.offrom.nl Cc: 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: Willy@Offermans.Rompen.nl 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 13:33:39 -0000 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. -- Met vriendelijke groeten, With kind regards, Mit freundlichen Gruessen, De jrus wah, Willy ************************************* W.K. Offermans Home: +31 45 544 49 44 Mobile: +31 653 27 16 23 e-mail: Willy@Offermans.Rompen.nl Powered by .... (__) \\\'',) \/ \ ^ .\._/_) www.FreeBSD.org