Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 28 Sep 2009 16:14:41 -0700
From:      Juli Mallett <jmallett@FreeBSD.org>
To:        Adam Vande More <amvandemore@gmail.com>
Cc:        freebsd-net@freebsd.org
Subject:   Re: tap dhcp
Message-ID:  <eaa228be0909281614k498f808cvd267fe24d41b19f1@mail.gmail.com>
In-Reply-To: <6201873e0909281450x2d457608yd0548db12fb21a97@mail.gmail.com>
References:  <6201873e0909281321s51e3d485i1074954d43b657d6@mail.gmail.com>  <eaa228be0909281414l3762e8a1rd0e7c43457a23b0e@mail.gmail.com>  <6201873e0909281450x2d457608yd0548db12fb21a97@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Sep 28, 2009 at 14:50, Adam Vande More <amvandemore@gmail.com> 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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?eaa228be0909281614k498f808cvd267fe24d41b19f1>