question regarding tap/tun devices

Brooks Davis brooks at one-eyed-alien.net
Tue May 30 10:38:26 PDT 2006


On Tue, May 30, 2006 at 09:49:01AM +0100, Robert Watson wrote:
> 
> On Mon, 29 May 2006, Brooks Davis wrote:
> 
> >On Sun, May 28, 2006 at 08:33:32PM +0200, Goran Gajic wrote:
> >>I'm running 7.0-CURRENT build Thu May 25 23:17:10 CEST 2006 GENERIC 
> >>config.
> >>While playing with dynamips emulator which uses tap I've noticed that
> >>ifconifg tun0 create or ifconfig tap0 create doesn't work (this doesn't
> >>have anything to do with emulator which works great).
> >
> >These interfaces don't use the network interface cloning interface and 
> >thus can not be created with ifconfig.  This should be fixed, but the /dev 
> >based cloning hackes they use make this difficult.
> 
> I've never quite understood if this is a problem or a benefit.  
> Devfs-cloning of tap and tun are very convenient from an application writer 
> perspective -- you just open /dev/tap or /dev/tun, and magic happens.  With 
> our current ifnet cloning interface, is it possible to say "atomically 
> create and return the next available interface number"?

If you don't provide a unit number (i.e. "ifconfig gif create") you
get the next available one and ifconfig outputs it on stdout (unless
you rename it in the same command).  I think we'll need to support
/dev/{tap,tun} style cloning in the future (there's way too much code
that depends on it), but I think we also should support ifconfig cloning
as well.  The two main reasons I see for doing so are that users now
expect it and that is provides a way to remove the interfaces.

-- Brooks

-- 
Any statement of the form "X is the one, true Y" is FALSE.
PGP fingerprint 655D 519C 26A7 82E7 2529  9BF0 5D8E 8BE9 F238 1AD4
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-current/attachments/20060530/c3c21e7d/attachment.pgp


More information about the freebsd-current mailing list