From owner-freebsd-net@FreeBSD.ORG Thu Jan 15 12:09:09 2004 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 06FC916A4CE for ; Thu, 15 Jan 2004 12:09:09 -0800 (PST) Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id A826E43D41 for ; Thu, 15 Jan 2004 12:09:06 -0800 (PST) (envelope-from robert@fledge.watson.org) Received: from fledge.watson.org (localhost [127.0.0.1]) by fledge.watson.org (8.12.10/8.12.10) with ESMTP id i0FK7KUd075637; Thu, 15 Jan 2004 15:07:20 -0500 (EST) (envelope-from robert@fledge.watson.org) Received: from localhost (robert@localhost)i0FK7Kvb075634; Thu, 15 Jan 2004 15:07:20 -0500 (EST) (envelope-from robert@fledge.watson.org) Date: Thu, 15 Jan 2004 15:07:20 -0500 (EST) From: Robert Watson X-Sender: robert@fledge.watson.org To: Vlad Galu In-Reply-To: <20040115053524.2c6e8db2.dudu@diaspar.rdsnet.ro> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-net@freebsd.org Subject: Re: Dummy Network Interface X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2004 20:09:09 -0000 On Thu, 15 Jan 2004, Vlad Galu wrote: > |On Tue, 13 Jan 2004 ms419@freezone.co.uk wrote: > | > |> How does one create a dummy network interface in FreeBSD? > | > |Dummy in what sense? An interface where the packets are simply > |dropped? if_tap and if_tun both provide pseudo-device in /dev that a > |userspace process can attach to in order to emulate a network interface > |(used by VMWare, ppp, various tunneling bits, ...) In the absense of a > |process sitting on the device, they simply drop the packets. Although > |they may get garbage-collected if unused on -CURRENT... You can also > |use netgraph to bring pseudo-interfaces, perhaps without anywhere for > |packets to go. > | > |And, I suppose, create in what sense? Are you looking at this from a > |developer perspective, or you just need one from a user perspective. > |If writing a device driver (and hence needing a starting point), if_tap > |and if_tun are fairly decent models for a pseudo-interface. > > I think he could use the discard interface smoothly. On Linux > (from which the dummy interface notion is taken from) it is simply used > for testing purposes, as in routing, or perhaps socket programming. I > personally have used it for a while, but then I used interface aliasing, > which became a habit. Does the discard interface in Linux "act like" another type of interface, such as point-to-point, ethernet, etc? Robert N M Watson FreeBSD Core Team, TrustedBSD Projects robert@fledge.watson.org Senior Research Scientist, McAfee Research