From owner-freebsd-net@FreeBSD.ORG Mon Sep 28 23:15:01 2009 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9CED01065672 for ; Mon, 28 Sep 2009 23:15:01 +0000 (UTC) (envelope-from juli@clockworksquid.com) Received: from mail-pz0-f194.google.com (mail-pz0-f194.google.com [209.85.222.194]) by mx1.freebsd.org (Postfix) with ESMTP id 7DF988FC13 for ; Mon, 28 Sep 2009 23:15:01 +0000 (UTC) Received: by pzk32 with SMTP id 32so2862519pzk.3 for ; Mon, 28 Sep 2009 16:15:01 -0700 (PDT) MIME-Version: 1.0 Sender: juli@clockworksquid.com Received: by 10.142.209.21 with SMTP id h21mr280362wfg.162.1254179701184; Mon, 28 Sep 2009 16:15:01 -0700 (PDT) In-Reply-To: <6201873e0909281450x2d457608yd0548db12fb21a97@mail.gmail.com> References: <6201873e0909281321s51e3d485i1074954d43b657d6@mail.gmail.com> <6201873e0909281450x2d457608yd0548db12fb21a97@mail.gmail.com> From: Juli Mallett Date: Mon, 28 Sep 2009 16:14:41 -0700 X-Google-Sender-Auth: 03617006a527e4ec Message-ID: To: Adam Vande More Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Cc: freebsd-net@freebsd.org Subject: Re: tap dhcp X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Sep 2009 23:15:01 -0000 On Mon, Sep 28, 2009 at 14:50, Adam Vande More wrot= e: > Should I recieve a response? =A0From tap(4), and other examples my > understanding is yes, but that is not what I'm seeing in practice. =A0For= give > my ignorance, but wouldn't bridge0 pass a response back to tap0? tap(4) takes the network interface layer of the kernel and allows a user process to interact with it directly. If I am writing, for example, a program to tunnel traffic over IRC channels (or any other broadcast medium; tun(4) is more appropriate for point-to-point links) I can have my IRC client create a tap(4) device. Then, when I try to ping a system through the tap(4) interface, the networking layer takes the packet and sends it up to my IRC client. My IRC client then (let's say) base64 encodes it and spews it into the channel. Another IRC client in that channel with the same code running on it sees that I've sent a packet and base64 decodes it and sends it down into their kernel's tap(4) interface. Then that comes through the packet input codepath =97 the kernel sees that data as though it were a packet come in off the wire. Packets that go out on a tap(4), e.g. via ping, are sent to a userland process. Packets can only come in (in the sense of the input path of the network stack) on a tap(4) via that same channel with a userland process. > My goal is essentially clone my network connection recieving two DHCP lea= ses > to the same box. =A0Also I am aware of ifconfig alias, but that didn't se= em up > to the task. There are things you can do with netgraph, but they're not very good. Do you actually want both interfaces to see the same traffic, or do you want to create two virtual interfaces attached to one physical? If you provide a clear description of your needs, somebody else can probably help you. I'm out of touch on the latest and greatest way to do this with FreeBSD, sorry. Juli.