From owner-freebsd-hackers@FreeBSD.ORG Sun Jul 8 13:38:11 2007 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9A6EB16A468 for ; Sun, 8 Jul 2007 13:38:11 +0000 (UTC) (envelope-from simias.n@gmail.com) Received: from simias.hd.free.fr (vit94-5-82-243-51-8.fbx.proxad.net [82.243.51.8]) by mx1.freebsd.org (Postfix) with ESMTP id 2C40C13C458 for ; Sun, 8 Jul 2007 13:38:10 +0000 (UTC) (envelope-from simias.n@gmail.com) Received: from simias.hd.free.fr (localhost [127.0.0.1]) by simias.hd.free.fr (8.14.1/8.14.1) with ESMTP id l68DNEoJ044392 for ; Sun, 8 Jul 2007 15:23:14 +0200 (CEST) (envelope-from simias.n@gmail.com) Received: (from simias@localhost) by simias.hd.free.fr (8.14.1/8.14.1/Submit) id l68DMwIo044391; Sun, 8 Jul 2007 15:22:58 +0200 (CEST) (envelope-from simias.n@gmail.com) X-Authentication-Warning: simias.hd.free.fr: simias set sender to simias.n@gmail.com using -f From: Simias To: freebsd-hackers@freebsd.org Date: Sun, 08 Jul 2007 15:22:43 +0200 Message-ID: <868x9rav30.fsf@simias.hd.free.fr> User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: playing with tun X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jul 2007 13:38:11 -0000 Hello hackers, I'm trying to make an ip tunnel using the tun(4) interface. I successfully open the tunnel, and after configuration it with ifconfig, I receive and send the ip packets without problem. However, I'd like to do this without ifconfig, so i can set the ip/netmask/broadcast/... by myself in the program. I've found the proper ioctls in the ifconfig source code, but i don't know how to use them, since it seems I have to know the name of the tunX interface (or at least, that's what i think). So my question is: once I've opened /dev/tun, how can i know the name of the network interface it created, so i can configure it? Thank you, -- Simias